Jump to content
  • Advertisement
Sign in to follow this  
comwiz920

Windows API Programming Compile Errors

This topic is 4230 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have been trying my hand at Windows API Programming and am getting a bunch of build errors when I build it in VC++ 2005 Express. I have the PSDK Installed already. The ironic thing is, The Code Compiles file in Dev-C++ Code:
#include <windows.h>
#include <stdafx.h>
const char g_szClassName[] = "Experimental Window";

//Step 4: The Window Procedure
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch(msg)
	{
	case WM_CLOSE:
		DestroyWindow(hwnd);
		break;
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hwnd,msg,wParam,lParam);
		break;
	}
	return 0;
}

int WINAPI WinMain(HINSTANCE hInstance,HINSTAND hPrevInstance,
				   LPSTR lpCmdLine, int nCmdShow)
{
	WNDCLASSEX wc;
	HWND hwnd;
	MSG Msg;

	//Step 1: Registering The Window Class
	wc.cbSize = sizeof(WNDCLASSEX);
	wc.style = 0;
	wc.lpfnWndProc = WndProc;
	wc.cbClsExtra = 0;
	wc.cbWndExtra = 0;
	wc.hInstance = hInstance;
	wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
	wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
	wc.lpszMenuName = NULL;
	wc.lpszClassName = g_szClassName;
	wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

	if(!RegisterClassEx(&wc))
	{
		MessageBox(NULL, "Window Registration Failed!", "Error", MB_ICONEXCLAMATION | MB_OK);
		return 0;
	}

	//Step 2: Creating The Window
	hwnd = CreateWindowEx(
		WS_EX_CLIENTEDGE,
		g_szClassName,
		"Experimental Window",
		WS_OVERLAPPEDWINDOW,
		CW_USEDEFAULT, CW_USEDEFAULT, 300, 200,
		NULL, NULL,hInstance, NULL);

	if(hwnd == NULL)
	{
		MessageBox(NULL, "Window Creation Failed!", "Error",MB_ICONEXCLAMATION | MB_OK);
		return 0;
	}

	ShowWindow(hwnd, nCmdShow);
	UpdateWindow(hwnd);
	
	//Step 3: The Message Loop
	while(GetMessage(&Msg, 0, 0) > 0)
	{
		TranslateMessage(&Msg);
		DispatchMessage(&Msg);
	}
	return Msg.wParam;
}
Build Log:
1>------ Build started: Project: Windows Tutorial, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>c:\program files\microsoft visual studio 8\vc\include\winnt.h(3423) : warning C4068: unknown pragma
1>c:\program files\microsoft visual studio 8\vc\include\winnt.h(3428) : warning C4068: unknown pragma
1>c:\program files\microsoft visual studio 8\vc\include\winbase.h(1252) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\winbase.h(1252) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\winbase.h(1253) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\winbase.h(1253) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\winbase.h(1253) : error C2086: 'int DECLSPEC_NORETURN' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\winbase.h(1252) : see declaration of 'DECLSPEC_NORETURN'
1>c:\program files\microsoft visual studio 8\vc\include\winbase.h(1313) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\winbase.h(1313) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\winbase.h(1313) : error C2086: 'int DECLSPEC_NORETURN' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\winbase.h(1252) : see declaration of 'DECLSPEC_NORETURN'
1>c:\program files\microsoft visual studio 8\vc\include\imm.h(408) : warning C4005: 'MOD_ALT' : macro redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\winuser.h(2135) : see previous definition of 'MOD_ALT'
1>c:\program files\microsoft visual studio 8\vc\include\imm.h(409) : warning C4005: 'MOD_CONTROL' : macro redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\winuser.h(2136) : see previous definition of 'MOD_CONTROL'
1>c:\program files\microsoft visual studio 8\vc\include\imm.h(410) : warning C4005: 'MOD_SHIFT' : macro redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\winuser.h(2137) : see previous definition of 'MOD_SHIFT'
1>c:\program files\microsoft visual studio 8\vc\include\imm.h(412) : warning C4005: 'MOD_LEFT' : macro redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\winuser.h(2142) : see previous definition of 'MOD_LEFT'
1>c:\program files\microsoft visual studio 8\vc\include\imm.h(413) : warning C4005: 'MOD_RIGHT' : macro redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\winuser.h(2141) : see previous definition of 'MOD_RIGHT'
1>c:\program files\microsoft visual studio 8\vc\include\imm.h(415) : warning C4005: 'MOD_ON_KEYUP' : macro redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\winuser.h(2140) : see previous definition of 'MOD_ON_KEYUP'
1>c:\program files\microsoft visual studio 8\vc\include\imm.h(416) : warning C4005: 'MOD_IGNORE_ALL_MODIFIER' : macro redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\winuser.h(2139) : see previous definition of 'MOD_IGNORE_ALL_MODIFIER'
1>c:\program files\microsoft visual studio 8\vc\include\excpt.h(107) : warning C4005: 'AbnormalTermination' : macro redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\winbase.h(1053) : see previous definition of 'AbnormalTermination'
1>c:\program files\microsoft visual studio 8\vc\include\excpt.h(123) : warning C4005: 'EXCEPTION_CONTINUE_EXECUTION' : macro redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\winbase.h(428) : see previous definition of 'EXCEPTION_CONTINUE_EXECUTION'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : error C2146: syntax error : missing ';' before identifier 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : error C2377: 'UINT' : redefinition; typedef cannot be overloaded with any other symbol
1>        c:\program files\microsoft visual studio 8\vc\include\windef.h(244) : see declaration of 'UINT'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : error C2146: syntax error : missing ';' before identifier 'DragQueryFileA'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : error C2061: syntax error : identifier 'UINT'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(58) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(58) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(58) : error C2146: syntax error : missing ';' before identifier 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(58) : error C2146: syntax error : missing ';' before identifier 'DragQueryFileW'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(58) : error C2086: 'int STDAPICALLTYPE' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(58) : error C2061: syntax error : identifier 'UINT'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(64) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(64) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(64) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(64) : error C2146: syntax error : missing ';' before identifier 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(64) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(64) : error C2377: 'BOOL' : redefinition; typedef cannot be overloaded with any other symbol
1>        c:\program files\microsoft visual studio 8\vc\include\windef.h(227) : see declaration of 'BOOL'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(64) : error C2146: syntax error : missing ';' before identifier 'DragQueryPoint'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(64) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(64) : error C2086: 'int STDAPICALLTYPE' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(64) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(65) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(65) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(65) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(65) : error C2146: syntax error : missing ';' before identifier 'DragFinish'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(65) : error C2182: 'STDAPICALLTYPE' : illegal use of type 'void'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(65) : error C2370: 'STDAPICALLTYPE' : redefinition; different storage class
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(65) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(66) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(66) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(66) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(66) : error C2146: syntax error : missing ';' before identifier 'DragAcceptFiles'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(66) : error C2182: 'STDAPICALLTYPE' : illegal use of type 'void'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(66) : error C2370: 'STDAPICALLTYPE' : redefinition; different storage class
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(66) : error C2061: syntax error : identifier 'BOOL'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(66) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(68) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(68) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(68) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(68) : error C2146: syntax error : missing ';' before identifier 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(68) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(68) : error C2377: 'HINSTANCE' : redefinition; typedef cannot be overloaded with any other symbol
1>        c:\program files\microsoft visual studio 8\vc\include\windef.h(284) : see declaration of 'HINSTANCE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(68) : error C2146: syntax error : missing ';' before identifier 'ShellExecuteA'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(68) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(68) : error C2086: 'int STDAPICALLTYPE' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(68) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(69) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(69) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(69) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(69) : error C2146: syntax error : missing ';' before identifier 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(69) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(69) : error C2146: syntax error : missing ';' before identifier 'ShellExecuteW'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(69) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(69) : error C2086: 'int STDAPICALLTYPE' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(69) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(75) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(75) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(75) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(75) : error C2146: syntax error : missing ';' before identifier 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(75) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(75) : error C2146: syntax error : missing ';' before identifier 'FindExecutableA'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(75) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(75) : error C2086: 'int STDAPICALLTYPE' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(75) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(76) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(76) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(76) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(76) : error C2146: syntax error : missing ';' before identifier 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(76) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(76) : error C2146: syntax error : missing ';' before identifier 'FindExecutableW'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(76) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(76) : error C2086: 'int STDAPICALLTYPE' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(76) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(82) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(82) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(82) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(82) : error C2143: syntax error : missing ';' before '*'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(82) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(82) : error C2377: 'LPWSTR' : redefinition; typedef cannot be overloaded with any other symbol
1>        c:\program files\microsoft visual studio 8\vc\include\winnt.h(78) : see declaration of 'LPWSTR'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(82) : error C2146: syntax error : missing ';' before identifier 'CommandLineToArgvW'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(82) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(82) : error C2040: 'STDAPICALLTYPE' : 'int *' differs in levels of indirection from 'int'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(82) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(84) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(84) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(84) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(84) : error C2146: syntax error : missing ';' before identifier 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(84) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(84) : error C2377: 'INT' : redefinition; typedef cannot be overloaded with any other symbol
1>        c:\program files\microsoft visual studio 8\vc\include\windef.h(243) : see declaration of 'INT'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(84) : error C2146: syntax error : missing ';' before identifier 'ShellAboutA'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(84) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(84) : error C2086: 'int STDAPICALLTYPE' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(84) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(85) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(85) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(85) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(85) : error C2146: syntax error : missing ';' before identifier 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(85) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(85) : error C2146: syntax error : missing ';' before identifier 'ShellAboutW'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(85) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(85) : error C2086: 'int STDAPICALLTYPE' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(85) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(91) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(91) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(91) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(91) : error C2146: syntax error : missing ';' before identifier 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(91) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(91) : error C2377: 'HICON' : redefinition; typedef cannot be overloaded with any other symbol
1>        c:\program files\microsoft visual studio 8\vc\include\windef.h(272) : see declaration of 'HICON'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(91) : error C2146: syntax error : missing ';' before identifier 'DuplicateIcon'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(91) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(91) : error C2086: 'int STDAPICALLTYPE' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(91) : error C2146: syntax error : missing ')' before identifier 'hInst'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(91) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(91) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(92) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(92) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(92) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(92) : error C2146: syntax error : missing ';' before identifier 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(92) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(92) : error C2146: syntax error : missing ';' before identifier 'ExtractAssociatedIconA'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(92) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(92) : error C2086: 'int STDAPICALLTYPE' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(92) : error C2146: syntax error : missing ')' before identifier 'hInst'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(92) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(92) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(93) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(93) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(93) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(93) : error C2146: syntax error : missing ';' before identifier 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(93) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(93) : error C2146: syntax error : missing ';' before identifier 'ExtractAssociatedIconW'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(93) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(93) : error C2086: 'int STDAPICALLTYPE' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(93) : error C2146: syntax error : missing ')' before identifier 'hInst'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(93) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(93) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(108) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(108) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(108) : error C2086: 'int EXTERN_C' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'EXTERN_C'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(108) : error C2146: syntax error : missing ';' before identifier 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(108) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(108) : error C2146: syntax error : missing ';' before identifier 'ExtractIconA'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(108) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(108) : error C2086: 'int STDAPICALLTYPE' : redefinition
1>        c:\program files\microsoft visual studio 8\vc\include\shellapi.h(57) : see declaration of 'STDAPICALLTYPE'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(108) : error C2146: syntax error : missing ')' before identifier 'hInst'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(108) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(108) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(109) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files\microsoft visual studio 8\vc\include\shellapi.h(109) : fatal error C1003: error count exceeds 100; stopping compilation
1>Build log was saved at "file://c:\Documents and Settings\Kyle\My Documents\C++ Projects\Windows Tutorial\Windows Tutorial\Windows Tutorial\Debug\BuildLog.htm"
1>Windows Tutorial - 165 error(s), 11 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Thanks for your help.

Share this post


Link to post
Share on other sites
Advertisement
Try including stdafx.h first.
Also, I hope that you won't try to compile that code under UNICODE.

P.S.
I've just noticed a syntax error in the code that you've posted, so I don't know how you compiled this on another compiler anyway.

Quote:

int WINAPI WinMain(HINSTANCE hInstance,HINSTAND hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Share this post


Link to post
Share on other sites
Better yet, go to your Project Options in VC++ and "Disable Precompiled Headers."

Then you don't need stdafx.h at all. Since you are including it with brackets, it might be picking up a stdafx.h from someplace you don't expect. That may be causing the errors.

Share this post


Link to post
Share on other sites
never include stdafx.h like that under visual studio. it might be parsing the one used by MFC. for precompiled headers you should always make your own and put it in your project's source directory and include it as "stdafx.h" at the top of every source file.

Share this post


Link to post
Share on other sites
Minor nitpick:

Please, for the love of [insert favourite godlike entity here], do not put the call to DefWindowProc in the default-case. For most messages you want to pass the message on to the DefWindowProc. If you choose to handle the message you'd have to insert an extra DefWindowProc call.


LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return DefWindowProc(hwnd,msg,wParam,lParam);

}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!