Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Releasing a COM object in a COM object
Message
From
13/09/2001 17:57:10
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Releasing a COM object in a COM object
Miscellaneous
Thread ID:
00556220
Message ID:
00556220
Views:
47
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.
Next
Reply
Map
View

Click here to load this message in the networking platform