Assassin
November 20th, 2004, 05:50 PM
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 ?
|
Click to See Complete Forum and Search --> : VC++ .NET and winapi Assassin November 20th, 2004, 05:50 PM 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 ? Mick November 20th, 2004, 06:08 PM Do you have the platform SDK installed? You can find it on microsoft.com. Also note: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/using_the_windows_headers.asp And finally: You can use LoadLibrary(...)/GetProcAddress(...) if you need to. Assassin November 21st, 2004, 05:56 AM But which library I have to add, I truly don't know. Oh I instaled a SKD but compiler still has a C3861 error. Mick November 21st, 2004, 07:01 AM 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/default.asp?url=/library/en-us/sysinfo/base/exitwindowsex.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") WINUSERAPI BOOL WINAPI ExitWindowsEx( IN UINT uFlags, IN DWORD dwReserved); Assassin November 21st, 2004, 07:42 AM Thank you , now it's working. I propably never guess way to repair it. Assassin November 21st, 2004, 08:50 AM 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' Mick November 22nd, 2004, 02:28 AM 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 GetObject 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") Assassin November 22nd, 2004, 12:15 PM thanky you now it's working. codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |