Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM question
Message
De
21/12/2004 11:49:05
 
 
À
21/12/2004 11:44:32
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows NT
Network:
Novell 6.x
Database:
MS SQL Server
Divers
Thread ID:
00971034
Message ID:
00971035
Vues:
16
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(<CURSORNAME></CURSORNAME>)

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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform