i can not pass CStringArray from dll
-
i can not pass CStringArray from dll.... my dll code here................... My.h ---- MY_API CStringArray MyName; MY_API void GetmyName(CStringArray _myname); My.cpp ------ MY_API void GetmyName(CStringArray _myname) { for(int i=0;i
-
i can not pass CStringArray from dll.... my dll code here................... My.h ---- MY_API CStringArray MyName; MY_API void GetmyName(CStringArray _myname); My.cpp ------ MY_API void GetmyName(CStringArray _myname) { for(int i=0;i
-
i can not pass CStringArray from dll.... my dll code here................... My.h ---- MY_API CStringArray MyName; MY_API void GetmyName(CStringArray _myname); My.cpp ------ MY_API void GetmyName(CStringArray _myname) { for(int i=0;i
--OR-- Pass the CStringArray address instead of a COPY of the entire string array :doh: MY_API CStringArray MyName; MY_API void GetmyName(CStringArray* _myname); My.cpp ------ MY_API void GetmyName(CStringArray* _myname) { for(int i=0;i { _myname->Add(MyName.GetAt(i)); } } typedef void (*EXTERNAL_NAME) (CStringArray* _myname); EXTERNAL_NAME dll_myname; ---- --- -- -- CStringArray aa; dll_myname(&aa); for(int i=0;i { m_ist.AddString(aa.GetAt(i)); }
-
--OR-- Pass the CStringArray address instead of a COPY of the entire string array :doh: MY_API CStringArray MyName; MY_API void GetmyName(CStringArray* _myname); My.cpp ------ MY_API void GetmyName(CStringArray* _myname) { for(int i=0;i { _myname->Add(MyName.GetAt(i)); } } typedef void (*EXTERNAL_NAME) (CStringArray* _myname); EXTERNAL_NAME dll_myname; ---- --- -- -- CStringArray aa; dll_myname(&aa); for(int i=0;i { m_ist.AddString(aa.GetAt(i)); }
great! this work ... but i have problem.. i accepted result and then error appear... i don't know what happen.. Debug Assertion Failed Program:debug\My.exe File:dbgheap.c Line:1011 Expression:_CrtIsValidHeapPointer(pUserData) Debug Assertion Failed Program:debug\My.exe File:dbgheap.c Line:1076 Expression:_pFirstBlock(pHead) Application Error The instruction at "0x10008ba5" refrenced memory at "0xddddddf1":The memory could not be "read".
-
great! this work ... but i have problem.. i accepted result and then error appear... i don't know what happen.. Debug Assertion Failed Program:debug\My.exe File:dbgheap.c Line:1011 Expression:_CrtIsValidHeapPointer(pUserData) Debug Assertion Failed Program:debug\My.exe File:dbgheap.c Line:1076 Expression:_pFirstBlock(pHead) Application Error The instruction at "0x10008ba5" refrenced memory at "0xddddddf1":The memory could not be "read".
Make sure the two files are matched as to their debug versus release builds. You will get this very commonly if you built your DLL as DEBUG and your EXE as Release and then run them against each other. The debug build's memory allocator will add extra memory checking data at head and tail of memory blocks, and the release build's memory allocator does not expect this extra data to be there. Likewise, if memory is allocated by a release build and tested by a debug build, it fails because the memory block's header data appears to be corrupted.