Hmm. At first glance, it looks OK to me.
Wdir is a string. You pass that into Wdb, so that's also a string. You then concatenate that with "OPEN DATABASE ", so that should be OK.
Are you sure it is that line that is causing the problem? Is it possible it's something different that's causing the error?
However, I'm wondering about this line in your VB:
Code:
Dim wobj As Object = wris.MY_FUNC(wdir, wcom)
You are returning wReturn from the DLL, but wReturn isn't an object. I don't know VB very well, but could that be causing the problem?
Another suggestion. In general, it's best to test your classes within VFP before you make them into DLLs. You can do that within the VFP command windows, something like this:
Code:
oSQL = CREATEOBJECT("cmd_sql")
oDir = "c:\arc\private.dbc"
oWcom = "select * from anagrafe"
? oSQL.MyFunc(oDir, oWcom)
That way, you'll have all the benefit of the VFP development environment to help you find the problem.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro tips, advice, training, consultancy
Custom software for your business