Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using VFP Com component in .Net
Message
 
À
03/10/2002 11:13:50
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00707347
Message ID:
00707457
Vues:
27
If you are using VFP 7.0, you can define the datatype of the parameter. For example, you can say.

LPARAMETERS tcSQL AS Character

I was getting the same error and this worked for me.

>I have VFP single threaded dll that looks up file locations on my system.
>In VFP, I use it like
>
>oFF = CREATEOBJECT('FindFile.FindFile')
>cFilename = oFF.m_FindFile('filetoken')
>
>For .net, I created a runtime-callable wrapper with
>
>tlbimp Findfile.tlb /out: RCW_FindFile.dll /Keyfile:keypair
>
>I added the RCW as a reference in my project and added the following in a button_click handler.
>
>Dim FindFile AS New RCW_FindFile.findfile()  'VS added the () automatically
>Dim strToken AS String
>Dim strFile AS String
>strToken =  "ClaimsInProgress"
>strFile = FindFile.FindFile(strToken)
>
>
>Whenever I run this, .Net throws an exception
>
>An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll
>
>Additional information: Cast from string "ClaimsInProgress" to type 'Integer' is not valid.
>
>If I pass no argument to m_FindFile method, the appropriate error string message is returned. Whenever I pass an argument, I get the exception. Does anybody know whats going on? TIA
- Jayesh
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform