Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SYS(3095,oObject) has a bug
Message
De
28/11/2005 17:47:47
 
 
À
28/11/2005 14:15:51
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Divers
Thread ID:
01072326
Message ID:
01072636
Vues:
13
>Hello Fabio,
>
>"Then "this" is not a COM object, and SYS(3095,this)
>return 0."
>
>That's the problem, i've compiled it as a COM object and also instantiated it like one (CREATEOBJECT('fullcomclass')). VFP refuses to interpret "THIS" as an COM object reference in SYS(3095).
>

Then force VFP to build the COM.

Instantiate the COM within the COM:
IF PROGRAM() != "MYCLASS"
   ?"this file MUST BE NAMED 'myclass.prg'"
   return
ENDIF

IF FILE("myclass.dll")
   DECLARE integer DllUnregisterServer IN myclass.dll
   DllUnregisterServer()
   CLEAR DLLS
ENDIF
BUILD PROJECT myserver FROM myclass
BUILD DLL myserver from myserver recomp

*now test this COM server:

ox = CreateObject("myserver.myclass")    && create the server object

? "external = ", SYS(3095,ox), "Internal ",ox.IDispatch

DEFINE CLASS myclass AS session OLEPUBLIC
	
	PROCEDURE IDispatch
		RETURN SYS(3095,CreateObject("myserver.myclass"))
ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform