Click here to Skip to main content
15,909,039 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: 3D window update call injection Pin
Fabricio Miranda10-Apr-08 2:11
Fabricio Miranda10-Apr-08 2:11 
QuestionLatest version of VC++ & SDK to target Windows 98 and above ? Pin
Defenestration9-Apr-08 13:56
Defenestration9-Apr-08 13:56 
GeneralAudio Signal Processing using Directshow(ISampleGrabber) Pin
Akin Ocal9-Apr-08 12:08
Akin Ocal9-Apr-08 12:08 
GeneralRe: Audio Signal Processing using Directshow(ISampleGrabber) Pin
Mark Salsbery9-Apr-08 12:40
Mark Salsbery9-Apr-08 12:40 
GeneralRe: Audio Signal Processing using Directshow(ISampleGrabber) Pin
Mark Salsbery9-Apr-08 12:56
Mark Salsbery9-Apr-08 12:56 
GeneralRe: Audio Signal Processing using Directshow(ISampleGrabber) Pin
Akin Ocal9-Apr-08 12:58
Akin Ocal9-Apr-08 12:58 
GeneralRe: Audio Signal Processing using Directshow(ISampleGrabber) Pin
Akin Ocal12-Apr-08 11:15
Akin Ocal12-Apr-08 11:15 
GeneralPassing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck9-Apr-08 9:28
CrocodileBuck9-Apr-08 9:28 
Hi together,

i coded a project (SDI) with an editbox in the toolbar.
By pressing enter the value in the edit will be shown in a msgbox(with a lot of help of Mr. Salesbery Wink | ;) ).

In my project the document will hande the datas an the view will show them !

Now i have to pass the value in the editbox to the view.cpp in order to show them !

But this won't work Cry | :((

Here are some codes;

// MyEdit.h
#pragma once

class CMyEdit : public CEdit
{   
	public:
		CMyEdit();
		~CMyEdit();

		 BOOL PreTranslateMessage(MSG* pMsg);

		 CString m_MyEditAusgabe;

	protected:
		DECLARE_MESSAGE_MAP()
};

 


 // MyEdit.cpp


#include "stdafx.h"
#include "MyEdit.h"

#include "Test.h"
#include "NEW_cLoadFile.h"

CMyEdit::CMyEdit()
{
}

CMyEdit::~CMyEdit()
{
}

BEGIN_MESSAGE_MAP(CMyEdit, CEdit)
END_MESSAGE_MAP()

BOOL CMyEdit::PreTranslateMessage(MSG* pMsg)
{
	NEW_cLoadFile mlf;
	cTest test;
	
    if (pMsg->message == WM_KEYDOWN && VK_RETURN == pMsg->wParam) 
    {
        return TRUE;
    }
    else if (pMsg->message == WM_KEYUP && VK_RETURN == pMsg->wParam) 
    {
		CString cstrNumber;
		GetWindowText(cstrNumber);

        test.testFunktion(cstrNumber);


        return TRUE;
    }
	
    return CEdit::PreTranslateMessage(pMsg);
}




The view.cpp:

 
#include "stdafx.h"
#include "NonButton Ctrl in ToolBar 1.h"

#include "MyEdit.h"

#include "NonButton Ctrl in ToolBar 1Doc.h"
#include "NonButton Ctrl in ToolBar 1View.h"


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

IMPLEMENT_DYNCREATE(CNonButtonCtrlinToolBar1View, CView)

BEGIN_MESSAGE_MAP(CNonButtonCtrlinToolBar1View, CView)
	//{{AFX_MSG_MAP(CNonButtonCtrlinToolBar1View)
	//}}AFX_MSG_MAP
	// Standard-Druckbefehle
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

CNonButtonCtrlinToolBar1View::CNonButtonCtrlinToolBar1View()
{
}

CNonButtonCtrlinToolBar1View::~CNonButtonCtrlinToolBar1View()
{
}

BOOL CNonButtonCtrlinToolBar1View::PreCreateWindow(CREATESTRUCT& cs)
{
	return CView::PreCreateWindow(cs);
}


void CNonButtonCtrlinToolBar1View::OnDraw(CDC* pDC)
{
	CNonButtonCtrlinToolBar1Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
}


BOOL CNonButtonCtrlinToolBar1View::OnPreparePrinting(CPrintInfo* pInfo)
{
	return DoPreparePrinting(pInfo);
}

void CNonButtonCtrlinToolBar1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
}

void CNonButtonCtrlinToolBar1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
}


#ifdef _DEBUG
void CNonButtonCtrlinToolBar1View::AssertValid() const
{
	CView::AssertValid();
}

void CNonButtonCtrlinToolBar1View::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CNonButtonCtrlinToolBar1Doc* CNonButtonCtrlinToolBar1View::GetDocument() 
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CNonButtonCtrlinToolBar1Doc)));
	return (CNonButtonCtrlinToolBar1Doc*)m_pDocument;
}
#endif //_DEBUG

void CNonButtonCtrlinToolBar1View::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 
{
}


If you need more i attached a small codesnippet !

http://www.filehosting.at/files/download.php?file=611b6c1fd8ef7b65080cbd12624d1421

I really hope you can help me Wink | ;)
Many thanx fo yor help Wink | ;)
Best regards
Croc
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
Mark Salsbery9-Apr-08 9:41
Mark Salsbery9-Apr-08 9:41 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck9-Apr-08 9:55
CrocodileBuck9-Apr-08 9:55 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck9-Apr-08 10:21
CrocodileBuck9-Apr-08 10:21 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck9-Apr-08 22:47
CrocodileBuck9-Apr-08 22:47 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck10-Apr-08 3:34
CrocodileBuck10-Apr-08 3:34 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
Nelek10-Apr-08 4:49
protectorNelek10-Apr-08 4:49 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
Mark Salsbery10-Apr-08 6:11
Mark Salsbery10-Apr-08 6:11 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck10-Apr-08 23:29
CrocodileBuck10-Apr-08 23:29 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck11-Apr-08 0:04
CrocodileBuck11-Apr-08 0:04 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
Mark Salsbery12-Apr-08 5:58
Mark Salsbery12-Apr-08 5:58 
GeneralDLL Thread_attach Pin
ForNow9-Apr-08 6:46
ForNow9-Apr-08 6:46 
GeneralRe: DLL Thread_attach Pin
CPallini9-Apr-08 7:55
mveCPallini9-Apr-08 7:55 
GeneralRe: DLL Thread_attach Pin
ForNow9-Apr-08 12:46
ForNow9-Apr-08 12:46 
GeneralRe: DLL Thread_attach Pin
Mark Salsbery9-Apr-08 12:58
Mark Salsbery9-Apr-08 12:58 
GeneralRe: DLL Thread_attach Pin
ForNow9-Apr-08 13:09
ForNow9-Apr-08 13:09 
GeneralRe: DLL Thread_attach Pin
Mark Salsbery9-Apr-08 13:11
Mark Salsbery9-Apr-08 13:11 
GeneralRe: DLL Thread_attach Pin
ForNow9-Apr-08 13:15
ForNow9-Apr-08 13:15 

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.