Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pcomm32W.dll and memory leak

I make an application using PCOMM32W.DLL to communicate with a GEOBRICK.

I'm using wxWidget library, I can load the PCOMM32W.DLL ( at this point PcommServer.exe is starting ).

Communication with GEOBRICK seems OK but each time I'm doing a GetResponse ( or GetResponseA, or GetResponseEx or GetResponseAEx ) the memory used by my aplication is increased by 4Ko !

Here the prototyping of the dll function I use:

typedef long (_stdcall * GETRESPONSEEXA)(DWORD dwDevice,char* resp,UINT maxchar,const char* quest);

And here my function to read the GEOBRICK:
int IPmacDevice::GetResponseExA(long dwDevice, wxString* resp, wxString quest)
int ret;
char ch_responsebuffer[MAX_RESPONSELEN];

ret = pfnPmacGetResponseExA(dwDevice, ch_responsebuffer , MAX_RESPONSELEN, quest.mb_str());

*resp = wxString::From8BitData(ch_responsebuffer);

return ret;

If someone have a clue to avoid this memory lead, help will be appreciate !!

Link to the COM interface directly is better way.
Link to the COM interface directly is better way.

Forum Jump:

Users browsing this thread: 1 Guest(s)