I have a problem with managed c++. I try to use a ExitWindowsEx, winaipi function to turn off my computer, but a compiler doesn't find this function. Maybe somebody had the same problem ?
Printable View
I have a problem with managed c++. I try to use a ExitWindowsEx, winaipi function to turn off my computer, but a compiler doesn't find this function. Maybe somebody had the same problem ?
Do you have the platform SDK installed? You can find it on microsoft.com.
Also note:
http://msdn.microsoft.com/library/de...ws_headers.asp
And finally:
You can use LoadLibrary(...)/GetProcAddress(...) if you need to.
But which library I have to add, I truly don't know. Oh I instaled a SKD but compiler still has a C3861 error.
Go to tools->options [project and solutions] VC++ Directories and make sure the <SDK install dir>\include is at the top (under includes) and the <SDK install dir>\lib is at the top (under libs)
ExitWindowsEx is in winuser.h.
http://msdn.microsoft.com/library/de...twindowsex.asp
So:
#include <windows.h>
You also need to link with user32.lib, so add it to your linker settings or add a pragma:
#pragma comment(lib,"user32")
Code:WINUSERAPI
BOOL
WINAPI
ExitWindowsEx(
IN UINT uFlags,
IN DWORD dwReserved);
Thank you , now it's working. I propably never guess way to repair it.
I hava another problem, ehwn I try to add bacground picture to a button when I add picture in properties VC++ added line
this->pictureBox1->BackgroundImage = (__try_cast<System::Drawing::Image * >(resources->GetObject(S"pictureBox1.BackgroundImage")));
and compiler say :
d:\Visual Studio Projects\Programy\Wylacz Mnie\Form1.h(103): error C2039: 'GetObjectA' : is not a member of 'System::Resources::ResourceManager'
Well because you are including <windows.h> you are picking up the macro defines for GetObjectQuote:
Originally Posted by Assassin
Which translates to GetObjectA or GetObjectW.
use a push_macro/pop_macro in your form1.h
#pragma push_macro("GetObject")
#undef GetObject
[body of code]
...
...
#pragma pop_macro("GetObject")
thanky you now it's working.