Jump to content
OMRON Forums

Pcomm32W.dll and memory leak


didierdesie

Recommended Posts

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

  • 2 months later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Guest
This topic is now closed to further replies.

×
×
  • Create New...