Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Passing Pointers To Delphi

Author
Message
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 6th Apr 2005 22:51
I'm trying to pass a pointer value to Delphi, but it seems that DBPro can only pass variable types. I need to do something like this...

function PtrTest(temp: integer): integer; cdecl;
var
ptr: PInt;
begin
ptr := temp;
end;

But it won't let me due to incompatable types. Is there any way of passing an address straight into a pointer like so...

function PtrTest(ptr: PInt): integer; cdecl;
begin
end;

Or any way of assigning a variable's value to the pointer address, like the above example.

Cheers.

Isn't it? Wasn't it? Marvellous!
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 6th Apr 2005 23:00
Feck it, I just found out you can pass pointers as if there are integers.

Isn't it? Wasn't it? Marvellous!
Cryptoman
20
Years of Service
User Offline
Joined: 24th Nov 2003
Location: Utah Mountains
Posted: 9th Apr 2005 23:04
Yep, pointers are just dwords. Or Uint. Don't use Integer as some compilers will mess ur stuff up. Not that the cpu cares though.


Login to post a reply

Server time is: 2024-11-21 14:57:23
Your offset time is: 2024-11-21 14:57:23