Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing view to DLL
Message
De
05/01/2014 08:52:22
 
 
À
05/01/2014 08:41:22
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01591349
Message ID:
01591360
Vues:
48
>>>>I have built an in-process DLL to handle changes to values in a view. In my main exe I create the server object, and call the appropriate method - say, MyDLL.changeview. Before I call the method I make sure my exe is on the appropriate view. However, the DLL is returning an error - that the alias can not be found. In the debugger I can see the alias is correctly selected immediately before the server object is created; but once inside the DLL it is no longer accessible. I have built the DLL on a CUSTOM class rather than a SESSION class as I assumed the latter would cause just the sort of problem I am seeing - as the SESSION class maintains it's own datasession. I thought the CUSTOM class would have the same datasession as the main exe.
>>>>
>>>>I could create a series of parameters based on each field and pass these to the DLL in turn for each row, but it seems a tedious way to achieve what I wish to do.
>>>>
>>>>Can I "pass a view" to the DLL? Or is this not possible.
>>>>
>>>>Thanks
>>>>Barry Sutton.
>>>
>>>Do you really need a DLL ?
>>
>>Gregory
>>Fair point - I had been giving it some thought and I may eventually decide not to implement the DLL. But it is good to know what can NOT be done ( as per Craig's response).
>>
>>Thanks
>>Barry Sutton.
>
>Also bear in mind that each object has its datasession. Since you instantiate your object in the main it will have datasession=1
>
>That object will not be able to access data in another datasession (form with private datasession) unless you use set datasession to ...
>
>You may have to instantiate an object per datasession

I have seen it recommended to base DLL on session class so that it has a separate data session. It seems from what you and Craig are saying that a DLL will always have a separate data session - in which case why is the session class recommended over say the Custom class?

Sorry for the rather basic questions - I have not created COM servers in VFP before.

Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform