Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AddObject problem
Message
From
19/06/2002 01:03:04
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
18/06/2002 19:14:41
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00669545
Message ID:
00670005
Views:
13
Hi Geoff,
I still have my problems in understanding.
I assume you run an exe and try to extract a class from an dll

I would use NewObject function as
NEWOBJECT(cClass[,cModule[,cInApp[,Para]]]) where cInApp is the Application (exe) with complete path, cModule the vcx or prg within cModule and cClass is the Name of the class within cModule
NewObject method is similar.

AFAIK the extraction of classes out of an dll will fail, but I have never tested.

In
>
>DEFINE CLASS Interface AS CUSTOM OLEPUBLIC
>
>PROCEDURE InterInit
>PARAMETERS pForm as Form
>	SET CLASSLIB TO Attaché.vcx
>	WITH pForm
>		.NewObject('InterOpts','interopt',"Attaché.vcx",'d1.dll')
>		.myContainer.visible=.T.
>	ENDWITH
>	RETURN 'InterOpts'
>ENDPROC
>ENDDEFINE
>
the Line
> SET CLASSLIB TO Attaché.vcx
is of no help, because it sets classlib to an vcx that is compiled to the exe or in path. SET CLASSLIB looks easy but check help to see the tricky things on what comes in which order

We know exactly that we will create pform.InterOpts as an instance of class interopt from classlib Attaché.vcx out of application d1.dll, so avoid set classlib

BTW avaoid character é in the name, it is allways better to use old fashioned DOS naming conventions, at least no spaces and no exotic characters as é or ü. It only will cause trouble.

Anyway, give "d1.dll" complete path.

On the other hand, as I understand your message, you have a dll that uses class interopt for one or other reason.

You create a instance of the same class in your exe. This is not the same object as in your dll, it is part of the form.

So why not include the Attaché.vcx to both the dll and the exe project and instanciate it inside the form (of the exe) with simple.
.NewObject('InterOpts','interopt',"Attaché.vcx")
?

The exe will be a little bit bigger and you need to ship both if you change the Attaché.vcx, but it will work.


HTH

Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform