G
Guest
Hello -
I am getting a compile error "Expected class, delegate, enum".
I am trying to create a Class Library in C# which wraps around an unmanaged
DLL that manages a MIDI interface.
In my Class Library code, I have tried to put a DllImport to the Win32
function MessageBox. Just to test out the DllImport functionality before I
add my custom functions that I want to wrap.
So in my Class Library code, I have
using System.Runtime.InteropServices;
namespace TestMod
{
[DllImport("user32.dll")]
public static extern int MessageBox( System.IntPtr h, string m, string
c, uint t);
........
}
I get an error on the work "int" with error "Expected class, delegate,
enum, interface or struct".
This works if my project target is a Windows exe.
In my case I would like to create a class library, so that many apps could
use this and not have to have a define section in the 'main' code.
Is the DllImport attribute allowed for a class library?
Much thx,
bruce
I am getting a compile error "Expected class, delegate, enum".
I am trying to create a Class Library in C# which wraps around an unmanaged
DLL that manages a MIDI interface.
In my Class Library code, I have tried to put a DllImport to the Win32
function MessageBox. Just to test out the DllImport functionality before I
add my custom functions that I want to wrap.
So in my Class Library code, I have
using System.Runtime.InteropServices;
namespace TestMod
{
[DllImport("user32.dll")]
public static extern int MessageBox( System.IntPtr h, string m, string
c, uint t);
........
}
I get an error on the work "int" with error "Expected class, delegate,
enum, interface or struct".
This works if my project target is a Windows exe.
In my case I would like to create a class library, so that many apps could
use this and not have to have a define section in the 'main' code.
Is the DllImport attribute allowed for a class library?
Much thx,
bruce