Skip to main content
gamedev.net
🔒 Locked

Pointers In Delphi

Started by hpesoj Apr 5, 2005 at 3:08 PM 5 replies 1.2k views
Original Post
hpesoj
hpesoj
Here's the situation. I have a dll I'm making in delphi, and I need to pass an address in memory to it (a backbuffer address to be precise). The external program can only pass in variables, so I need to know how to take the address stored in the variable, and assign it to the pointer. My initial thought was to simply do this... ptr := variable As you would do ptr := @variable If you were pointing to that variable, but that doesn't work. Are there any functions or other methods by which I can do this? Cheers for your help in advance.
Joseph Thomson - CLS Productions
Shannon Barber
Shannon Barber
ptr := (pointer)value;
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
hpesoj
hpesoj
Cheers Magmai, I'll try that later.

The other guy - The external program was written in darkbasic pro, it's basically a 3d engine geared towards game making, with a BASIC language wrapped around it. It's not exactly specialised for this kind of stuff like delphi is. It does have a form of pointers, but they aren't very useful. In fact, darkbasic pointers are the same as variables, but the operators can be used to make the value stored in a variable reference an address in memory. Therefore you can only pass values (as far as I know).
Joseph Thomson - CLS Productions
hpesoj
hpesoj
Magmai - I'm probably not getting what you mean entirely, I'm trying to put that syntax in, but it doesn't like it.

ptr = (pointer)value;

What is meant by "(pointer)"?
Joseph Thomson - CLS Productions
mikeman
mikeman
hpesoj, you want to pass a pointer from a program written in DarkBasic to a DLL written in Delphi, right? If that's so, I don't understand why this is a Delphi issue. The function in Delphi would be something like this:

procedure MyDLLProc(ptr:pointer);
begin

//Use ptr here anyway you want...

end;

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.