Re: Translating c headers to Delphi

From: Pawel (thejaffe21_at_hotmail.com)
Date: 01/20/04


Date: Tue, 20 Jan 2004 11:42:42 -0500

I tried to avoid pointers but i got a runtime error when i tried making a
call
this seemed to work

function getReference(Channel:integer; Polar: Pointer): longInt; stdcall;
external 'sws15100.dll';

i was able to get the propper number from the returned longInt but now im
having a problem with

getILTrace(unsigned short chID, double *plamData, double *ppowData, unsigned
short dataZise, short *pola);

where plambData and ppowData are suposed to be pointers to arrays of double.

This is the call right now.. im not sure if im using the dll wrong or if im
making the call wrong

*********************************************************

wave : array[1..17000] of Double;
  pow : array[1..17000] of Double;

tempInt := getILTrace(3,@wave,@pow,tempInt,@pasvar);
*********************************************************
it seems to make the call though i get an error message back via tempInt

im just really not sure if im using the @ right here..

pawel

"Avatar Zondertau" <avatarzondertau@hotmail.com> wrote in message
news:400d5601$1@newsgroups.borland.com...
> > Right now my main problem is with this header:
> >
> > Int getReference(unsigned short chID, short *pola);
> >
> > I'm not quite sure how to use pointers in Delphi. Thus, I am not sure
how
> to
> > translate that header. I have been able to use method pointers but never
> > anything to variables.
>
> Delphi helps you avoiding using pointers:
>
> function getReference(chID: Word; var pola: SmallInt): Integer;
>
> Don't forget using the appropriate calling convention (either stddcall or
> cdecl)
>
>



Relevant Pages

  • Re: Access violation error
    ... //if i uncomment below line,then it throwing access violation error during ... i have only runtime error. ... I suppose that the method E3Des is defined somewhere, but you know, without TELLING US ... space to initialize those pointers. ...
    (microsoft.public.vc.mfc)
  • Re: Mixing ATL smart pointers with regular calls
    ... Certain pointers are then passes to other ... I believe that it is the cause of a runtime error. ... There is no problem mixing smart pointers with regular calls. ...
    (microsoft.public.win32.programmer.directx.video)
  • problem with pointers, runtime error
    ... I use ifc 6.0 under Linux SusE 8.1, and try to do some pointers manipulations. ... end type liste ... compiles with no errors and runs without any runtime error too. ...
    (comp.lang.fortran)
  • Re: freeing structure
    ... > Will it give me a runtime error? ... null pointers don't have to be *dull* pointers! ... Prev by Date: ...
    (comp.lang.c)
  • Re: Are Delphis objects always pointers to objects? (comparing Delphi objects and C++ objects)
    ... > In Delphi it seems like objects are all pointers to objects. ... Part of the reason almost all OO languages now use references to objects is ... assignment operator. ...
    (comp.lang.pascal.delphi.misc)