>You should instanciate your COM like this:
>
>oPhone = NewObject('Auto_Phon.Auto_Phone')
>
>HTH
>I am trying to build a COM object based on a .vcx, just going through some notes from 98 DEVCON...
>>
>>Everything seems to be working fine, but I can not seem to get the vcx to reference properly...
>>
>>I have built an exe using VFP SP3 that includes a vcx and a stub program for the main.prg
>>
>>I modified the class and placed a check mark in ole public
>>
>>Here is how I am trying access the COM object after building:
>>
>>ophone=newobject('auto_phone','autophon.exe')
>>ophone.account_id='1002-00'
>>ophone.ubdir='c:\ub'
>>ophone.get_data()
>>? ophone.Total_balance
>>
>>
>>Shouldn't this work without having to do the following
>>
>>SET CLASSLIB TO AUTO_PHONE_BASE ADDITIVE
>>
>>ophone=newobject('auto_phone','autophon.exe')
>>ophone.account_id='1002-00'
>>ophone.ubdir='c:\ub'
>>ophone.get_data()
>>? ophone.Total_balance
>>
>>I am wanting to distribute the exe without sending the vcx.
>>
>>What am I missing here?
Thanks for the tip...
I have also found another bug of VFP SP3...
Jack Liebschutz informed me of this.
I took my vcx and opened it using the class browser.
I clicked the view class code button and saved it to a program called class_code.
I created a project that contained only class_code.
The project would not build 'error creating ole...'
The error reported can be fixed by:
adding a line of code to the beginning of class_code.
I added the line x=y to the beginning of class_code and the exe would then build.
Once this was done, the object could be created as I described.
The syntax you suggested is probably the 'more normal' way of creating the object.
My first COM object is now working... <s>
Thanks again for the help
Thanks,
Stacy
Black Mountain Software, Inc.