|
-
May 28th, 2019, 12:58 PM
#7
Re: Reading contents of file into SetWindowTextA for output into an Edit field of win
Why GlobalAlloc() after all?
You can just use standard C++ memory allocation.
Preferably using some kind of RAII object like std::vector.
So, instead of GlobalAlloc(), create std::vector of the required size, and pass the address of the first element to ReadFile() to fill the vector with the data.
All memory will be cleaned up automatically.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|