Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #1841

Re: VO + C again

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "Karl-Heinz" <invalid@invalid.invalid>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: VO + C again
Date Wed, 17 Aug 2011 19:52:36 +0200
Lines 57
Message-ID <9b2dhoFlv7U1@mid.individual.net> (permalink)
References <4e4be6fa$0$1579$91cee783@newsreader04.highway.telekom.at>
Mime-Version 1.0
Content-Type text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding 8bit
X-Trace individual.net f2CTNULIBjp2RcoGnH/SGAMGq5pfU1xR9bl3DWryrxbiWnwpg=
Cancel-Lock sha1:Yfp/VaSl2VCLsgKGFthD0f6SQK8=
In-Reply-To <4e4be6fa$0$1579$91cee783@newsreader04.highway.telekom.at>
X-Priority 3
X-MSMail-Priority Normal
X-Newsreader Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE Produced By Microsoft MimeOLE V6.1.7600.16807
Xref x330-a1.tempe.blueboxinc.net comp.lang.clipper.visual-objects:1841

Show key headers only | View raw


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


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