Click here to Skip to main content
15,896,444 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A method to collapse code in the IDE Pin
BlackDice26-Oct-04 10:03
BlackDice26-Oct-04 10:03 
GeneralMenu on CFormView Derived Pin
aman200626-Oct-04 6:27
aman200626-Oct-04 6:27 
GeneralKnowing resource ID Pin
0v3rloader26-Oct-04 6:02
0v3rloader26-Oct-04 6:02 
Generallong compile time ... vs.net 2003 ... Pin
Maximilien26-Oct-04 5:57
Maximilien26-Oct-04 5:57 
GeneralRe: long compile time ... vs.net 2003 ... Pin
Blake Miller26-Oct-04 6:02
Blake Miller26-Oct-04 6:02 
Questionwhere am i mistaking here? Pin
Natural_Demon26-Oct-04 5:35
Natural_Demon26-Oct-04 5:35 
AnswerRe: where am i mistaking here? Pin
Blake Miller26-Oct-04 6:09
Blake Miller26-Oct-04 6:09 
GeneralRe: where am i mistaking here? Pin
Natural_Demon26-Oct-04 8:23
Natural_Demon26-Oct-04 8:23 
this is what i got and all those intents u see in code don't work

thank for your time and kind regards,

marco



// firstw32mfcDlg.h : header file
//

#pragma once


// Cfirstw32mfcDlg dialog
class Cfirstw32mfcDlg : public CDHtmlDialog
{
// Construction
public:
Cfirstw32mfcDlg(CWnd* pParent = NULL); // standard constructor

// Dialog Data
enum { IDD = IDD_FIRSTW32MFC_DIALOG, IDH = IDR_HTML_FIRSTW32MFC_DIALOG };
CString EDIT1;
CString EDIT2;
CString m_EDIT1;
CString m_EDIT2;
CString m_TEMP_EDIT1;
CString m_TEMP_EDIT2;

protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support

HRESULT OnButtonOK(IHTMLElement *pElement);
HRESULT OnButtonCancel(IHTMLElement *pElement);
//HRESULT OnChangeEdit1(IHTMLElement *pElement);
//HRESULT OnEnChangeEdit2(IHTMLElement *pElement);

// Implementation
protected:
HICON m_hIcon;

// Generated message map functions
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
DECLARE_DHTML_EVENT_MAP()
public:
//char m_EDIT1;
//char m_EDIT2;
//afx_msg void OnEnChangeEdit1();
//afx_msg void OnEnChangeEdit2();
};

-----------------------------------------------
// firstw32mfcDlg.cpp : implementation file
//

#include "stdafx.h"
#include "firstw32mfc.h"
#include "firstw32mfcDlg.h"
#include ".\firstw32mfcdlg.h"
//#include <atlbase.h>
//#include <afxpriv.h>
#include <oleauto.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
CAboutDlg();

// Dialog Data
enum { IDD = IDD_ABOUTBOX };

protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support

// Implementation
protected:
DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()


// Cfirstw32mfcDlg dialog

BEGIN_DHTML_EVENT_MAP(Cfirstw32mfcDlg)
DHTML_EVENT_ONCLICK(_T("ButtonOK"), OnButtonOK)
DHTML_EVENT_ONCLICK(_T("ButtonCancel"), OnButtonCancel)
//DHTML_EVENT_ONCHANGE(_T("email"), OnChangeEdit1 )
//DHTML_EVENT_ONCHANGE(_T("password"), OnEnChangeEdit2 )
END_DHTML_EVENT_MAP()


Cfirstw32mfcDlg::Cfirstw32mfcDlg(CWnd* pParent /*=NULL*/)
: CDHtmlDialog(Cfirstw32mfcDlg::IDD, Cfirstw32mfcDlg::IDH, pParent)
//, m_EDIT1(0)
//, m_EDIT2(0)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void Cfirstw32mfcDlg::DoDataExchange(CDataExchange* pDX)
{
CDHtmlDialog::DoDataExchange(pDX);
DDX_DHtml_ElementInnerText(pDX, _T("email"), EDIT1);
DDX_DHtml_ElementInnerText(pDX, _T("password"), EDIT2);
DDX_DHtml_ElementInnerText(pDX, _T("Temp_Text1"), m_EDIT1);
DDX_DHtml_ElementInnerText(pDX, _T("Temp_Text2"), m_EDIT2);
}



BEGIN_MESSAGE_MAP(Cfirstw32mfcDlg, CDHtmlDialog)
ON_WM_SYSCOMMAND()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()


// Cfirstw32mfcDlg message handlers

BOOL Cfirstw32mfcDlg::OnInitDialog()
{
CDHtmlDialog::OnInitDialog();

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}

// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

EDIT1 = AfxGetApp()->GetProfileString("Settings", "email", "your login");
EDIT2 = AfxGetApp()->GetProfileString("Settings", "password", "details here..");
UpdateData(FALSE);
return FALSE; // return TRUE unless you set the focus to a control
}

void Cfirstw32mfcDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDHtmlDialog::OnSysCommand(nID, lParam);
}
}

// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.

void Cfirstw32mfcDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, reinterpret_cast<wparam>(dc.GetSafeHdc()), 0);

// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDHtmlDialog::OnPaint();
}
}

// The system calls this function to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR Cfirstw32mfcDlg::OnQueryDragIcon()
{
return static_cast<hcursor>(m_hIcon);
}


