Click here to Skip to main content
16,007,779 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Combo box help Pin
Mark Salsbery1-Dec-06 12:42
Mark Salsbery1-Dec-06 12:42 
GeneralRe: Combo box help Pin
Mark Salsbery1-Dec-06 12:43
Mark Salsbery1-Dec-06 12:43 
GeneralRe: Combo box help Pin
celllllllll1-Dec-06 12:57
celllllllll1-Dec-06 12:57 
GeneralRe: Combo box help Pin
celllllllll1-Dec-06 13:21
celllllllll1-Dec-06 13:21 
GeneralRe: Combo box help Pin
Mark Salsbery1-Dec-06 13:28
Mark Salsbery1-Dec-06 13:28 
GeneralRe: Combo box help Pin
celllllllll1-Dec-06 13:35
celllllllll1-Dec-06 13:35 
GeneralRe: Combo box help Pin
Mark Salsbery1-Dec-06 14:08
Mark Salsbery1-Dec-06 14:08 
QuestionPointer to RichEditCtrl [modified] Pin
Makakuin1-Dec-06 10:20
Makakuin1-Dec-06 10:20 
I`m trying to write SDI MFC application with view class CRichEditCtrl. In my CMyAppView I used GetRichEditCtrl() to access the main RichEditCtrl. Now I want to create an independent class to write to RichEditCtrl lets call it CTextEditor.
What I don`t understand is how to tell the class to find CRichEditCtrl as I`m not able to use GetRichEditCtrl() outside the CMyApp class. I`ve tried to do something like:

<br />
int CTextEditor::WriteText(CRichEditCtrl *wnd,CString str,CHARFORMAT cf)<br />
{<br />
	int nOldLines = 0, nNewLines = 0, nScroll = 0;<br />
	long nInsertionPoint = 0;<br />
	nOldLines = wnd->GetLineCount();<br />
	nInsertionPoint = wnd->GetWindowTextLength();<br />
	wnd->SetSel(nInsertionPoint, -1);<br />
	wnd->SetSelectionCharFormat(cf);<br />
	wnd->ReplaceSel(str);<br />
	nNewLines = wnd->GetLineCount();<br />
	nScroll = nNewLines - nOldLines;<br />
	wnd->LineScroll(nScroll);<br />
        return 0;<br />
} <br />


And then call it from CMyapView like this:
<br />
CHARFORMAT cf;<br />
cf.dwEffects = CFE_BOLD;<br />
cf.dwMask = CFM_BOLD;<br />
cf.cbSize = sizeof(CHARFORMAT);<br />
CTextEditor editor;<br />
editor.WriteText(&GetRichEditCtrl(),"Mytext",cf); <br />

But I get the unresolved externals error..
What am I doing wrong?
Please help - no clue bout how to use pointers...
QuestionRe: Pointer to RichEditCtrl Pin
prasad_som1-Dec-06 17:03
prasad_som1-Dec-06 17:03 
AnswerRe: Pointer to RichEditCtrl Pin
Makakuin1-Dec-06 21:24
Makakuin1-Dec-06 21:24 
AnswerRe: Pointer to RichEditCtrl Pin
prasad_som3-Dec-06 17:58
prasad_som3-Dec-06 17:58 
QuestionApp without UI Pin
HakunaMatada1-Dec-06 7:33
HakunaMatada1-Dec-06 7:33 
AnswerRe: App without UI Pin
Mark Salsbery1-Dec-06 7:36
Mark Salsbery1-Dec-06 7:36 
GeneralRe: App without UI Pin
HakunaMatada1-Dec-06 17:08
HakunaMatada1-Dec-06 17:08 
GeneralRe: App without UI Pin
Mark Salsbery1-Dec-06 17:57
Mark Salsbery1-Dec-06 17:57 
GeneralRe: App without UI Pin
HakunaMatada1-Dec-06 19:17
HakunaMatada1-Dec-06 19:17 
GeneralRe: App without UI Pin
Mark Salsbery2-Dec-06 5:38
Mark Salsbery2-Dec-06 5:38 
AnswerRe: App without UI Pin
Chris Meech1-Dec-06 7:54
Chris Meech1-Dec-06 7:54 
AnswerRe: App without UI Pin
Sceptic Mole1-Dec-06 8:48
Sceptic Mole1-Dec-06 8:48 
QuestionWin32_PingStatus Pin
abhiramsss1-Dec-06 7:15
abhiramsss1-Dec-06 7:15 
AnswerRe: Win32_PingStatus Pin
led mike1-Dec-06 7:42
led mike1-Dec-06 7:42 
QuestionOverlay Windows Pin
barrem1-Dec-06 6:33
barrem1-Dec-06 6:33 
AnswerRe: Overlay Windows Pin
led mike1-Dec-06 6:45
led mike1-Dec-06 6:45 
AnswerRe: Overlay Windows Pin
Mark Salsbery1-Dec-06 6:57
Mark Salsbery1-Dec-06 6:57 
QuestionExporting Constants in a DLL Pin
risingtechie1-Dec-06 6:01
risingtechie1-Dec-06 6:01 

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.