Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #1841
| From | "Karl-Heinz" <invalid@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: VO + C again |
| Date | 2011-08-17 19:52 +0200 |
| Message-ID | <9b2dhoFlv7U1@mid.individual.net> (permalink) |
| References | <4e4be6fa$0$1579$91cee783@newsreader04.highway.telekom.at> |
Bernhard,
> and the dynamic way
>
> LOCAL pFunc AS PTR
> LOCAL pReturn AS PTR
>
> IF SELF:pFiscal != NULL_PTR // pFiscal = Valid handle of dll loaded with
> LoadLibrary
> pFunc := GetProcAddress(SELF:pFiscal, String2Psz("POS_CreateRequestEx"))
> IF pFunc != NULL_PTR
> pReturn := PCALL(pFunc, hLocalDevice, String2Psz(cCmd),
> String2Psz(cParameters))
> // Tried that one, too:
> // pReturn := CCALL(pFunc, hLocalDevice, String2Psz(cCmd),
> String2Psz(cParameters))
> ENDIF
> ENDIF
>
> RETURN pReturn
( sometimes ) i´m having problems too using PSZs in dynamics calls. In such
cases the only way to make it work is to use PTRs instead of PSZs
try this one first :
--------------- 1 ----------
LOCAL pszCmd, pszParams AS PSZ
pszCmd := stringalloc ( cCmd )
pszParams := stringalloc ( cParameters )
pReturn := PCALL(pFunc, hLocalDevice, pszCmd , pszParams )
memfree ( pszCmd )
memfree ( pszParams )
if it doens´t help , try:
--------------- 2 ----------
LOCAL ptrCmd, ptrParams AS PTR
// simulate a PSZ
ptrCmd := MemAlloc ( SLen ( cCmd) + 1 )
MemCopyString ( ptrCmd , cCmd, SLen ( cCmd) )
// simulate a PSZ
ptrParams := MemAlloc ( SLen ( cParameters) + 1 )
MemCopyString ( ptrParams , cParameters, SLen ( cParameters) )
pReturn := PCALL(pFunc, hLocalDevice, ptrCmd, ptrParams )
memfree ( ptrCmd )
memfree ( ptrParams )
regards
Karl-Heinz
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
VO + C again "Bernhard Mayer" <Idonotexisthere@nowhere.com> - 2011-08-17 18:06 +0200
Re: VO + C again "Karl-Heinz" <invalid@invalid.invalid> - 2011-08-17 19:52 +0200
Re: VO + C again "Bernhard Mayer" <Idonotexisthere@nowhere.com> - 2011-08-18 08:11 +0200
Re: VO + C again "Karl-Heinz" <invalid@invalid.invalid> - 2011-08-18 10:42 +0200
Re: VO + C again "Uwe Heyer" <uwe.heyer@aristik.de> - 2011-08-19 20:11 +0000
csiph-web