Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AddObject problem
Message
De
18/06/2002 08:25:36
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00669545
Message ID:
00669655
Vues:
20
Hi Geoff,
this is a little bit on my english limits, so I try to understand:
I do three interpretations

1.
Do you mean you have an exe and like to excerpt a class out off the dll to use it inside an form out of the exe?

try
.NewObject('myContainer','interopt',"gen.vcx",'d1.dll')

Try to add a path to 'd1.dll' as well.

Have a close look the help to NEWOBJECT. There are tricky things in the way wich vcx is used.

If you succeed to extract out of an dll, please send a message, I would like to do a similar thing.

2.
Or other try to translate:

means:
"..but leaves my class definition outside my DLL"

that "gen.vcx" is not automated included to the project?

automatic adding a classlib to a project works only for
set classlib to 
and if the classlib holds a parentclass
set classlib to my_first.vcx
will add my_first.vcx
lcClass = my_first.vcx
set classlib to &lcClass
will not, because the compiler can not look into a lcClass.

NEWOBJECT(,,cModule) is not resolved to "Add cModule to the project" by the compiler.

3.
Or this is all in the same dll?
>.NewObject('myContainer','interopt','gen')
works.
So why is "gen" outside the dll? It should be inside if the vcx is compiled into the dll.
(the vcx is listet into projectmanager and not excluded)

How do you determeine that the call above calls outside the dll?

Refer NEWOBJECT's Help for a list of how NEWOBJECT searches for a class.

If it will not work, my last guess is to rename "gen.vcx" , sometimes the fox is sensitiv to some strings.(I spend days on a view called "selection" - it works after rename)
"gen" may be of internal use.

HTH
Agnes
>Okay, almost there.
>
>The final step, encpulation.
>
>
>WITH pForm
>	.NewObject('myContainer','interopt','gen')
>	.myContainer.visible=.T.
>	.myContainer.top=15
>	.myContainer.left=15
>ENDWITH
>
>
>works great but leaves my class definition outside my DLL
>
>I have the class library gen in my project d1
>
>I tried
>
>
>
>	.NewObject('myContainer','interopt','d1.dll')
>
>
>but alas it errors
>
>How do I reference an object within a class library within my dll or is it that I have not properly included the class definition within my DLL???
>
>Regards
>Geoff Scott
>
>
>>Hi Geoff,
>>
>>I have never done this with a DLL, but have you tested NewObject() method? There is a third parameter for source.
>>
>>Agnes
>>>Hi
>>>
>>>How do I reference an object within a class library in a DLL.
>>>
>>>I can do
>>>
>>>
>>>WITH pForm
>>>	.AddObject('myContainer','Container')  &&Add Container to form
>>>	.myContainer.visible=.T.
>>>ENDWITH
>>>
>>>
>>> where I pass pForm to my DLL, but I cannot do
>>>
>>>
>>>SET CLASSLIB TO 's:\pc source\gen.vcx' ADDITIVE
>>>WITH pForm
>>>	.AddObject('myContainer','interopt')  &&Add Container to form
>>>	.myContainer.visible=.T.
>>>ENDWITH
>>>
>>>
>>>where interopt is a container object defined in gen.vcx.
>>>
>>>It works fine when not in a DLL but gives me an OLE IDispatch Error 733 telling me Class definition INTEROPT is not defined when I try to use it in a DLL.
>>>
>>>Can anyone tell me what I am doing wrong?
>>>
>>>regards
>>>Geoff Scott
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]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform