Click here to Skip to main content
15,925,782 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHai,InstallShield for VC++6 Query? Pin
CodeVarma10-Apr-06 5:46
CodeVarma10-Apr-06 5:46 
Questionedit control in vc++ Pin
sudeep_br10-Apr-06 4:59
sudeep_br10-Apr-06 4:59 
AnswerRe: edit control in vc++ Pin
Hamid_RT10-Apr-06 5:26
Hamid_RT10-Apr-06 5:26 
GeneralRe: edit control in vc++ Pin
sudeep_br10-Apr-06 19:48
sudeep_br10-Apr-06 19:48 
GeneralRe: edit control in vc++ Pin
Hamid_RT11-Apr-06 1:14
Hamid_RT11-Apr-06 1:14 
GeneralRe: edit control in vc++ Pin
sudeep_br12-Apr-06 21:34
sudeep_br12-Apr-06 21:34 
GeneralRe: edit control in vc++ Pin
Hamid_RT13-Apr-06 0:34
Hamid_RT13-Apr-06 0:34 
GeneralRe: edit control in vc++ Pin
sudeep_br12-Apr-06 21:45
sudeep_br12-Apr-06 21:45 
#include "stdafx.h"
#include "DesktopSearch.h"
#include "CreateDlg.h"
#include "UpdateDlg.h"
#include "FoldersDialog.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CCreateDlg dialog


CCreateDlg::CCreateDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCreateDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CCreateDlg)
m_summary = -1;
//}}AFX_DATA_INIT
}


void CCreateDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCreateDlg)
DDX_Control(pDX, IDC_FolderSelect, m_FolderSelect);
DDX_Control(pDX, IDC_Enter_Location, m_Enter_Location);
DDX_Control(pDX, IDC_Enter_Name, m_name);
DDX_Control(pDX, IDC_OK, m_ok);
DDX_Radio(pDX, IDC_Summary_only, m_summary);
//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCreateDlg, CDialog)
//{{AFX_MSG_MAP(CCreateDlg)
ON_BN_CLICKED(IDC_FolderSelect, OnFolderSelect)
ON_BN_CLICKED(IDC_OK, OnOk)
ON_BN_CLICKED(IDC_Cancel, OnCancel)
ON_EN_CHANGE(IDC_Enter_Name, OnChangeEnterName)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCreateDlg message handlers
extern TCHAR szDir[MAX_PATH];

void CCreateDlg::OnFolderSelect()
{
// TODO: Add your control notification handler code here

UpdateData(TRUE);
HWND hWnd = GetSafeHwnd();
CFoldersDialog objFD;

CString s1;
m_Enter_Location.GetWindowText(s1);
objFD.BrowseFolder(hWnd,s1);

m_Enter_Location.SetWindowText(szDir);

UpdateData(FALSE);
}



void CCreateDlg::OnOk()
{
// TODO: Add your control notification handler code here

int iResults; // This variable will capture the button selection

// Ask the user

iResults = MessageBox("Would u like to add documetns to the index now",
"Desktop Search",MB_YESNO | MB_ICONQUESTION);

// Determine which button the user clicked
// Give the user a message showing which button was clicked

switch (iResults)
{
case IDYES: // The Yes button?
//call the Update dialog window if user press yes
m_dUpdateDlg.DoModal ();

break;
case IDNO: // The No button?

OnOK();
break;
}


}

void CCreateDlg::OnCancel()
{
// TODO: Add your control notification handler code here
OnOK();
}

BOOL CCreateDlg::OnInitDialog()
{


CDialog::OnInitDialog();

// TODO: Add extra initialization here

// m_Enter_Location = "C:\\DesktopSearch\\Index\\";
UpdateData(FALSE);

CButton *pButton = (CButton*)this->GetDlgItem(IDC_OK);
pButton->EnableWindow(FALSE);
GotoDlgCtrl(GetDlgItem(IDC_OK));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}


void CCreateDlg::OnChangeEnterName()
{

CButton *pButton = (CButton*)this->GetDlgItem(IDC_OK);
pButton->EnableWindow(TRUE);

CString m_Test1;
CString m_Test2;

//ERROR!!! IT SAYS CREATE CANNOT HAVE 4 PARAMETERS

//m_ok.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,100,23),this,1);
// m_Enter_Location.Create(WS_CHILD|WS_VISIBLE,CRect(0,50,100,23),this,1);

m_Test1="C:\\DesktopSearch\\Index\\";
m_ok.SetWindowText(m_Test1);

m_ok.GetWindowText(m_Test2);
m_Enter_Location.SetWindowText(m_Test2);


}

for create it says create function cant have 4 parameters.

and to solve browsefolder problem i assigned a cstring object and passed it to browsefolder function(pls check the code)
during compilation it works fine. when i run it says "DEBUG ASSERTION FAILED"
what is wrong with my logic.pls check the code and let me know.


Thanks
GeneralRe: edit control in vc++ Pin
sudeep_br12-Apr-06 21:47
sudeep_br12-Apr-06 21:47 
AnswerRe: edit control in vc++ Pin
Iain Clarke, Warrior Programmer10-Apr-06 5:58
Iain Clarke, Warrior Programmer10-Apr-06 5:58 
QuestionHow to disable the system speaker control Pin
ashwath200510-Apr-06 4:52
ashwath200510-Apr-06 4:52 
AnswerRe: How to disable the system speaker control Pin
ashwath200510-Apr-06 4:55
ashwath200510-Apr-06 4:55 
QuestionRe: How to disable the system speaker control Pin
David Crow10-Apr-06 5:56
David Crow10-Apr-06 5:56 
AnswerRe: How to disable the system speaker control Pin
ashwath200510-Apr-06 6:05
ashwath200510-Apr-06 6:05 
GeneralRe: How to disable the system speaker control Pin
David Crow10-Apr-06 7:25
David Crow10-Apr-06 7:25 
GeneralRe: How to disable the system speaker control Pin
ashwath200510-Apr-06 19:46
ashwath200510-Apr-06 19:46 
QuestionRe: How to disable the system speaker control Pin
David Crow11-Apr-06 2:49
David Crow11-Apr-06 2:49 
AnswerRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 3:57
ashwath200511-Apr-06 3:57 
GeneralRe: How to disable the system speaker control Pin
David Crow11-Apr-06 4:13
David Crow11-Apr-06 4:13 
GeneralRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 4:21
ashwath200511-Apr-06 4:21 
GeneralRe: How to disable the system speaker control Pin
David Crow11-Apr-06 4:58
David Crow11-Apr-06 4:58 
GeneralRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 5:08
ashwath200511-Apr-06 5:08 
GeneralRe: How to disable the system speaker control Pin
David Crow11-Apr-06 5:13
David Crow11-Apr-06 5:13 
GeneralRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 5:18
ashwath200511-Apr-06 5:18 
GeneralRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 5:27
ashwath200511-Apr-06 5:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.