Click here to Skip to main content
15,906,816 members

Comments by xunbei100 (Top 8 by date)

xunbei100 11-Jun-10 21:04pm View    
Follow your suggestion,I corrected my code. And I am quite sure about what my problem exactly be,
and the issue is still the crash caused by calling the function which return a char pointer pointing to a block memory allocated in the other dll.
And I had check the memory content by the pointer value,the memory is right,and I can get the right char array through the calling,
but it come to a crash when I delete the pointer to free the memory just following the calling.
PS: this problem only happened in the debug version, in the release version there's no problem ,
there's a Assert in the debug mode and it was omited under the release( "_CrtIsValidHeapPointer" ),
It is the problem that make me confused, if the memory heap is invalid ,how can I get the right char array?
Thank you very much for you help,I had a big lesson, ^_^
xunbei100 11-Jun-10 10:22am View    
You are rigth, thks,I did make lots of mistakes ,sorry again.
I changed the "char* temp" to "char temp[]" ,and the result is the same.
May be Cedric is right,I will try to fix it by other ways.

Thank you again.
xunbei100 11-Jun-10 7:22am View    
Thank you for you suggestion, it's a good idea. And I still wanna konw why my code went to crash.
xunbei100 11-Jun-10 7:17am View    
sure, I stepped through this code for several times and I checked the content of memory by the pointer value. and if I delete the array in the "readfile" function, there's no problem.
xunbei100 11-Jun-10 5:54am View    
I will have a litte simpler sample to test the problem and make it sure that if the problem still exists.
thank you for you help.