Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM Question??
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Divers
Thread ID:
00694175
Message ID:
00694399
Vues:
13
That's true, but you can just call your own myINIT(params) method everytime to get around this...
>I am reading Doug Hennigs paper "N-Tier Application Design", and on the page where he covers the business layers,
>he states:
>
>"Although the Init method of a COM object can't receive parameters..."
>
>I didn't know that, so I tried this code:
>
>
>DEFINE CLASS TestClass as Session OLEPUBLIC
>
>  sStringPassedIn = ""
>
>  PROCEDURE Init(sString AS String)
>
>    This.sStringPassedIn = sString
>
>  ENDPROC
>	
>  PROCEDURE GetString() AS String
>  RETURN This.sStringPassedIn
>
>ENDDEFINE
>
>
>oDLL = CREATEOBJECT("ComTest.TestClass", "This string was passed into Init")
>? oDll.GetString()
>
>
>
>And sure enough, oDll.GetString() returns .F.
>
>I don't understand this. First, why can't COM objects receive params, and
>second, what happens to the parameter I passed in?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform