Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP MTDLL COM object -- persistence questions
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01061515
Message ID:
01062006
Views:
32
I've been reading a bit more about memory mgt in Windows.

I still don't see how a MTDLL COM object, running in its own thread, can allocate process-wide global memory, such as with GlobalAlloc(), and _also_ put the handle to that global section someplace where the other threads can get to it. With a VFP MTDLL, the DLL has no access to or awareness of the data structures in the global storage of the containing process. I cannot find a function that supports the concept of a "named" memory section, which would let you test for the section's existence and:
- if it existed, return the handle
- if it didn't exist, create it and return the handle

So I'm still stymied.

>Hi Mark,
>
>> What is the preferred way to set a global state indicator among all running threads that represent an instance of the same MTDLL COM object?
>
>I'm not sure what the preferred way is, but I use shared memory. It's relatively easy to set up and SYS(2600) provides convenient access. You could also use TLS if you have a way to share the TLS index across all threads.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform