What do I have to do to include windows.h in a CLI project and be able to make Win32 API callsThis only happens if you switch to "/clr:safe"!
If I simply include windows.h, I get a lot of errors like these:
1>C:\Program Files\Microsoft Platform SDK for Windows XP SP2\Include\WinNT.h(636) : error C3641: 'Int64ShllMod32' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe 1>C:\Program Files\Microsoft Platform SDK for Windows XP SP2\Include\WinNT.h(637) : warning C4793: '__asm' : causes native code generation for function 'ULONGLONG Int64ShllMod32(ULONGLONG,DWORD)'
If you want to develop pure and verifiable assemblies then you must not use unmaged code or any unverifiable data-type!
Please switch either to "/clr" or "/clr:pure".
-- Greetings Jochen Kalmbach Microsoft MVP VC++ My blog about Win32 and .NET http://blog.kalmbachnet.de/ PS: Please mark an answer as "answered" if it helped!!!

Using windows.h in C++/CLI project
jh2005
onur6n
I tried with VS2005 Beta2 and there is no error...
Tomorrow I will try with VC2005 Express Beta2...
Greetings
Jochen
Larry P
ericsmoth
--
thepaul
- create new windows forms project
- add to end of stdafx.h
#include "windows.h"
- build project
output:
If I create a blank .net project and add your hello world code, I get the same thing with even more errors.
jay2068
And I works without any problem!
Paul Marangoni
If I simply include windows.h, I get a lot of errors like these:
Bjørnar Sundsbø
#include <windows.h>
using namespace System;
int main(array<System::String ^> ^args)
{
ULONGLONG l = Int64ShllMod32(1, 1);
Console::WriteLine(L"Hello World");
return 0;
}