Click here to Skip to main content
15,921,660 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DoModal functionality for CWnd Pin
Nish Nishant24-Feb-03 13:13
sitebuilderNish Nishant24-Feb-03 13:13 
GeneralRe: DoModal functionality for CWnd Pin
João Paulo Figueira25-Feb-03 4:42
professionalJoão Paulo Figueira25-Feb-03 4:42 
GeneralCrystal Report and Record number !!! Pin
Hadi Rezaee24-Feb-03 10:05
Hadi Rezaee24-Feb-03 10:05 
Generalnew/delete between dll calls Pin
Dave_24-Feb-03 9:30
Dave_24-Feb-03 9:30 
GeneralRe: new/delete between dll calls Pin
Chris Losinger24-Feb-03 9:45
professionalChris Losinger24-Feb-03 9:45 
GeneralRe: new/delete between dll calls Pin
Dave_24-Feb-03 10:04
Dave_24-Feb-03 10:04 
GeneralRe: new/delete between dll calls Pin
Chris Losinger24-Feb-03 10:10
professionalChris Losinger24-Feb-03 10:10 
GeneralRe: new/delete between dll calls Pin
Alvaro Mendez24-Feb-03 10:47
Alvaro Mendez24-Feb-03 10:47 
There are two problems here:

1. You're trying to delete the elements of the array individually. You allocate the array as one block of 15 elements and then you try to delete each element one at a time. That's not going to work. You must free the entire array in one shot:

delete [] pData;

2. Allocating on the DLL and then freeing on the app is generally a bad idea. If the memory is not allocated/freed the same way across both modules, it will cause a crash. So it's best to stick with the policy of making the one who creates the memory be the one who frees it.

Add a mydllFreeData member:

void mydllFreeData(DSTRUCT* pds)
{
   delete [] pds;
}


Regards,
Alvaro


The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing. -- Albert Einstein
QuestionError returning CStringArray as function result? Pin
yasbas24-Feb-03 9:29
yasbas24-Feb-03 9:29 
AnswerRe: Error returning CStringArray as function result? Pin
Dave_24-Feb-03 9:33
Dave_24-Feb-03 9:33 
AnswerRe: Error returning CStringArray as function result? Pin
Christian Graus24-Feb-03 9:52
protectorChristian Graus24-Feb-03 9:52 
GeneralRe: Error returning CStringArray as function result? Pin
Alvaro Mendez24-Feb-03 10:27
Alvaro Mendez24-Feb-03 10:27 
GeneralRe: Error returning CStringArray as function result? Pin
Christian Graus24-Feb-03 10:29
protectorChristian Graus24-Feb-03 10:29 
GeneralRe: Error returning CStringArray as function result? Pin
Alvaro Mendez24-Feb-03 11:03
Alvaro Mendez24-Feb-03 11:03 
GeneralRe: Error returning CStringArray as function result? Pin
Christian Graus24-Feb-03 11:31
protectorChristian Graus24-Feb-03 11:31 
Generaldeleting a CDialog... Pin
ns24-Feb-03 9:03
ns24-Feb-03 9:03 
GeneralRe: deleting a CDialog... Pin
Alvaro Mendez24-Feb-03 9:15
Alvaro Mendez24-Feb-03 9:15 
GeneralRe: deleting a CDialog... Pin
ns24-Feb-03 9:22
ns24-Feb-03 9:22 
GeneralRe: deleting a CDialog... Pin
Alvaro Mendez24-Feb-03 10:22
Alvaro Mendez24-Feb-03 10:22 
Generaloay, got it! Quick ques.. Pin
ns25-Feb-03 2:14
ns25-Feb-03 2:14 
GeneralRe: oay, got it! Quick ques.. Pin
Alvaro Mendez25-Feb-03 4:25
Alvaro Mendez25-Feb-03 4:25 
GeneralRe: deleting a CDialog... Pin
Nish Nishant24-Feb-03 9:17
sitebuilderNish Nishant24-Feb-03 9:17 
Generalthanks!! Also need to know... Pin
ns24-Feb-03 9:28
ns24-Feb-03 9:28 
GeneralRe: deleting a CDialog... Pin
valikac24-Feb-03 9:17
valikac24-Feb-03 9:17 
GeneralRe: deleting a CDialog... Pin
User 665824-Feb-03 9:18
User 665824-Feb-03 9:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.