Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COM question
Message
From
21/12/2004 11:44:32
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
COM question
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows NT
Network:
Novell 6.x
Database:
MS SQL Server
Miscellaneous
Thread ID:
00971034
Message ID:
00971034
Views:
75
hi,
Ive got a quick question...
Ive got a class roughy written as .


define Class myclass as de Olepublic
prop1=''
prop2=''

procedure MakeCAClass(lcCAfilename As string) as Integer
* 'String-ify' file
lcFileasStr=filetostr(lcCAfilename)

* Get the cursor name .. we'll use it as the property too.
lcname=strextract()

Public &lcname
this.addproperty(&lcname)
public &lcname
this.&lcname=CreateObject('Cursorclass', lcCAfilename) & Add CursorAdapter
return 1
Endproc

enddef



Define CursorClass as cursoradapter
Proc Init (lcCAfilename as String)
*Make Cursor adapter from definitions in File.
........
endproc
enddef




Im my main.prg Ive got ...

* after compile the above as a dll. the following 2 lines work
lxDataenv=createObject('mycom.myclass')
?lxDataenv.MakeCAClass('Mytable_definitions_file')

*--- This line does not work when calling the DLL ( Work when Class Code is
*--- called from procedure file though) This leads me to believe that i'm missing *--- something with regards to COM behavior.
?lxdataenv.mytable.selectcmd

the above line returns (unknown member mytable) as an error.

In fact lxdataenv.mytable is not exposed or doesnt exist at all.
I know that the cursor adapter table was created and opened. I checked this by using other methods on the myclass level. My code ran successfully ( I get no errors but... I cant seem to expose mytable after I create it using the addproperty method.

Is there something that Im missing? maybe a declaration that will expose mytable while using the class as a dll ?
Any help is appreciated..

Thanks
Brian Bolton
Next
Reply
Map
View

Click here to load this message in the networking platform