WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
Pages (2) [1] 2   ( Go to first unread post )

How to display textfile in richedit with OpenFile?

Wessol
Quote Post


Member
**

Group: Members
Posts: 32
Member No.: 51593
Joined: 16-May 12


Hi all, I'm trying to make a notepad in asm. i got already some things like menu.
but i want to when a user open a txt file from the menu "open", that the text inside this txt file is displayed in the richedit. Is there anyone who can help me?
PMEmail Poster
Top
lilljocke
Quote Post


Active Member
***

Group: Members
Posts: 53
Member No.: 1132
Joined: 26-March 05


Hi I just fixed the opening thing in your notepad
good luck smile.gif

Attached File ( Number of downloads: 5 )
 Login or Register to download
PMEmail PosterMSN
Top
Wessol
Quote Post


Member
**

Group: Members
Posts: 32
Member No.: 51593
Joined: 16-May 12


Hi, many thanks for fixing it smile.gif

But could you explain what you did to make it work, so comment some lines?

And why do you use "CreateFile", you can leave it because the file already exist as a txt file right?

And in my code, there is a line which i don't know what it does. It's popping hInstance from stack, but why it that needed? >> pop OFNstruc.hInstance ; ???
PMEmail Poster
Top
lilljocke
Quote Post


Active Member
***

Group: Members
Posts: 53
Member No.: 1132
Joined: 26-March 05


There's not much else to choose then CreateFile sad.gif
I made some comments on the lines i wrote. Hopefully it will explain it smile.gif

Attached File ( Number of downloads: 7 )
 Login or Register to download
PMEmail PosterMSN
Top
Wessol
Quote Post


Member
**

Group: Members
Posts: 32
Member No.: 51593
Joined: 16-May 12


Thank you very much! I understood the most of the lines now, but a few i still dont understand;

- Why are using CreateFile, I don't want that it creates a file, just want to read a text (.txt) file.

- And why we use this 2 lines, it doesn't do anything right? its just reading the imagebase/handle of the file and push it to stack, and right after this it's popping it again from stack. So no differense was made with those 2 lines right?

CODE

push hInstance; hInstance of the application that creates the open file dialog box
pop OFNstruc.hInstance; Pop handle from stack


- At last, why are insert this 2 lines? nFileSize & hMem... stands for handleMemory and nFileSize for ???

CODE

LOCAL nFileSize  :  DWORD
LOCAL hMem : DWORD
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages (2) [1] 2  Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google