I am working with application for WindowsCE 2013 which is partially created in WinAPI. While I tried compile the code, I met a error message "Error 2 error LNK2019: unresolved external symbol PageSetupDlgW referenced in function "long cdecl WndProc(struct HWND *,unsigned int,unsigned int,long)" (?WndProc@@YAJPAUHWND__@@IIJ@Z) C:\Users\tykab\OneDrive\Dokumenty\Visual Studio 2013\Projects\WinAPI\WinAPI\WinAPI.obj WinAPI"
Problem exist with function PageSetupDlg() which is defined in commdlg.h I have no idea why this problem exist
I suppose this is because comdlg32.lib is missing. Please confirm my assumptions and, if they are true, indicate where I can find such a library.
I put some code snippet below:
enter codecase WM_PAINT:
PAGESETUPDLGW pd;
HWND hwnd;
ZeroMemory(&pd, sizeof(pd));
pd.lStructSize = sizeof(pd);
pd.hwndOwner = hwnd;
pd.hDevMode = NULL; // Don't forget to free or store hDevMode.
pd.hDevNames = NULL; // Don't forget to free or store hDevNames.
pd.Flags = PSD_RETURNDEFAULT ;
HDC hDC;
hDC = CreateDC(NULL, NULL, NULL, NULL);
if (PageSetupDlg(&pd) == TRUE)
{
StartDoc(hDC, NULL);
StartPage(hDC);
Ellipse(hDC, 500, 500, 1000, 1000);
Ellipse(hDC, 1000, 800, 1500, 1300);
Ellipse(hDC, 800, 1000, 1800, 2000);
EndPage(hDC);
EndDoc(hDC);
DeleteDC(hDC);
}
break; here
Ok problem was solved. The solution is that in WindowsCE equivalent for commdlg32.lib is commdlg.lib