G
Guest
Hello everybody,
I have a Problem with C Sharp. I have to use external functions in DLLs.
This Functions are written in Visual C++ 6 like this:
int (__stdcall *GetGlobalValue) (VARIANT Appl, VARIANT &vRetVal);
Now for the first time I want to use C Sharp and I find some examples to use
Functions in extarnal DLLs, but I don't know how to cast the
Variant-Paramters in C Sharp.
I tried it out with the datatype "Object" in C Sharp, but it dosen't work.
Thank you very much for any solution!
[DllImport("...test.dll", EntryPoint = "GetGlobalValue")]
private static extern int GetGlobalValue(Object Para, Object RetVal);
public int CsGetGlobalValue(Object argPara, Object argRetVal)
{
if (GetGlobalValue(argPara, argRetVal) != 0)
{
return 1;
}
else
{
return -1;
}
}
I have a Problem with C Sharp. I have to use external functions in DLLs.
This Functions are written in Visual C++ 6 like this:
int (__stdcall *GetGlobalValue) (VARIANT Appl, VARIANT &vRetVal);
Now for the first time I want to use C Sharp and I find some examples to use
Functions in extarnal DLLs, but I don't know how to cast the
Variant-Paramters in C Sharp.
I tried it out with the datatype "Object" in C Sharp, but it dosen't work.
Thank you very much for any solution!
[DllImport("...test.dll", EntryPoint = "GetGlobalValue")]
private static extern int GetGlobalValue(Object Para, Object RetVal);
public int CsGetGlobalValue(Object argPara, Object argRetVal)
{
if (GetGlobalValue(argPara, argRetVal) != 0)
{
return 1;
}
else
{
return -1;
}
}