Click here to Skip to main content
15,894,343 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: HELP, in both senses Pin
santhoshv8414-Dec-07 21:07
santhoshv8414-Dec-07 21:07 
GeneralRe: HELP, in both senses Pin
Mark Salsbery15-Dec-07 8:20
Mark Salsbery15-Dec-07 8:20 
QuestionDisplay file details Pin
GPat2414-Dec-07 11:36
GPat2414-Dec-07 11:36 
GeneralRe: Display file details [modified] Pin
Mark Salsbery14-Dec-07 11:58
Mark Salsbery14-Dec-07 11:58 
GeneralRe: Display file details Pin
Hamid_RT14-Dec-07 21:20
Hamid_RT14-Dec-07 21:20 
QuestionRe: Display file details Pin
GPat2415-Dec-07 23:49
GPat2415-Dec-07 23:49 
QuestionRestricting security in web browser control Pin
drummer14-Dec-07 11:35
drummer14-Dec-07 11:35 
QuestionUnable to load dll on computers which do not have Visual Studio installed Pin
Member 408492814-Dec-07 9:46
Member 408492814-Dec-07 9:46 
GeneralRe: Unable to load dll on computers which do not have Visual Studio installed Pin
Mark Salsbery14-Dec-07 10:05
Mark Salsbery14-Dec-07 10:05 
GeneralCryptoAPI: Send a challenge to a smart card Pin
Nyarlatotep14-Dec-07 5:28
Nyarlatotep14-Dec-07 5:28 
GeneralOff-topic Pin
CPallini14-Dec-07 6:30
mveCPallini14-Dec-07 6:30 
GeneralRe: CryptoAPI: Send a challenge to a smart card Pin
Mark Salsbery14-Dec-07 8:59
Mark Salsbery14-Dec-07 8:59 
GeneralRe: CryptoAPI: Send a challenge to a smart card Pin
Nyarlatotep14-Dec-07 9:27
Nyarlatotep14-Dec-07 9:27 
GeneralCompression algorithms using MMX extensions Pin
Member 208814-Dec-07 3:07
Member 208814-Dec-07 3:07 
GeneralRe: Compression algorithms using MMX extensions Pin
Randor 14-Dec-07 3:36
professional Randor 14-Dec-07 3:36 
GeneralRe: Compression algorithms using MMX extensions Pin
Mike Dimmick15-Dec-07 8:13
Mike Dimmick15-Dec-07 8:13 
Generalfilling an EditBox (which is embedded) in a toolbar by clicking a ToolBarButton ! Pin
CrocodileBuck14-Dec-07 2:13
CrocodileBuck14-Dec-07 2:13 
GeneralRe: filling an EditBox (which is embedded) in a toolbar by clicking a ToolBarButton ! Pin
Nelek14-Dec-07 2:54
protectorNelek14-Dec-07 2:54 
GeneralRe: filling an EditBox (which is embedded) in a toolbar by clicking a ToolBarButton ! Pin
CrocodileBuck14-Dec-07 2:59
CrocodileBuck14-Dec-07 2:59 
GeneralRe: filling an EditBox (which is embedded) in a toolbar by clicking a ToolBarButton ! Pin
David Crow14-Dec-07 3:20
David Crow14-Dec-07 3:20 
GeneralRe: filling an EditBox (which is embedded) in a toolbar by clicking a ToolBarButton ! Pin
CrocodileBuck14-Dec-07 3:44
CrocodileBuck14-Dec-07 3:44 
O.K. I cleaned up the code, i hope i haven't deleted too much !
I tried to send as much info as it is possible sorry !

Is it better now ???

In The Doc.cpp:
<br />
void CEditCtrlDoc::OnFill() <br />
{<br />
((CMainFrame*)GetParent())->SetMyToolBarEditText("blabla");<br />
}<br />



