I am trying to call GetLargestConsoleWindowSize from a Managed C++ class. I have created the prototype in my managed code like this:
static COORD GetLargestConsoleWindowSize(int hConsoleOutput);
COORD is a structure declared like this
private __value struct COORD
which mimics the API structure used by the API's GetLargestConsoleWindowSize function.
The problem is that when I try to compile I get an error C3385 that tells me that "a function that has a DllImport Custom Attribute cannot return an instance of a class". I know for sure that the C# compiler doesn't have this limitation. I tried to find any references to this error on the net, but couldn't find any.
Did anyone else bumped into it?