Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The first call works fine but the second causes perl to crash. Looking at the debug information from ODMA there'sApiLink ('odma32.dll', 'INT ODMRegisterApp(LPVOID FAR *pOdmHandle, DWO +RD version, LPSTR lpszAppld, DWORD dwEnvData, LPVoid pReserved)') || +die "blick"; $version = 100; $Appld = "PerlODMA"; $odmregisterrc = 0; $odmselectrc = 0; $flags = 0; $odmhandle = AllocMemory( 255 ); $docid = AllocMemory( 255 ); $odmregisterrc = ODMRegisterApp($odmhandle,$version,$Appld,$hwnd,undef +); ApiLink ('odma32.dll', 'INT ODMSelectDoc(LPVOID OdmHandle, LPSTR lpszD +ocid, LPDWORD pdwFlags)') || die "blick2"; $odmselectrc = ODMSelectDoc($odmhandle,$docid,$flags);
which makes me think that the handle isn't being passed correctly, this should be the same between calls. The definitions for the functions areODMRegisterApp Input parameters: version=100(64) lpszAppId=PerlODMA; dwEnvData=2754366(2a073e) Output parameters: odmHandle=33949616(20607b0) Return value=0(0) ODMSelectDoc Input parameters: odmHandle=30705996(1d4894c)
with ODMStatus being an int & ODMHandle being an LPVoid (based on typedefs in the sample C code for the odma library) The ODMA test system I'm using (and documentation) is at here#ODMStatus ODMRegisterApp(ODMHANDLE FAR *pOdmHandle WOrd version LPSTR + lpszAppld, DWORD dwEnvData, LPVoid pReserved) #ODMStatus ODMSelectDoc(ODMHANDLE odmhandle,LPSTR lpszDocid, LPDWORD p +dwFlags)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32 API Problem
by Anonymous Monk on Jan 04, 2004 at 23:05 UTC | |
|
Re: Win32 API Problem
by Roger (Parson) on Jan 04, 2004 at 23:58 UTC | |
by Anonymous Monk on Jan 05, 2004 at 00:34 UTC |