R
R.Kaiser
I know that I can call Win32 API functions in a Windows forms
application by specifying each function header individually like in
using namespace System;
using namespace System::Runtime::InteropServices;
typedef void* HWND;
[DllImport("user32.dll", CharSet = CharSet::Ansi)]
extern "C" int* MessageBox(HWND hWnd, char* pText,
char* pCaption,unsigned int uType);
void test_Win32Messagebox_1(void)
{
char* pText = "Hello World!";
char* pCaption = "Platform Invoke Sample";
MessageBox(0, pText, pCaption, 0);
}
What I want to know: Is there an easy way to include all headers by
using windows.h or a similar header file:
extern "C" {
#include <windows.h>
}
I tried to combine this #include statement with a DLLImport attribute
like from above, but I did not succeed.
Thanks
Richard
application by specifying each function header individually like in
using namespace System;
using namespace System::Runtime::InteropServices;
typedef void* HWND;
[DllImport("user32.dll", CharSet = CharSet::Ansi)]
extern "C" int* MessageBox(HWND hWnd, char* pText,
char* pCaption,unsigned int uType);
void test_Win32Messagebox_1(void)
{
char* pText = "Hello World!";
char* pCaption = "Platform Invoke Sample";
MessageBox(0, pText, pCaption, 0);
}
What I want to know: Is there an easy way to include all headers by
using windows.h or a similar header file:
extern "C" {
#include <windows.h>
}
I tried to combine this #include statement with a DLLImport attribute
like from above, but I did not succeed.
Thanks
Richard