:
This message was edited by stober at 2006-3-23 21:5:45
: : Hello
: :
: : I've developed a DLL in delphi, and one of the functions requires a Pointer...
: :
: : Supossing the Function is AAA()
: :
: : y tryed doing the next:
: :
: : int a;
: : int *a2;
: :
: : a2 = &a;
: :
: : AAA(a2);
: :
: :
: : but it doesn't work, how can i do it??????
: :
: :
: : I hope you can help me
: :
: :
: : >juan<
: :
:
:
:
: how to do in C/C++ it depends on how the function is prototyped.
:
: // function prototype
: void AAA(int* ptr);
:
: int a;
: // now pass a pointer to function AAA
: // its not necessary to use another variable
: AAA(&a);
:
:
: beyond that, I have no clue how to call delphi functions from c, or even if they can be called from c.
:
: When you say "it doesn't work" just what exactly do you mean? is it a compile-time or runtime error? what was the error or behavior?
:
: Maybe (just guessing here) delphi uses the __pascal calling convention? then you need to prototype the function like this
:
: void __pascal AAA(int* ptr);
:
I think __pascal is something VC++ specific. The PASCAL calling convention from the win api should be used.
void PASCAL AAA(int* ptr);
But PASCAL is probably defined as __stdcall, iirc...