In the Doc.h:
<br />
<br />
<br />
public:<br />
//*********************************************************************************************************************** <br />
BOOL m_bFill;<br />
//*********************************************************************************************************************** <br />
public:<br />
<br />
//*********************************************************************************************************************** <br />
CString m_TestFlag;<br />
//*********************************************************************************************************************** <br />
protected:<br />
//{{AFX_MSG(CEditCtrlDoc)<br />
afx_msg void OnUpdateFill(CCmdUI* pCmdUI);<br />
afx_msg void OnFill();<br />
//}}AFX_MSG<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
<br />




Inthe TlBar (the new toolbarclass):
<br />
#include "stdafx.h"<br />
#include "EditCtrl.h"<br />
#include "TlBar.h"<br />
<br />
<br />
#define EDITLEN 80 <br />
#define EDITPOS 3 <br />
<br />
// CTlBar<br />
<br />
CTlBar::CTlBar()<br />
{<br />
m_TestString = "default !!!";<br />
}<br />
<br />
CTlBar::~CTlBar()<br />
{<br />
}<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CTlBar, CToolBar)<br />
//{{AFX_MSG_MAP(CTlBar)<br />
//}}AFX_MSG_MAP<br />
ON_CBN_EDITUPDATE (ID_nEDIT, OnUpdateEdit)<br />
ON_CBN_EDITCHANGE (ID_nEDIT, OnChangeEdit)<br />
END_MESSAGE_MAP()<br />
<br />
<br />
BOOL CTlBar::LoadToolBarEx (UINT id)<br />
{<br />
bool bReturn;<br />
bReturn = CTlBar::LoadToolBar (id);<br />
<br />
int iPosition = CommandToIndex (ID_nEDIT);<br />
<br />
SetButtonInfo (iPosition,ID_nEDIT,TBBS_SEPARATOR,EDITLEN);<br />
<br />
<br />
CRect rect;<br />
GetItemRect (iPosition, &rect);<br />
rect.bottom = 20;<br />
<br />
DWORD dwStyle = WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL;<br />
m_Ctrl_EDIT.CreateEx(WS_EX_CLIENTEDGE,_T("EDIT"),NULL, dwStyle, rect, this, ID_nEDIT);<br />
<br />
m_Ctrl_EDIT.SetWindowText (m_TestString);<br />
<br />
return bReturn;<br />
}<br />
<br />
void CTlBar::OnUpdateEdit ()<br />
{<br />
AfxMessageBox ("Funktion OnUpdateEdit !!!",MB_OK);<br />
}<br />
<br />
void CTlBar::OnChangeEdit()<br />
{<br />
AfxMessageBox ("Funktion OnChangeEdit !!!",MB_OK);<br />
}<br />



In teh TlBar.h:
<br />
<br />
class CTlBar : public CToolBar<br />
{<br />
<br />
public:<br />
CTlBar();<br />
<br />
//*********************************************************************************************************************** <br />
BOOL LoadToolBarEx (UINT id);<br />
//***********************************************************************************************************************<br />
public:<br />
virtual ~CTlBar();<br />
//***********************************************************************************************************************<br />
afx_msg void OnUpdateEdit();<br />
afx_msg void OnChangeEdit();<br />
DECLARE_MESSAGE_MAP()<br />
//*********************************************************************************************************************** public:<br />
CEdit m_Ctrl_EDIT;<br />
CString m_TestString;<br />
//*********************************************************************************************************************** };<br />

GeneralRe: filling an EditBox (which is embedded) in a toolbar by clicking a ToolBarButton ! Pin
CrocodileBuck14-Dec-07 3:47
CrocodileBuck14-Dec-07 3:47 
QuestionRe: filling an EditBox (which is embedded) in a toolbar by clicking a ToolBarButton ! Pin
David Crow14-Dec-07 4:29
David Crow14-Dec-07 4:29 
GeneralRe: filling an EditBox (which is embedded) in a toolbar by clicking a ToolBarButton ! Pin
CrocodileBuck14-Dec-07 4:45
CrocodileBuck14-Dec-07 4:45 
GeneralRe: filling an EditBox (which is embedded) in a toolbar by clicking a ToolBarButton ! Pin
David Crow14-Dec-07 5:29
David Crow14-Dec-07 5:29 

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.