hum... i do something wrong, because i still can't add new page :\ i have some errors:
Code: Select all
c:\Documents and Settings\Adrian\Pulpit\DCPlusPlus-0.687-src\windows\NewPage.h(16) : error C2039: 'SETTINGS_NEWPAGE' : is not a member of 'ResourceManager'
c:\Documents and Settings\Adrian\Pulpit\DCPlusPlus-0.687-src\windows\NewPage.cpp(21): error C2653: 'Advanced3Page' : is not a class or namespace name
c:\Documents and Settings\Adrian\Pulpit\DCPlusPlus-0.687-src\windows\NewPage.h(16): error C2228: left of '.c_str' must have class/struct/union type
c:\Documents and Settings\Adrian\Pulpit\DCPlusPlus-0.687-src\windows\NewPage.h(16): error C2065: 'SETTINGS_NEWPAGE' : undeclared identifier
c:\Documents and Settings\Adrian\Pulpit\DCPlusPlus-0.687-src\windows\NewPage.cpp(22): error C2065: 'items' : undeclared identifier
this are my .cpp and .h files:
NewPage.cpp
Code: Select all
#include "stdafx.h"
#include "../client/DCPlusPlus.h"
#include "Resource.h"
#include "NewPage.h"
#include "CommandDlg.h"
#include "../client/SettingsManager.h"
//6) Add:
LRESULT NewPage::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
PropPage::translate((HWND)(*this), texts); // 'texts' here is a static TextItem array. Omit if desired.
PropPage::read((HWND)*this, items, 0, 0); // 'items' here is a static Item array. Omit if desired.
// Do specialized reading here
return TRUE;
}
//7) Add:
void Advanced3Page::write() {
PropPage::write((HWND)*this, items, 0, 0); // 'items' here is a static Item array, the very same variable as on 6). Omit if desired.
};
//8.1) If you want to have text in your page, add:
//PropPage::TextItem NewPage::texts[] = {
//{ IDC_SETTINGS_SOME_SETTING, ResourceManager::SOME_TEXT },
// { IDC_SETTINGS_ANOTHER_SETTING, ResourceManager::ANOTHER_TEXT },
// { 0, ResourceManager::SETTINGS_AUTO_AWAY } // Pretty much used everywhere else... You can might aswell include it.
//};
//Remember that you have to have the 'texts' array included.
//8.2) If you want to have items in your page, add:
//PropPage::Item Advanced3Page::items[] = {
// { IDC_SOME_ITEM, SettingsManager::SOME_TEXT_BLAH, PropPage::T_INT },
// { IDC_ANOTHERITEM, SettingsManager::ANOTHER_TEXT_BLAH, PropPage::T_STRING },
// { 0, 0, PropPage::T_END }
//};
//Depending on the item, use T_INT or T_STRING.
//Well, you get the hang of it there.
NewPage.h
Code: Select all
#ifndef NEWPAGE_H
#define NEWPAGE_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <atlcrack.h>
#include "PropPage.h"
#include "ExListViewCtrl.h"
class NewPage : public CPropertyPage<IDD_NEWPAGE>, public PropPage
{
public:
NewPage(SettingsManager *s) : PropPage(s) {
SetTitle(CTSTRING(SETTINGS_NEWPAGE));
m_psp.dwFlags |= PSP_HASHELP;
};
virtual ~NewPage() {
};
BEGIN_MSG_MAP(NewPage)
MESSAGE_HANDLER(WM_INITDIALOG, onInitDialog)
END_MSG_MAP()
LRESULT onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
// Common PropPage interface
PROPSHEETPAGE *getPSP() { return (PROPSHEETPAGE *)*this; }
virtual void write();
protected:
static Item items[]; // If you want it that is...
static TextItem texts[]; // If you want it that is...
};
#endif //NEWPAGE_H
what i do wrong? or what else i should do? any ideas?
thx