Click to See Complete Forum and Search --> : Problem with GlobalFree and ReadFile


szpaqszpaq
February 10th, 2009, 12:45 PM
1.when i try to use GlobalFree function debugger says

"Windows has triggered a breakpoint in my.exe.
This may be due to a corruption of the heap, which indicates a bug in my.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while my.exe has focus.
The output window may have more diagnostic information."
actually program works fine without this

2.when i try to read text from file and put it in my edit box i get something like that
"獡杤慳杤摳獧杤㑷敷㉴㐳윀ä" in my edit box it looks like small rectangles

any solutions ?

Codeplug
February 10th, 2009, 12:52 PM
>> any solutions
Probably.
Start by reading this link. (http://www.chiark.greenend.org.uk/~sgtatham/bugs.html)

When you run your application under the debugger, examine the call-stack and surrounding variables for sanity.

Or post a complete compilable example that demonstrates the issue.

gg

szpaqszpaq
February 10th, 2009, 09:55 PM
nice article :D
i rewrite code from visual c++ (2008 express version) to dev-c++ (4.9.9.2) and all bugs gone, even this more hidden :D, visual c++ is to complicated to me

Codeplug
February 10th, 2009, 10:46 PM
>> and all bugs gone
A more accurate statement would be: "I can no longer observe any issues".

Dev-C++ is fairly old (and isn't being maintained) and the MinGW that comes with it is even older.

This is probably the best MinGW "distribution" on the internet:
http://nuwen.net/mingw.html

And here are two nice IDE's that you can use with it (I prefer CodeBlocks):
http://wxdsgn.sourceforge.net/
http://www.codeblocks.org/

gg

szpaqszpaq
February 11th, 2009, 09:46 AM
Really good to know this, thanks, I surely try this environment, can you tell me your opinion about Microsoft Visual c++ ?

Codeplug
February 11th, 2009, 09:59 AM
>> your opinion about Microsoft Visual c++
As a free IDE and GUI debugger, it's the best. As a free compiler for Windows based technologies, it's the best. As a free standards compliant compiler, GCC is the best.

gg