A
anirudhlohia
Hi All,
Environment: BCB6 on XP
If the code example below is compile with "Use Dynamic RTL", "Build
with Runtime Packages" project option *checked* then everything works
fine
However, if either or both the options are *unchecked* in the
application then application crashes at "delete[] encoded Message".
Application Code:
-----------------------------------------------------------------
unsigned char* encodedMessage = 0x0;
..................
..................
encode_message(messageNumber, rLen, encodedMessage)
..................
..................
delete[] encodedMessage;
-----------------------------------------------------------------
DLL Exported Method signature:
-----------------------------------------------------------------
int __EXPORT_TYPE encode_message(unsigned int messageNumber,
unsigned int& rLen,
unsigned char*& pMessage);
-----------------------------------------------------------------
The DLL allocates the memory using new. The Calling application is
supposed to release the memory.
Any idea why it may be happening so?
Thanks
Anirudh
Environment: BCB6 on XP
If the code example below is compile with "Use Dynamic RTL", "Build
with Runtime Packages" project option *checked* then everything works
fine
However, if either or both the options are *unchecked* in the
application then application crashes at "delete[] encoded Message".
Application Code:
-----------------------------------------------------------------
unsigned char* encodedMessage = 0x0;
..................
..................
encode_message(messageNumber, rLen, encodedMessage)
..................
..................
delete[] encodedMessage;
-----------------------------------------------------------------
DLL Exported Method signature:
-----------------------------------------------------------------
int __EXPORT_TYPE encode_message(unsigned int messageNumber,
unsigned int& rLen,
unsigned char*& pMessage);
-----------------------------------------------------------------
The DLL allocates the memory using new. The Calling application is
supposed to release the memory.
Any idea why it may be happening so?
Thanks
Anirudh