Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private data session in COM
Message
 
 
To
23/07/2003 05:36:32
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00812693
Message ID:
00812729
Views:
8
>Hi,
>I have 2 COM objects. There may be in single DLL or seperate DLL. I would like to know, how to handle the private data session in COM.
>
>For example, I have classA, classB OLEPUBLIC.
>
>Both of them also accessible by any COM compliant client. If the classes created by in COM/DLL automation, both of them have to have their own private datasession.
>On other hand, if class (ex classB) is created by classA using native VFP class creation, then both of them should share the same datasession.
>
>Any ideas?
>
>for your info, I am try to convert my logical n-tier to physical n-tier model Pls advise.
>
>Thank you

John,
If you use the Class name and not the Project.Class in your CreateObject() call, you will get the native VFP object and not a COM object. However, if you use the Session class as your BaseClass then you will be in separate datasessions, by default.

To handle this, I would suggest you add a new function that accepts the DatasessionID as a parameter. When calling your object from withinVFP, you could call this function and pass it the DataSessionID of ClassA. The method could change datasessions. When called from an outside COM consumer, this method wouldn't be called and wouldn't have any effect (if erros were trapped) if it were called.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform