Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AddObject problem
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
AddObject problem
Divers
Thread ID:
00669515
Message ID:
00669515
Vues:
37
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform