How to get a variant returned from a c++ function in vb.net?



Hello,

I'm trying to call a function from a C++ dll which returns a variant:

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

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

How can I fix that? (sorry for cross posting in
microsoft.public.dotnet.languages.vb - no answers there, seems better
here)

Thanks Thomas

.