Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GlobalLock()
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00101339
Message ID:
00101891
Views:
28
>Well, it gets better. Not only do the several DLL functions require a pointer to the address space, they also want the size. I also believe several K of memory needs to be allocated because many of the functions cache info in this buffer as you call certain functions. This info can build up (to what extent, I don't know, I'm still trying to get past the initialization!).
>
>I was thinking that maybe I could use the LCK and create an FLL as a makeshift "wrapper". I should be able to call a function in an FLL to allocate the memory, and have it return the pointer to the memory and the size of memory allocated. I should then be able to use these numbers in my app to call the functions in the custom DLL. I could use that same DLL to deallocate the memory (if for some reason it can't be deallocated from my app with globalunlock() and globalfree()). How does that sound? If VFP had a pointer type, I wouldn't have to go through any of this trouble (GlobalLock() requires a pointer type arg).
>
>I do think I will try the above method to see if it may save me some trouble!
>
>thanks a bunch
>
>Steve.

Steve,

Several months ago (Nov. last year I think), FoxPro Advisor ran an article by Gary DeWitt on the subject of creating pointers in VFP. He used HeapAlloc() to get a pointer, and lstrcpy() to copy information to and from the memory space. Naturally, there's more to it than that, but I've played a bit with it and it seems to work just fine.

hth,
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform