|
Hi,
Can u pls suggest me any book to start with for MFC in VS2003 and even im new to vc++..
|
|
|
|
|
Hi,
Programming Windows with MFC[^] is a great book, written by Jeff Prosise.
Legend says that one starts with Programming Windows with C++ and work your way up through frameworks and libraries. If you'd like to pursue that path, you could start with Programming Windows[^] by Charles Petzold.
Of course, you would be expected to be able to do C/C++ programming well before you touch any of these.
Happy learning.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I learnt from an earlier version of this one[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
The name (Programming with Microsoft Visual C++ .NET) of this version looks like it would explain managed stuff too.
I'm not against managed code, but I don't like the idea of mixing up managed code with good old native C++. It's like eating garlic with ice cream.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Good one!
Welcome again int CP's Memorable Quotes list [^] (what a day! Yours is the second entry, so far...).
BTW:Rajesh R Subramanian wrote: Of course, you would be expected to be able to do C/C++ programming well before you touch any of these.
is a great one too...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I ain't sure if I can keep up to the heat.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
That was actually the name of the product - remember it used to be Visual Studio .NET rather than just plain Visual Studio? 5 out of the 35 chapters cover .NET - the rest are plain Visual C++ and MFC (I know because it's on Safari & I can see it ).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Yes, that was very much what I was talking about. They can please publish another book to explain all the C++/CLI stuff instead of dedicating 5 chapters to show how .NET "fits in". But I see this is happening with a lot of books these days.
I can't wait for X86 .NET.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
How do give ( pass, transmit) value of variable
m_sPP_modal
From class modal window “CAdodc_MDI”
To variable
m_sPP_modeless
of modeless class “CMyModeless2”
and on the contrary - from class “CMyModeless2”
to class modal window “CAdodc_MDI ?
below 2 lines isn’t correctly into button ‘OK’ of modal window:
CMyModeless2 dlg2;
dlg2.m_sPP_modeless = L“text”;
below brief:
/////////////////////////////////////////
// Adodc_MDI.cpp : implementation file
#include "stdafx.h"
#include "ADO_MDI.h"
#include "Adodc_MDI.h"
#include "MyModeless2.h"
class CAdodc_MDI : public CDialog
{
CString m_sPP_modal = _T("text in Modal window");
}
//////////////////////////////////////
MyModeless2.cpp : implementation file
#define WM_GOODBYE WM_USER + 100
class CMyModeless2 : public CDialog
{
CString m_sPP_modeless = _T("text in Modeless window");
}
//////////////////////////////////////
// ADO_MDIView.cpp : implementation of the CADO_MDIView class
//
#include "stdafx.h"
#include "ADO_MDI.h"
#include "ADO_MDIDoc.h"
#include "CntrItem.h"
#include "ADO_MDIView.h"
#include "MyModeless2.h"
#include "Adodc_MDI.h"
LRESULT CADO_MDIView::OnGoodbye(WPARAM wParam, LPARAM lParam)
{ }
void CADO_MDIView::OnLButtonDown(UINT nFlags, CPoint point)
{ }
void CADO_MDIView::OnRButtonDown(UINT nFlags, CPoint point)
{ }
///////////////////////////////////////////////
///////////////////////////////////////////////
Below MORE DETAIL:
"MyModeless2.h"
#pragma once
#include "afxwin.h"
// CMyModeless2 dialog
#define WM_GOODBYE WM_USER + 100
class CMyModeless2 : public CDialog
{
DECLARE_DYNAMIC(CMyModeless2)
public:
CMyModeless2(CWnd* pParent = NULL); // standard constructor
virtual ~CMyModeless2();
// Dialog Data
enum { IDD = IDD_DIALOG4 };
CString m_sPP_modeless;
CView* m_pView;
CMyModeless2(CView* pView);
afx_msg void OnBnClickedButton3();
BOOL Create(void);
protected:
virtual void OnOK();
virtual void OnCancel();
public:
afx_msg void OnBnClickedOk();
afx_msg void OnBnClickedCancel();
};
/////////////////////////////////////
MyModeless2.cpp
#include "stdafx.h"
#include "ADO_MDI.h"
#include "MyModeless2.h"
// CMyModeless2 dialog
IMPLEMENT_DYNAMIC(CMyModeless2, CDialog)
CMyModeless2::CMyModeless2(CWnd* pParent /*=NULL*/)
: CDialog(CMyModeless2::IDD, pParent)
, m_sPP_modeless(_T(""))
void CMyModeless2::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT3, m_sPP_modeless);
}
BEGIN_MESSAGE_MAP(CMyModeless2, CDialog)
ON_BN_CLICKED(IDC_BUTTON1, &CMyModeless2::OnBnClickedButton1)
ON_BN_CLICKED(IDC_BUTTON2, &CMyModeless2::OnBnClickedButton2)
ON_BN_CLICKED(IDC_BUTTON3, &CMyModeless2::OnBnClickedButton3)
ON_BN_CLICKED(IDOK, &CMyModeless2::OnBnClickedOk)
ON_BN_CLICKED(IDCANCEL, &CMyModeless2::OnBnClickedCancel)
END_MESSAGE_MAP()
CMyModeless2::CMyModeless2(CView* pView)
{
m_pView = pView;
}
BOOL CMyModeless2::Create(void)
{
return CDialog::Create(CMyModeless2::IDD);
}
void CMyModeless2::OnOK()
{
if (m_pView != NULL) {
m_pView->PostMessage(WM_GOODBYE, IDOK);
}
else {
CDialog::OnOK(); // modal case
}
CDialog::OnOK();
}
void CMyModeless2::OnCancel()
{
if (m_pView != NULL) {
// modeless case -- do not call base class OnCancel
m_pView->PostMessage(WM_GOODBYE, IDCANCEL);
}
else {
CDialog::OnCancel(); // modal case
}
}
void CMyModeless2::OnBnClickedOk()
{
OnOK();
}
void CMyModeless2::OnBnClickedCancel()
{
OnCancel();
}
///////////////////////////////////////////
ADO_MDIView.h
// ADO_MDIView.h : interface of the CADO_MDIView class
#pragma once
class CMyModeless2;
class CADO_MDIView : public CScrollView
{
protected: // create from serialization only
CADO_MDIView();
DECLARE_DYNCREATE(CADO_MDIView)
// Attributes
public:
CADO_MDIDoc* GetDocument() const;
// Overrides
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual void OnInitialUpdate(); // called first time after construct
// Implementation
public:
virtual ~CADO_MDIView();
protected:
// Generated message map functions
protected:
afx_msg void OnDestroy();
DECLARE_MESSAGE_MAP()
public:
CMyModeless2* m_pModeless;
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
LRESULT OnGoodbye(WPARAM wParam, LPARAM lParam);
};
//////////////////////////////////////////////
// ADO_MDIView.cpp : implementation of the CADO_MDIView class
#include "stdafx.h"
#include "ADO_MDI.h"
#include "ADO_MDIDoc.h"
#include "CntrItem.h"
#include "ADO_MDIView.h"
#include "MyModeless2.h"
#include "Adodc_MDI.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CADO_MDIView
IMPLEMENT_DYNCREATE(CADO_MDIView, CScrollView)
BEGIN_MESSAGE_MAP(CADO_MDIView, CScrollView)
ON_MESSAGE(WM_GOODBYE, OnGoodbye)
ON_WM_DESTROY()
ON_WM_LBUTTONDOWN()
ON_WM_RBUTTONDOWN()
END_MESSAGE_MAP()
// CADO_MDIView construction/destruction
CADO_MDIView::CADO_MDIView()
: m_pModeless(NULL)
, m_sReceivingFromModeless1(_T(""))
{
m_pModeless = new CMyModeless2(this);
}
CADO_MDIView::~CADO_MDIView()
{
delete m_pModeless;
}
void CADO_MDIView::OnDestroy()
{
// Deactivate the item on destruction; this is important
// when a splitter view is being used
COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
if (pActiveItem != NULL && pActiveItem->GetActiveView() == this)
{
pActiveItem->Deactivate();
ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
}
CScrollView::OnDestroy();
}
void CADO_MDIView::OnLButtonDown(UINT nFlags, CPoint point)
{
if (m_pModeless->GetSafeHwnd() == 0)
{
m_pModeless->Create();
}
}
void CADO_MDIView::OnRButtonDown(UINT nFlags, CPoint point)
{
m_pModeless ->DestroyWindow();
}
LRESULT CADO_MDIView::OnGoodbye(WPARAM wParam, LPARAM lParam)
{
m_pModeless->m_sPP_modeless;
m_pModeless->DestroyWindow();
return 0L;
}
/////////////////////////////////////////////
Adodc_MDI.h
#pragma once
#include "afxcmn.h"
class CAdodc_MDI : public CDialog
{
DECLARE_DYNAMIC(CAdodc_MDI)
public:
CAdodc_MDI(CWnd* pParent = NULL); // standard constructor
virtual ~CAdodc_MDI();
enum { IDD = IDD_ADODC };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnInitDialog();
CListCtrl* m_pListCtrl;
_ConnectionPtr m_pConn2;
CString m_sPP;
afx_msg void OnHdnItemclickList1(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnNMClickList1(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnBnClickedOk();
int col;
int row;
private:
};
////////////////////////////////////////
|
|
|
|
|
Please read the posting guidelines. I don't think anybody will want to read all your source code.
As far as I understood, you want to pass a variable from one dialog to another one. Is that correct ? If yes, then take a look at this article[^]
|
|
|
|
|
See, for instance, this article [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You could pass the value in the constructor:
CMyModeless2::CMyModeless2(CView* pView, CString sPP)
{
m_sPP_modeless = sPP;
m_pView = pView;
}
|
|
|
|
|
I am in the middle of porting one of my C++ project which is using old iostream (shipped with VC6.0) into new iostream implemented in stlport version 5.2
I found that some of the stream related methods are not available in the new iostream class.
The compiler gives me error for the following methods
streambuf::allocate()
streambuf::doallocate()
streambuf::blen()
ostream::osfx()
ostream::opfx()
streambuf::base()
streambuf::ebuf()
streambuf::setb()
Am I missing something?
Are there any equivalent methods available in new iostream library?
How can I substitute these functions when I port into new stlport/VS2008 iostream?
Thanks in advance
cheers
Varghese Paul
|
|
|
|
|
Varghese Paul M wrote: streambuf::allocate()
streambuf::doallocate()
streambuf::blen()
streambuf::base()
streambuf::ebuf()
streambuf::setb()
These all refer to the 'reserve area' of the pre-standard IOStreams streambuf. The standard basic_streambuf doesn't have this concept at all (I guess they decided it was better for that concept not to exist in an abstract stream buffer). This post[^], however, gives a suggestion for a possible solution.
Varghese Paul M wrote: ostream::osfx()
ostream::opfx()
These were functions that ran before (opfx) and after (osfx) every output operation. They've been replaced by the sentry nested class, so rather than this:
if (os.opfx()) { os.do_something(); }
os.osfx();
you have this
std::ostream::sentry se(os);
if (se) { os.do_something(); }
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi all,
i m working on Windows based mobile,here ActiveSync or Mobile device center is necessary.
How can i check ActiveSync or Mobile device centre installed on PC?
please help me for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
I needing program for fax modem. please guide for me. thanks very much
|
|
|
|
|
Would you like cheese with that?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
May I ask for pizza & beer, sir? Plz, plz, urgentz...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
i need code process for this problem
|
|
|
|
|
Well I badly need a new car!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
nguyen phan wrote: i need code process for this problem
This place is not a wishing well.
Please read the guidelines[^] before you can post further queries here.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Try TAPI.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
May i know how can i check my previous posts and replies...
|
|
|
|
|
Click on your user name and then Messages posted.
|
|
|
|
|
GOTO ( ) your Member Profile page [^] and then click on Message Posted link, it will open this page [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|