Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Pass Parameters to Init with CreateObject
Message
De
07/12/2006 01:05:08
Donald Lowrey
Data Technology Corporation
Las Vegas, Nevada, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
How to Pass Parameters to Init with CreateObject
Divers
Thread ID:
01175496
Message ID:
01175496
Vues:
58
Passing params to an object created from a prg file works fine, but when passing to an exe, I get a "data type mismatch" error.

I know that params with CreateObject will automatically be passed to the Init() event of that class. In example #2, a COM exe, the data type mismatch error occurs when the Init Event fires. I thought at first that this is a value by reference vs. value type issue, but I seem to be stuck. Your thoughts are appreciated.

# 1 Object created from prg where test is a class defined as Custom (or Session, if you prefer) OlePublic.
SET PROCEDURE TO oMyObj ADDITIVE
oMyObj = CREATEOBJECT("test", 1, .t. , "Hello World")
# 2 Now, with the prg file compiled as an exe, named "testexe"
oMyObj = CREATEOBJECT("testexe.test", 1, .t. , "Hello World")
The Init() method in class "test" is the same in both examples.
FUNCTION INIT
LPARAMETERS nVal, lBool, cStr
..do something
ENDFUNC
Thanks for taking a look.

Don Lowrey
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform