Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can i use api to find a variable Pointer

Status
Not open for further replies.

ashthud

Programmer
Oct 6, 2008
53
GB
In foxpro 2.6 i can pass variables by reference using @; so i know pointer information is somewhere flying about...
Is there an api function or maybe just a standard foxpro THING that i can do to find the pointer (in memory) of my variable?

Maybe its a case of passing my variable to a dll that then returns the pointer(????). Thanks.
 
You can return string to fox very simple

But you need compile your DLL like FLL library. Then you can use all Foxpro API functions.
FLL is practically DLL with some addendum.

How to compile FLL ?

If you can not compile FLL, you can still allocate some memory on the heap (by WinAPI) in the fox, get the pointer and send it to the DLL.


Tomas
 
OMG tomas, you solved my problem, but indirectly!!!

allocate some memory on the heap

At first i changed my function (that allows calls to 32bit apps) to allow byref parameters. But didn't give the variable enough space to write to:

I had:
var = ""
=dllcall("GetWindowText","vhwnd,var,256")
?var

Is now:
var = REPL(" ", 256)
=dllcall("GetWindowText","vhwnd,var,256")
?var

Ashthud
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top