Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Createobject gets Error Instantiating Object
Message
From
06/12/1997 14:32:25
 
 
To
05/12/1997 06:48:54
Regine Rosewich
Aurum Ges.F.Untern.Ber.U.Integration Mbh
Freiamt, Germany
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00063428
Message ID:
00064292
Views:
55
Regine ...
Thanks for the tip. I need the CreateObject in my particular code, but I can see that the ADDOBJECT() function will be very useful with it.

Thanks ...
John

-------------------------------------------------------------------------------

>>Dan ...
>>I'm new to this Thread and when I typed in the question, I removed the quotes around the
>>oForm = createobject("yellow_card") after I went to Send the question into the Thread and
>>some error message popped up about quotes not being allowed.
>>
>>In reality I did use the correct: oForm = createobject("yellow_card")
>>just as you advised and the instantiating error still occurred.
>>
>>Thanks ...
>>John F.
>>
>>
>>-----------------------------------------------
>>
>>>>I’ve tried everything and I can’t get CREATEOBJECT to work. I keep getting Error instantiating the object.
>>>>
>>>>Facts
>>>>I opened up a Form I designed (which seems to work fine) in the Form Designer and then did File / Save as Class. Then I gave it a Class name called yellow_card and saved it in a class library called apclases.vcx. It is the only item in the library so far.
>>>>
>>>>In the Classes window of the Project Manager I can see …
>>>>
>>>> - aplclases
>>>> - yellow_card
>>>>
>>>> - wizstyle
>>>>
>>>>I can open the Class Browser and choose aplclases in the Open file dialog, and then actually see the yellow_card class listed there. It has a double arrow ( << ) to the left of its name (whatever that signifies). When I click on yellow_card, I can see its objects listed in the right window of the Class Browser.
>>>>
>>>>I’ve registered the apclases class library in the VFP 5.0 top menu: Tools / Options / Controls – Visual Class Libraries area and you can see Apclases listed there.
>>>>
>>>>The apclases.vcx is located in the same directory as all my files are (tables, forms, etc.).
>>>>
>>>>Actions
>>>>In the Command window when I do …
>>>> set classlib to apclases additive
>>>> oform = createobject(yellow_card)
>>>>I get the Error instantiating the object.
>>>>
>>>>If I don’t do the above set classlib … first and just run the createobject … line, I get this error:
>>>>
>>>> Class definition YELLOW_CARD not found
>>>>
>>>>In research here on the UT there was a message from Gary Winkler dated 8/19/97 in which Gary said he usually found the problem was in - an incorrectly spelled field name in a controlsource. So I tried creating a new Form using the Form Designer with just ONE field on it. I set the DE to a table and dragged one field from the DE to the Form to create the field. Then I saved the Form normally then did a File / Save as Class – just like I did above, into the apclases.vcx. The new class was listed in the Project Manager / Classes and also showed up in the Class Browser just like the above class did.
>>>>But when I go to do CREATEOBJECT on it, exactly the same Error instantiating the object occurs. So it may not be a controlsource problem. I’m operating on a Pentium II with 32 megs of memory so resources should be ample too.
>>>>
>>>>This has me stumped. Any help would be great.
>>>>
>>>>John Fish
>>>
>>>
>>>Your syntax does not look right. It should be.
>>>oForm = createobject("yellow_card")
>
>Hi John,
>
>although its already two days since you put your question on the UT, I'll try to give you a hint. If you use CREATEOBJECT VFP assumes that you want to do something concerning OLE or ActiveX. If you simply want to fill a empty form with Objects you designed before an saved as Classes, you have to work with the ADDOBJECT() function as described in the VFP Help.
>
>Regine.
Previous
Reply
Map
View

Click here to load this message in the networking platform