Форум С++

 

Ответить на сообщение

Вернуться к теме

Вы отвечаете на сообщение:

Автор: Ziq   (22.10.2007 в 22:14)
Ничего не соображаю в Windows-приложениях. Вот такой код приведен в книге по win32 API

#include <windows.h>

int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
    MessageBox(NULL, "Hello, World""Text", MB_OK);
    return 0;
}

Вот лог ошибки

------ Build started: Project: ggg, Configuration: Debug Win32 ------
Compiling...
ggg.cpp
c:\documents and settings\администратор\мои документы\visual studio 2005\projects\ggg\ggg\ggg.cpp(4) : warning C4007: 'WinMain' : must be '__stdcall'
c:\documents and settings\администратор\мои документы\visual studio 2005\projects\ggg\ggg\ggg.cpp(5) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [13]' to 'LPCWSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Build log was saved at "file://c:\Documents and Settings\Администратор\Мои документы\Visual Studio 2005\Projects\ggg\ggg\Debug\BuildLog.htm"
ggg - 1 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Как сделать, чтобы все работало? В чем ошибка?

Все дело происходит в Microsoft Visual C++ 2005 Professional Edition


Ваше имя:

Пароль:

Цитировать

Используйте тэги для выделения текста:
Код: [code][/code]
Жирный: [b][/b]
Наклонный: [i][/i]
URL: [url][/url]

Сообщение:

Прикрепить: