Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using VFP Com component in .Net
Message
From
03/10/2002 11:13:50
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Using VFP Com component in .Net
Miscellaneous
Thread ID:
00707347
Message ID:
00707347
Views:
52
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
Next
Reply
Map
View

Click here to load this message in the networking platform