Hello

I have a DLL written in C and I am struggling with using the functions that return a structure in C#.

C Code that compiles into dll
Code:
typedef struct
{
	unsigned int Height;        //!< Height of the image in pixels.
	unsigned int Width;         //!< Width of the image in pixels.
	unsgined short ***Pixels;           
} IMAGE;

//! Creates and initializes image structure and returns pointer to new image
__declspec(dllexport) IMAGE	CreateImage(unsigned int aHeight, unsigned int aWidth);
I need to use this function in C#, this is what i tried:
Code:
public struct IMAGE
{
	int Height;
	int Width;
	short[,,] Pixels;
}

[DLLImport("IMAGE.dll")]
public static extern IMAGE CreateImage(int aHeight, int aWidth);
But when I call
Code:
IMAGE image = new IMAGE();
image = CreateImage(100,100);
I get the error: Method's type signature is not PInvoke compatible

Other functions that return plain integers work just fine. Someone please explain how I can use a structure created by DLL.

Thanks