Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Catastrophic failure calling client
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01142442
Message ID:
01142554
Vues:
7
--It's better to pass a true COM object over DCOM boundaries
Anywhere I can see a code sample of that, please?

Thanks

>The problem most likely is THIS which is not a COM object reference. You see in order for a COM object to marshal it needs to have a custom marshaler in place and this marshaler works with COM objects and type libraries. THIS is not a COM object and VFP just creates this object on the fly then passes it. This works in some cases but more often than not you'll run into problems with this.
>
>It's better to pass a true COM object over DCOM boundaries to ensure the type information is known to both the client and server...
>
>+++ Rick ---
>
>>Here is my code (simplified):
>>*!* Create remote server
>>loServer = CREATEOBJECTEX(clsid, remoteserver)
>>*!* Send client reference to to remote server:
>>loServer.mGetCallingObj(This)
>>
>>*!* mGetCallingObj of remote server:
>>LPARAMETERS toCallingObj
>>This.poCallingObj = toCallingObj
>>
>>*!* Callback
>>This.poCallingObj.mExecuteClientCommand()
>>What do you think?
>>
>>>>Rick,
>>>>What do you mean by "explicit reference to the client"?
>>>
>>>How are you calling back to the client? If you are simply passing a reference of an object and that object is released on the client the reference may disappear. You need to make sure this instance is created as a COM object if it is to act as a proxy DCOM object.
>>>
>>>+++ Rick ---
>>>
>>>>>Catastrophic Failure usually means the server proxy has disconnected or otherwise lost in some way. It's essentially the generic remote error that COM uses.
>>>>>
>>>>>Callbacks may not work the same way as on a local machine - you need to make sure the server has an explicit reference to the client. Two way communication over DCOM is very tricky to get right.
>>>>>
>>>>>+++ Rick ---
>>>>>
>>>>>>I am getting the following:
>>>>>>OLE error code 0x8000ffff: Catastrophic failure.
>>>>>>when a remote server does callback to the client.
>>>>>>Here is the callback method:
>>>>>>
>>>>>>
>>>>>>LPARAMETERS toMachine
>>>>>>LOCAL lcSql
>>>>>>
>>>>>>TEXT TO lcSql TEXTMERGE NOSHOW
>>>>>>	usp_UpdateReadings '<<toMachine.ReadFromScanner.pcLastReading>>',
>>>>>>	<<toMachine.pnMachineRegistrationId>>, <<toMachine.pnUserId>>
>>>>>>ENDTEXT	
>>>>>>IF This.mExecuteSqlCommand(lcSql, '', '') >= 1
>>>>>>	*!* Update client monitors with new read
>>>>>>	This.poCallingObj.mExecuteCommand(toMachine)
>>>>>>ELSE
>>>>>>	*!* If SQL has returned an error, dont call Client
>>>>>>ENDIF	
>>>>>>
>>>>>>Where This.poCallingObj has a referance to the client.
>>>>>>Any idea, please?
>>>>>>
>>>>>>Thanks
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform