Information générale
Catégorie:
Codage, syntaxe et commandes
Hi Pablo,
I did the following as you advised.
·Created a new project (VBAtoVFP) in Visual Foxpro.
·Add a new class ( Lib – VFPClasses Class – VFPClass)
·Add a public property (GcSOKey - character type )
·Add a public method ( ChangeCommValues). Method is still empty . I haven’t added any code .
·In class menu, class info , I checked OLE Public check box.
·Saved the class and compiled it with ‘Single threaded com server – dll ‘
·It created a DLL, VBAtoVFP.dll ( not the class name but the project name)
*-------------------------------------------------------------------------------
In my VBA project I did the following.
·In VBA reference section I selected ‘VBAtoVFP Type Libruary ‘ . It was already there. I just checked it.
·In my VBA coding I typed this.
Dim VFPObj As New vfpclass
Public Sub EDIT()
Dim lcSOkey As String
' First get the SOKey value from VBA
lcSOkey = ‘12345’
‘ Assign the SOKey value to property in VFP project
VFPObj.GCSOKEY = lcSOkey
‘ Do a test in VBA
MsgBox VFPObj.GCSOKEY ‘ This displays 12345. So far so good . Now I need to pass this value to my method.
VFPObj.changecommvalues
*--------------------------------------------------------------
ALLRight !!!! now comes my questions…
1.How do I refer this value in my VFP method . ? ( All what I need to to know at this point is whether SoKey value is correctly passed to my method.)
2.Do I need to use a parameter in my method ?
In my method (ChangeCommValues) I tried something like this
Wait Window "Your VFP So Key Value Is :" + This.gcSOKey && didn’t work.
PLEASE HELP !!!!!
TIA
- Jeana -
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement