Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AddObject problem
Message
From
17/06/2002 20:09:51
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
AddObject problem
Miscellaneous
Thread ID:
00669515
Message ID:
00669515
Views:
38
Hi

I have a DLL which has the following
DEFINE CLASS Interface AS CUSTOM OLEPUBLIC

	PROCEDURE InterInit 
	PARAMETERS pForm as Form

	SET CLASSLIB TO Inter1.vcx ADDITIVE
	WITH pForm
		.AddObject('myContainer','Container')
		.myContainer.height=150
		.myContainer.width=150
		.myContainer.top=1
		.myContainer.left=1
		.myContainer.visible=.T.
	ENDWITH
	
	oForm=CREATEOBJECT('Form')
	WITH oForm
		.AddObject('myContainer','interopt')  &&Add Container to form
	ENDWITH
		
	RETURN pForm.myContainer
	ENDPROC
ENDDEFINE
This all works but when I change
	oForm=CREATEOBJECT('Form')
	WITH oForm
		.AddObject('myContainer','interopt')  &&Add Container to form
	ENDWITH
to
	WITH pForm
		.AddObject('myContainer','interopt')  &&Add Container to form
	ENDWITH
I get an OLE Dispatch error telling me my interopt does not exist.

The code works fine when it is not in a DLL.

Why is this???

What I am attempting to do is to add a visually defined container object that is stored in my class Inter1 class. I could do this all programatically but would rather do it visually and am also trying to figure out the general principle of adding objects stored in a class library using a DLL.

Thanks
Geoff Scott
May all your weeds be wildflowers
Next
Reply
Map
View

Click here to load this message in the networking platform