Date picker

I am using VS 2015 C++. I have a variety of programs that have picked up a date by reading three separate fields.
I now have a new program that wants to read a date and I have set up a resource files using a DATETIMEPICK_CLASS CONTROL.
The problem I have is when I compile and run the program (it complies and links) and select that DIALOG nothing appears at all.
Any ideas what might be wrong?
It would be great if you could show us your code.... We can't figure anything without it...
The resource file is edited first by resedit and then modified by hand as required.
This is the relevant dialog
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOGMEW DIALOG 0, 0, 227, 105
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION "Dates for Chart"
FONT 8, "Ms Shell Dlg"
{
LTEXT "To", IDC_STATIC, 31, 49, 10, 9, SS_LEFT, WS_EX_LEFT
CONTROL "Start Date", IDC_START, DATETIMEPICK_CLASS, WS_TABSTOP | DTS_RIGHTALIGN, 31, 25, 100, 15, WS_EX_LEFT
CONTROL "End Date", IDC_END, DATETIMEPICK_CLASS, WS_TABSTOP | DTS_RIGHTALIGN, 31, 67, 100, 15, WS_EX_LEFT
LTEXT "From", IDC_STATIC, 31, 9, 16, 9, SS_LEFT, WS_EX_LEFT
DEFPUSHBUTTON "OK", IDOK, 166, 5, 50, 14, 0, WS_EX_LEFT
PUSHBUTTON "Cancel", IDCANCEL, 166, 26, 50, 14, 0, WS_EX_LEFT
}

These are the menu items that would bring up that menu

POPUP "&Back"
{
MENUITEM "&By Interval", IDM_INTERVAL1
MENUITEM "&By Day", IDM_BYDAY1
MENUITEM "&By Number", IDM_BYNUMBER1
}

This is one of the entries in WndProc under WM_COMMAND

case IDM_BYNUMBER1:
DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOGNEW), hWnd, BYNUMBER1);
FirstTime = FALSE;
Selected = FALSE;

Option = BYNUMBER;
ReadData(hWnd, hdc);
NewWindow(hWnd);
break;

This is the routine referenced above (BYNUMBER1)

INT_PTR CALLBACK BYNUMBER1(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);

switch (message)
{
case WM_INITDIALOG:

PopulateDate(hDlg);

return (INT_PTR)TRUE;

case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
if (LOWORD(wParam) == IDOK)
{
ReadLength(hDlg);
}
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}
break;
}
return (INT_PTR)FALSE;
}

All this has worked with other DIALOGs that just read data (using fields defined with EDITTEXT)

I can't see anything obviously wrong. When I select the appropriate menu item, nothing happens. The DIALOG simply does not show and some simple trace shows that it simply doesn't get activated.


Check the return value from DialogBox and see what you get.
1
2
case IDM_BYNUMBER1:
   DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOGNEW), hWnd, BYNUMBER1);
So I added an err = in front pf the call and it returned -1 (very helpful).
So I added a call to a function called ErrorExit that does a GetErrorExit().

The result of that was a dialog box that said:

Testing for error message failed with error 1814: The specified resource name cannot be found in the image file.

It would seem that although you can define it and the code will compile and apparently execute, the Date Picker doesn't actually do anything.

But I've seen this function in other applications. If Visual Studio 2015 doesn't permit its use, what other compiler is there that can use it?

It would look like I'm back to selecting the date fields individually, or am I?
So I added a call to a function called ErrorExit that does a GetErrorExit().Testing for error message failed with error 1814: The specified resource name cannot be found in the image file.

Where and how is IDD_DIALOGNEW defined?
Can you upload the files somewhere so that I can run it.
I can load into DropBox or Facebook or Google Drive, but I would need to know how to share the file (Resource.h)
On Dropbox you right click on a file and choose ..share. That will give you an link to post here.
I'm on Windows 10. When I click on Share it comes up with a window that says:

Who do you want to share this file with?

Don't get a link (yet).

So what do I put?
No idea, I am using Windows 7
It needs an email address
Topic archived. No new replies allowed.