Hi all,
When I try to use API functions in Windows Form all I get are compilation errors. MSDN doesnt help at all in this case. Here is my code:
(I test it with very simple one Rectangle since I want to do some drawing)
public __gc class APIFunctionality
{
public:
[System::Runtime::InteropServices:llImport("GDI32.dll")]
static bool Rectangle(IntPtr hdc, int t, int l , int r, int b);
};
This is the only form of the code that actually compiles . I found in MSDN some info how to do it, but it simply didnt compile. Also by MSDN there is no DllImport, only DllImportAtributes. Anyway, above section compiles, and here is my usage in Picture Box (all very basic and simple ):
Graphics * m = e->Graphics;
APIFunctionality::Rectangle(hdc, 30, 100, 100, 100);
m->ReleaseHdc(hdc);
This also compiles, but doesnt work at all .
Does anyone know how to do this in C++ or has any idea where I can find good info about it? Appreciate it.
When I try to use API functions in Windows Form all I get are compilation errors. MSDN doesnt help at all in this case. Here is my code:
(I test it with very simple one Rectangle since I want to do some drawing)
public __gc class APIFunctionality
{
public:
[System::Runtime::InteropServices:llImport("GDI32.dll")]
static bool Rectangle(IntPtr hdc, int t, int l , int r, int b);
};
This is the only form of the code that actually compiles . I found in MSDN some info how to do it, but it simply didnt compile. Also by MSDN there is no DllImport, only DllImportAtributes. Anyway, above section compiles, and here is my usage in Picture Box (all very basic and simple ):
Graphics * m = e->Graphics;
APIFunctionality::Rectangle(hdc, 30, 100, 100, 100);
m->ReleaseHdc(hdc);
This also compiles, but doesnt work at all .
Does anyone know how to do this in C++ or has any idea where I can find good info about it? Appreciate it.