You have not called the dialog's constructor correctly. You have :
CStatisToDayDlg *p = new CStatisToDayDlg;
but the constructor's prototype indicates it requires a pointer to a parent window object which can be null. That needs to be addressed but
Your first error is from the linker. That error message states the code module that includes the dialog's code was not found by the linker. That is what "LNK2019 unresolved external symbol" means. There are typically two causes for that: either the library itself was not found or that code module was not included in the library.
Your second attempt :
CStatisToDayDlg * p = ( CStatisToDayDlg *) AfxGetMainWnd();
will work only if an instance of the dialog is the main window for the application. If that is the case, then calling
will result in another instance of it and that does not seem like what you really want. Besides, if you haven't called its constructor correctly it won't work anyway.
You first need to address your linker error. Verify that the dialog's code is compiled as part of your library. Then verify that the library can be found by the linker. Often that requires adding a directory path for the library to your project's "Additional Libraries" property under linker options.