Hi there,
If you have used objective toolkit or have it. Well, I am trying to learn it and I am going through the Userguide for it. Well, there is an example for browse button. and I been trying to figure out how to do this for the last two days. and I dont' get what I am doing wrong.
This is the example:
4.2.2.1 To incorporate the SECBrowseEdit classes into your code
Use AppStudio to create a dialog template. Drop the edit control on the dialog where you want to place the File or Directory Browse Edit.
Create a new dialog class and attach it to the dialog template you just created.
Add an SECBrowseFileEdit as a member variable to the dialog class you just created.
Override the OnInitDialog() member of the dialog class. In your override, call SECBrowseFileEdit::Initialize() and pass the window ID of the edit control you want to convert to a browse edit. The following code below is an example of the override:
BOOL MyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
#ifndef WIN32
CenterWindow();
#endif
m_editFilename.Initialize(IDC_FILENAME, this);
}
Well, I created an SDI using the Objective Tookit wizard
2. then I added a dialog box and put and put an editbox on it and named it as IDC_FILENAME.
3. then I added a class for the dialog (CMyDialog) and created variable for it using the wizard. like this:
SECBrowseFileEdit m_editFilename;
4. I overrided the function OnInitDialog() just like it asked me to. it's giving me bunch of errors.
Well, this is how my "MyDialog.h" looks like:
#pragma once
// CMyDialog dialog
class CMyDialog : public CDialog
{
DECLARE_DYNAMIC(CMyDialog)
public:
CMyDialog(CWnd* pParent = NULL); // standard constructor
virtual ~CMyDialog();
// Dialog Data
enum { IDD = IDD_DIALOG1 };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
SECBrowseFileEdit m_editFilename;
public:
virtual BOOL OnInitDialog();
};
And this is how my "MyDialog.cpp" file looks like:
// MyDialog.cpp : implementation file
//
#include "stdafx.h"
#include "SECBrowseFileEdit.h"
#include "MyDialog.h"
// CMyDialog dialog
IMPLEMENT_DYNAMIC(CMyDialog, CDialog)
CMyDialog::CMyDialog(CWnd* pParent /*=NULL*/)
: CDialog(CMyDialog::IDD, pParent)
{
}
CMyDialog::~CMyDialog()
{
}
void CMyDialog:oDataExchange(CDataExchange* pDX)
{
CDialog:oDataExchange(pDX);
DDX_Text(pDX, IDC_FILENAME, m_editFilename);
}
BEGIN_MESSAGE_MAP(CMyDialog, CDialog)
END_MESSAGE_MAP()
// CMyDialog message handlers
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
SECBrowseFileEdit::Initialize(IDD_DIALOG1, this)
// TODO: Add extra initialization here
#ifndef WIN32
CenterWindow();
#endif
m_editFilename.Initialize(IDC_FILENAME, this);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
PLEASE HELPPPPPPPPPPPPPP!!!!!!!!!!!!!!!!!!!
Thanksssss
Sunny
If you have used objective toolkit or have it. Well, I am trying to learn it and I am going through the Userguide for it. Well, there is an example for browse button. and I been trying to figure out how to do this for the last two days. and I dont' get what I am doing wrong.
This is the example:
4.2.2.1 To incorporate the SECBrowseEdit classes into your code
Use AppStudio to create a dialog template. Drop the edit control on the dialog where you want to place the File or Directory Browse Edit.
Create a new dialog class and attach it to the dialog template you just created.
Add an SECBrowseFileEdit as a member variable to the dialog class you just created.
Override the OnInitDialog() member of the dialog class. In your override, call SECBrowseFileEdit::Initialize() and pass the window ID of the edit control you want to convert to a browse edit. The following code below is an example of the override:
BOOL MyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
#ifndef WIN32
CenterWindow();
#endif
m_editFilename.Initialize(IDC_FILENAME, this);
}
Well, I created an SDI using the Objective Tookit wizard
2. then I added a dialog box and put and put an editbox on it and named it as IDC_FILENAME.
3. then I added a class for the dialog (CMyDialog) and created variable for it using the wizard. like this:
SECBrowseFileEdit m_editFilename;
4. I overrided the function OnInitDialog() just like it asked me to. it's giving me bunch of errors.
Well, this is how my "MyDialog.h" looks like:
#pragma once
// CMyDialog dialog
class CMyDialog : public CDialog
{
DECLARE_DYNAMIC(CMyDialog)
public:
CMyDialog(CWnd* pParent = NULL); // standard constructor
virtual ~CMyDialog();
// Dialog Data
enum { IDD = IDD_DIALOG1 };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
SECBrowseFileEdit m_editFilename;
public:
virtual BOOL OnInitDialog();
};
And this is how my "MyDialog.cpp" file looks like:
// MyDialog.cpp : implementation file
//
#include "stdafx.h"
#include "SECBrowseFileEdit.h"
#include "MyDialog.h"
// CMyDialog dialog
IMPLEMENT_DYNAMIC(CMyDialog, CDialog)
CMyDialog::CMyDialog(CWnd* pParent /*=NULL*/)
: CDialog(CMyDialog::IDD, pParent)
{
}
CMyDialog::~CMyDialog()
{
}
void CMyDialog:oDataExchange(CDataExchange* pDX)
{
CDialog:oDataExchange(pDX);
DDX_Text(pDX, IDC_FILENAME, m_editFilename);
}
BEGIN_MESSAGE_MAP(CMyDialog, CDialog)
END_MESSAGE_MAP()
// CMyDialog message handlers
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
SECBrowseFileEdit::Initialize(IDD_DIALOG1, this)
// TODO: Add extra initialization here
#ifndef WIN32
CenterWindow();
#endif
m_editFilename.Initialize(IDC_FILENAME, this);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
PLEASE HELPPPPPPPPPPPPPP!!!!!!!!!!!!!!!!!!!
Thanksssss
Sunny