Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Releasing a COM object in a COM object
Message
De
13/09/2001 17:57:10
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Releasing a COM object in a COM object
Divers
Thread ID:
00556220
Message ID:
00556220
Vues:
48
Hi,

Here's my problem: Inside a COM object, I created a reference to another COM object. Here's the code:
<CODE>
DEFINE CLASS ncbi_webget AS CUSTOM OLEPUBLIC
	*-- Class variables
	oWeb = .NULL.
	lTransfer = .F.

	PROCEDURE Init
		THIS.oWeb = CREATEOBJECT("InternetObject.HTTPConnection")
		IF VARTYPE(THIS.oWeb) <> "O" THEN
			THIS.lTransfer = .F.
		ELSE
			THIS.lTransfer = .T.
		ENDIF
	ENDPROC
	
	PROCEDURE Destroy
		RELEASE THIS.oWeb
	ENDPROC
ENDDEFINE
</Code>
Pretty simple right? Except that I can't compile! I keep getting an error, namely:

RELEASE THIS.oWeb
Error in line 20: Must be a variable or array.

I tried changing the line by adding parenthesis to 'RELEASE (THIS.oWeb)' and it compiled fine but then I got a different error when I tried to release the second COM object at runtime (the instance of 'ncbi_webget').

I also tried this:
THIS.oWeb = .NULL.

But it still doesn't work!

How can I free the memory of my first COM object by releasing it from inside my second COM object?

Thanks a million, Stephane.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform