Good day sirs,
I am currently working on creating windows GUI software for a hardware device. The hardware's functions are stored in a DLL. Here is the structure for a function I need to import
I use DLLImport to import functions. It seems to work as long as the functions all use default types like int, char and others. My question is how will I go around importing functions which use custom types?
This is what I'm doing right now
It really is not working at all. Some errors include the ff
- "The type of namespace name 'LPSKYETEK_DEVI CE' could not be found (are you missing a using directive or an assembly reference?)"
- "Cannot take the address of, get the size of, or declare a pointer to a managed type ('LPSKYETEK_DEV ICE')"
I'm using Visual C# Express Edition 2008 on a Windows XP machine. I have .NET 3.5 installed.
I am extremely unfamiliar with Windows Development as all my prior programming work has been with assembly, Java and Matlab. This has also been the first time I used Visual Studio. Thanks for your help!
Paulo
I am currently working on creating windows GUI software for a hardware device. The hardware's functions are stored in a DLL. Here is the structure for a function I need to import
Code:
CustomType CustomFunction (CustomType1, CustomType2)
This is what I'm doing right now
Code:
[DllImport("stapi.dll")] LPSKYETEK_DEVICE; [DllImport("stapi.dll")] static extern int SkyeTek_DiscoverDevices(LPSKYETEK_DEVICE **lpDevices);
It really is not working at all. Some errors include the ff
- "The type of namespace name 'LPSKYETEK_DEVI CE' could not be found (are you missing a using directive or an assembly reference?)"
- "Cannot take the address of, get the size of, or declare a pointer to a managed type ('LPSKYETEK_DEV ICE')"
I'm using Visual C# Express Edition 2008 on a Windows XP machine. I have .NET 3.5 installed.
I am extremely unfamiliar with Windows Development as all my prior programming work has been with assembly, Java and Matlab. This has also been the first time I used Visual Studio. Thanks for your help!
Paulo
Comment