General information
Category:
COM/DCOM and OLE Automation
I sent this out before I had finished ... sorry! At the end of this, I repeat the sample code from the original (See SAMPLE below)
I would REALLY appreciate some direction on this!
To run the samples, do the following:
SCENARIO 1 - the arrays work properly
a. Save the code as a prg in a project called, eg, "vfpapptier"
b. Build the project as an APP, and run it. Go to Debug, and note that the two array properties are actual arrays, and are correctly populated.
SCENARIO 2 - the arrays do not work
a. Modify the PRG by uncommenting this line:
*: o = createobject('vfpapptier.vfpdataobjectvisual')
*: DEFINE CLASS vfpdataobjectvisual AS custom OLEPUBLIC
and commenting these lines:
o = createobject('vfpdataobjectvisual')
DEFINE CLASS vfpdataobjectvisual AS custom
b. Build the project again, but this time build it as a DLL.
c. From the command window, execute the following:
o = createobject('vfpapptier.vfpdataobjectvisual')
mm = o.GetTheCursor()
d. Go to debug, and note that both arrays are no longer arrays.
Here is the sample code to create the PRG:
************************* SAMPLE PRG ************************
public o, mm
o = createobject('vfpapptier.vfpdataobjectvisual')
*o = createobject('vfpdataobjectvisual')
mm = o.GetTheCursor()
*DEFINE CLASS vfpdataobjectvisual AS custom
DEFINE CLASS vfpdataobjectvisual AS custom OLEPUBLIC
Name = "vfpdataobjectvisual"
DIMENSION ArrayCursor[1]
DIMENSION ArrayAnother[3,1]
PROCEDURE getthecursor
create cursor cTest (FieldOne c(10))
insert into cTest (fieldone) values ('One')
insert into cTest (fieldone) values ('Two')
insert into cTest (fieldone) values ('Three')
dimension this.ArrayCursor(reccount(),1)
copy to array this.ArrayCursor
use in cTest
store 'John' to this.ArrayAnother
return this
ENDPROC
ENDDEFINE
************************* END SAMPLE PRG ************************
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only