didierdesie Posted March 31, 2011 Share Posted March 31, 2011 Hi, 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]; wxDYNLIB_FUNCTION(GETRESPONSEA,PmacGetResponseExA,*dynlib); 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 comment Share on other sites More sharing options...
zhaoyue21 Posted June 24, 2011 Share Posted June 24, 2011 Link to the COM interface directly is better way. Link to comment Share on other sites More sharing options...
zhaoyue21 Posted June 24, 2011 Share Posted June 24, 2011 Link to the COM interface directly is better way. Link to comment Share on other sites More sharing options...
Recommended Posts