HRESULT Cfirstw32mfcDlg::OnButtonOK(IHTMLElement* /*pElement*/)
{
UpdateData(TRUE);
//CString strEmail = SysAllocString(GetElementText( _T("email")));
//CString strEmail = GetWindowText(EDIT2);
//AfxGetApp()->WriteProfileString("Settings", "email", strEmail);
/*
BSTR bstr = SysAllocString(GetElementText( _T("email")));
CStringW str = bstr;
SysFreeString(bstr);
*/
if(!GetElementText( _T("email")))
{
m_EDIT1=("FALSE");
UpdateData(FALSE);
}
else
{
m_EDIT1=("TRUE");
UpdateData(FALSE);
}
BSTR bstr = SysAllocString(GetElementText( _T("email")));
CString str = CString(bstr);
SysFreeString(bstr);
m_EDIT1=str;
UpdateData(FALSE);

CString strEmail = "email";
AfxGetApp()->WriteProfileString("Settings", "email", str);

//AfxGetApp()->WriteProfileString("Settings", "email", EDIT1);
//AfxGetApp()->WriteProfileString("Settings", "email", );
AfxGetApp()->WriteProfileString("Settings", "password", EDIT2);
//UpdateData(FALSE);
return NULL;
}

HRESULT Cfirstw32mfcDlg::OnButtonCancel(IHTMLElement* /*pElement*/)
{
UpdateData();
if(m_EDIT1)
{
AfxGetApp()->WriteProfileString("Settings", "email", m_EDIT1);
}
else
{
m_EDIT1=_T("i failed");
UpdateData();
}
if(m_EDIT2)
{
AfxGetApp()->WriteProfileString("Settings", "password", m_EDIT2);
}
else
{
m_EDIT2=_T("i failed too");
UpdateData(FALSE);
}

//UpdateData(FALSE);
return NULL;
/*
GetElementText(_T("email"));
if(GetElementText(_T("email")))
{
EDIT1=_T("works");
}
else
{
EDIT1=_T("it doesn't work");
}
AfxGetApp()->WriteProfileString("Settings", "email", EDIT1);
GetElementText(_T("password"));
AfxGetApp()->WriteProfileString("Settings", "password", EDIT2);
OnCancel();
return S_OK;
//return 0;
*/
}

//HRESULT Cfirstw32mfcDlg::OnChangeEdit1(IHTMLElement* /*pElement*/)
//{
// //UpdateData(FALSE);
// //AfxGetApp()->WriteProfileString("Settings", "email", EDIT1);
// //AfxGetApp()->WriteProfileString("Settings", "email", "gsdsgj");
//return FALSE;
//}

//HRESULT Cfirstw32mfcDlg::OnEnChangeEdit2(IHTMLElement* /*pElement*/)
//{
// //UpdateData(FALSE);
// ///AfxGetApp()->WriteProfileString("Settings", "password", EDIT2);
//return FALSE;
//}
GeneralRe: where am i mistaking here? Pin
Blake Miller27-Oct-04 4:45
Blake Miller27-Oct-04 4:45 
GeneralGet Row &amp; Column for a listCtrl Pin
sweep12326-Oct-04 4:37
sweep12326-Oct-04 4:37 
GeneralRe: Get Row &amp; Column for a listCtrl Pin
David Crow26-Oct-04 5:07
David Crow26-Oct-04 5:07 
GeneralRe: Get Row &amp; Column for a listCtrl Pin
sweep12326-Oct-04 6:23
sweep12326-Oct-04 6:23 
GeneralRe: Get Row &amp; Column for a listCtrl Pin
Rage26-Oct-04 7:10
professionalRage26-Oct-04 7:10 
GeneralRe: Get Row &amp; Column for a listCtrl Pin
Grahamfff26-Oct-04 9:38
Grahamfff26-Oct-04 9:38 
Questionhow can i have only client area of window Pin
efanHarris26-Oct-04 4:35
efanHarris26-Oct-04 4:35 
AnswerRe: how can i have only client area of window Pin
David Crow26-Oct-04 4:42
David Crow26-Oct-04 4:42 
GeneralRe: how can i have only client area of window Pin
efanHarris26-Oct-04 20:16
efanHarris26-Oct-04 20:16 
GeneralRe: how can i have only client area of window Pin
David Crow27-Oct-04 10:30
David Crow27-Oct-04 10:30 
GeneralIs there any free Modem Simulator which can tell Call States or some other way to debug Modem application with Modem Pin
Kapoor Vikrant26-Oct-04 4:28
Kapoor Vikrant26-Oct-04 4:28 
GeneralRe: Is there any free Modem Simulator which can tell Call States or some other way to debug Modem application with Modem Pin
Blake Miller26-Oct-04 6:14
Blake Miller26-Oct-04 6:14 
QuestionHow to dump information into text file which I got from _CrtDumpMemoryLeaks() ? Pin
Amarelia26-Oct-04 4:24
Amarelia26-Oct-04 4:24 
GeneralBuilding Wizards Pin
shevi202726-Oct-04 2:57
shevi202726-Oct-04 2:57 
GeneralRe: Building Wizards Pin
Blake Miller26-Oct-04 6:17
Blake Miller26-Oct-04 6:17 
GeneralFail to bind the socket Pin
amitranjanmishra26-Oct-04 1:23
amitranjanmishra26-Oct-04 1:23 
GeneralRe: Fail to bind the socket Pin
dharani26-Oct-04 21:20
dharani26-Oct-04 21:20 

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.