Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing/retrieve array to/from COM server
Message
De
24/10/2001 10:58:41
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
24/10/2001 03:01:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00572459
Message ID:
00572620
Vues:
33
>Learning how to make a VFP7 COM server (EXE), I create a custom class acts as the server.
>The server class has a method named GETSTRU:
>PARAMETERS aTableStru
>USE \\myserver\public\data\Items NOUPDATE
>=AFIELDS( aTableStru)
>USE
>
>The Init method of client form contains:
>DIMENSION aTableStru[1]
>aTableStru= 'ANYTHING'
>COMARRAY( oServer,11)
>oServer.GetStru( @aTableStru) && oServer object is created on Load method
>CREATE CURSOR LocalTbl FROM ARRAY aTableStru
>...
>
>When I tried to run the form I got an error on line "oServer.GetStru...":
>OLE error code 0x80020010: Invalid calee
>
>Could anyone help me with this error?

David,
I'm not sure if this is it but compile to MTDLL. Next if you're going to use a command that open tables in COM object then wrap it in a private session. ie: below work for me w/o an error :
Define CLASS MyProcedures AS CUSTOM OLEPUBLIC
  Procedure GetStruc
  Parameters tcTable, taArray
  LOCAL oSession as Session
  oSession = CREATEOBJECT('myPrivate')
  SET DATASESSION TO oSession.DataSessionId
  SELECT * from (tcTable) INTO CURSOR crsTemp WHERE .f.
  AFIELDS(taArray)
  Use
  Return
Endproc
ENDDEFINE

DEFINE CLASS myPrivate as Session
DataSession = 2
enddefine
Compiled to MTDLL comget.dll.

And this in Form.Load :
oTest = create('comget.myprocedures')
local array aMyArray[1] 
COMARRAY(oTest,11)
oTest.GetStruc('\\cetin\samplespath\employee',@aMyArray)
create cursor myCursor from array aMyArray
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform