for example:
//Qt dll - H
class DLL_EXPORT ScriptEngine
{
public:
~DLL() {}
DLL() {}
bool SomeFunction(LPCTSTR);
};
//Qt dll - H
class DLL_EXPORT ScriptEngine
{
public:
~DLL() {}
DLL() {}
bool SomeFunction(LPCTSTR);
};
To copy to clipboard, switch view to plain text mode
//Qt dll - CPP
DLL::SomeFunction(LPCTSTR cStr);
{
//If this cause any Qt function or initialize Qt class
//in the Win32 application, I get a memory leak!
}
//Qt dll - CPP
DLL::SomeFunction(LPCTSTR cStr);
{
//If this cause any Qt function or initialize Qt class
//in the Win32 application, I get a memory leak!
}
To copy to clipboard, switch view to plain text mode
Win 32 MFC project:
(All are linked without any problem)
...
#include "dll.h"
#pragma comment(lib,"../debug/dll.lib")
....
DLL *a;
a = new DLL;
a->SomeFunction(...);
if (a != NULL)
delete a;
...
#include "dll.h"
#pragma comment(lib,"../debug/dll.lib")
....
DLL *a;
a = new DLL;
a->SomeFunction(...);
if (a != NULL)
delete a;
To copy to clipboard, switch view to plain text mode
After closing the application window output MSVS see:
for example:
Detected memory leaks!
Dumping objects ->
{186} normal block at 0x007B8750, 24 bytes long.
Data: < > 00 CD CD CD 00 00 00 00 00 00 00 00 00 00 00 00
{185} normal block at 0x007B86A8, 104 bytes long.
Data: < #g` { U2g> F4 B1 23 67 60 86 7B 00 00 00 00 00 E8 55 32 67
{184} normal block at 0x007B8660, 8 bytes long.
Data: < #g { > 00 B2 23 67 A8 86 7B 00
{183} normal block at 0x007B8608, 24 bytes long.
Data: < > 00 CD CD CD 00 00 00 00 00 00 00 00 00 00 00 00
{182} normal block at 0x007B85B0, 24 bytes long.
Data: < > 00 CD CD CD 00 00 00 00 00 00 00 00 00 00 00 00
{181} normal block at 0x007B8538, 56 bytes long.
Data: < ` { > 01 00 00 00 60 86 7B 00 00 CD CD CD 00 00 00 00
Object dump complete.
The program '[4884] Test.exe: Native' has exited with code 0 (0x0).
Detected memory leaks!
Dumping objects ->
{186} normal block at 0x007B8750, 24 bytes long.
Data: < > 00 CD CD CD 00 00 00 00 00 00 00 00 00 00 00 00
{185} normal block at 0x007B86A8, 104 bytes long.
Data: < #g` { U2g> F4 B1 23 67 60 86 7B 00 00 00 00 00 E8 55 32 67
{184} normal block at 0x007B8660, 8 bytes long.
Data: < #g { > 00 B2 23 67 A8 86 7B 00
{183} normal block at 0x007B8608, 24 bytes long.
Data: < > 00 CD CD CD 00 00 00 00 00 00 00 00 00 00 00 00
{182} normal block at 0x007B85B0, 24 bytes long.
Data: < > 00 CD CD CD 00 00 00 00 00 00 00 00 00 00 00 00
{181} normal block at 0x007B8538, 56 bytes long.
Data: < ` { > 01 00 00 00 60 86 7B 00 00 CD CD CD 00 00 00 00
Object dump complete.
The program '[4884] Test.exe: Native' has exited with code 0 (0x0).
To copy to clipboard, switch view to plain text mode
Bookmarks