Hi,
I've the next problem. I need to use a function from one old library in a member function of a administrate class. When I try to use
#include "myFunctions.h"
I recive a lot of errors as
'IServiceProvider': ambiguous symbol.
I'm lost. Can Anybody help me?
Thanks.
Hi,
I have the next function in an old dll.
myType function(unsigned long *var1, unsigned long var2, wchar_t *var3);
I want to export this function to C#, and I try the next
[DllImport("myLib.dll", EntryPoint="function")]
public static extern myType myNewFunction(ref uint...
The sentence
byte(8) var2;
isn't correct in C#. Do you know how can I get this array with dimension 8? (if it's possible, without use the constructor).
Thanks.
Ok,
I understand all that theory, but I have the next in C++
/******/
typedef struct
{
int var1;
byte var2[8];
char *pVar3;
}
myStruct;
void myFunction(myStruct var1, int var 2, etc...)
/******/
How can I define this structure in C#?. I use
[DllImport(...)] for import the function...
I think that this is the correct way, but I don't understand very well the MSDN examples. I only want to do something as
typedef MY_INT int;
Could you help me with any example?
Thanks,
Ernesto.
Lets say you declare "Using Modules.AdsManager.File" in your code, it means that you should have "yourLibrary.dll" available at the same directory as you build it, where the library must have namespace "Modules.AdsManager.File"
I hope that this can help you.
Thanks for everything, but finally I have obtained it!
This is the 'winner code':
[DllImport("myLib.dll", EntryPoint="theFunction")]
public static extern TYPE_ENUM myFunction(
[MarshalAs(UnmanagedType.U4)]ref uint var1,
[MarshalAs(UnmanagedType.U4)]uint var2...
I am trying to reuse in C# one function written in Visual C++ 6.0 that is in a DLL. Function has the following head:
type_enum name_function(
unsigned long *var1,
unsigned long var2,
wchar_t *var3);
I am trying to use the following thing, but it does not work...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.