I have a VS2010 Win32 console application. Within this console application I try to attach a window as child to another Win32 app. But I do not get the application linked (it compiles, just the linker issue AFAIK):
Error 1 error LNK2019: unresolved external symbol "long __stdcall viewproc(struct HWND__ *,unsigned int,unsigned int,long)" (?viewproc@@YGJPAUHWND__@@IIJ@Z) referenced in function "void __cdecl createFSXWindow(void)" (?createFSXWindow@@YAXXZ) H:\Projects\VisualStudioNet2010\FSXTests\Menu Items\Menu Items\MenuItems.obj Menu Items
I have added all libs from a Win32 Windows project under Linker/include:
kernel32.lib;user32.lib;gdi32.lib;winspool.lib; comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib; odbccp32.lib;%(AdditionalDependencies)
Remark: Just to clarify, I do NOT(!) try to attach the window to the console window, but another Win32 application, so it is not about "Make a win32 console app display a window"
The issue comes in once I add the window code such as:
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <strsafe.h>
....
// window
WNDCLASSEX wc;
wc.style = CS_HREDRAW | CS_VREDRAW ;
wc.lpfnWndProc = viewproc;
When I check the command line of the linker the only difference between my console app and an Win32 app is SUBSYSTEM:CONSOLE
vs. SUBSYSTEM:WINDOWS
Any hints?