15,906,816 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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.
xunbei100
11-Jun-10 5:49am
View
Thank you very much! I got a wrong code above, and I correct it fllow!
xunbei100
11-Jun-10 5:42am
View
I am very sorry , My code post above was wrong ,the fact is that ,I did considered the termination zero of the array and my right code as fllow:
buffer = new char [length +1 ]; //mark line1
memset(buffer,0,length + 1); //mark line2
and the problem still exists!
xunbei100
11-Jun-10 5:04am
View
I do not understand you answer still, sorry, is there any problem when the array length is fix. It seems a common usage of the delete operator.
Show More