General information
Category:
COM/DCOM and OLE Automation
Title:
VFPCOM.DLL can not use in VFP com server
proj1.dll:
DEFINE CLASS Class1 AS Custom OLEPUBLIC
#DEFINE C_VFPCOMCLASS 'vfpcom.comutil'
FUNCTION ReturntRS()
oVFPCOM = CreateObject(C_VFPCOMCLASS)
SELECT * FROM c:\table1 INTO CURSOR foo
oRecordSet=CreateObject('ADODB.RECORDSET')
nError = oVFPCOM.CURSORTORS(oRecordSet)
RETURN oRecordSet
ENDFUNC
*--call
#DEFINE C_VFPCOMCLASS 'vfpcom.comutil'
oVFPCOM = CreateObject(C_VFPCOMCLASS)
o=CREATEOBJECT('proj1.Class1')
oRecordSet=o.ReturntRS ()
nError = oVFPCOM.RSToCursor(oRecordSet, 'mycursor')
question:
if I used "proj1.Class1" as VFP COM Server(dll), so when this program called this line it shows error message "OLE OBJECT May be corrupt"
if I did not use "proj1.Class1" as VFP COM Server, it was perfectly correct.
Why?
thank you for your help!
Next
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