By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,087 Members | 1,508 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,087 IT Pros & Developers. It's quick & easy.

"can not return variants" when using c++ dll

P: n/a
Hello,

I'm trying to call a function from a C++ dll which is declared as

VARIANT DLLEXPORT ExecuteFunction (LPCSTR);

This function (which I can't change) executes a SQL query and returns a
single value - whatever the query asks for: integer, string, double
etc.

My declaration for that in VB.NET 2003 is

Private Declare Auto Function ExecuteFunction Lib "database.dll" ( _
ByVal sSQL As Char) As Object

Whenever I call that function, I'm getting the "PInvoke restriction:
can not return
variants"-error.

How can I fix that?

Thanks
Thomas

Nov 23 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.