Click here to Skip to main content
15,887,676 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to add SelectAll in CFileDialog Pin
santhoshv8413-Dec-07 17:15
santhoshv8413-Dec-07 17:15 
GeneralRe: How to add SelectAll in CFileDialog Pin
David Crow14-Dec-07 2:55
David Crow14-Dec-07 2:55 
General"rich text file(RTF)" text extracting using CRichViewEdit Pin
CodingLover12-Dec-07 17:09
CodingLover12-Dec-07 17:09 
GeneralRe: "rich text file(RTF)" text extracting using CRichViewEdit Pin
CPallini12-Dec-07 21:37
mveCPallini12-Dec-07 21:37 
GeneralRe: "rich text file(RTF)" text extracting using CRichViewEdit Pin
CodingLover12-Dec-07 21:52
CodingLover12-Dec-07 21:52 
GeneralRe: "rich text file(RTF)" text extracting using CRichViewEdit Pin
CPallini12-Dec-07 22:01
mveCPallini12-Dec-07 22:01 
GeneralRe: "rich text file(RTF)" text extracting using CRichViewEdit Pin
CodingLover12-Dec-07 22:27
CodingLover12-Dec-07 22:27 
GeneralRe: "rich text file(RTF)" text extracting using CRichViewEdit Pin
CodingLover12-Dec-07 23:56
CodingLover12-Dec-07 23:56 
Ok, I've try it and it can be done easily in this way.

CString x;
if(m_rtfCtrl2.CreateEx( WS_EX_APPWINDOW,WS_BORDER|ES_MULTILINE,CRect(10,10,200,200), this, 1))
{
    CFile rtfFile;
    BOOL err = rtfFile.Open("G:\\Work On\\CPP\\RTFControl\\TestFile.rtf", CFile::modeReadWrite, NULL);

int iLength = rtfFile.GetLength();// Data length
char *pBuffer = new char[iLength];// Data buffer

rtfFile.Read(pBuffer, iLength);
CString rtf(pBuffer);

    m_rtfCtrl2.SetWindowText(rtf);
    m_rtfCtrl2.GetWindowText(x);
    AfxMessageBox(x);
}



This works fine. But I want to make a change here. I used this code on MFC application, on click event for simplification. So, used the same window as the main window(use 'this' pointer to refer it) in CreateEx function.

Now I want to use this on MFC supported console application. But there 'this' pointer is not allowed. How can do this change.

On CreateEx() function main window is in HWND* type. So I can't use GetConsoleWindow() as well.

Can you guys give me a clue.
I appreciate your help all the time...
Eranga Smile | :)

GeneralRe: "rich text file(RTF)" text extracting using CRichViewEdit Pin
David Crow13-Dec-07 4:48
David Crow13-Dec-07 4:48 
QuestionLooking for a suitable zip lib which can access subdirectory Pin
Peter, Chan12-Dec-07 16:40
Peter, Chan12-Dec-07 16:40 
GeneralRe: Looking for a suitable zip lib which can access subdirectory Pin
kanduripavan4-Apr-08 20:23
kanduripavan4-Apr-08 20:23 
GeneralStructure as a proc in a DLL Pin
ForNow12-Dec-07 13:33
ForNow12-Dec-07 13:33 
AnswerRe: Structure as a proc in a DLL Pin
CPallini12-Dec-07 21:45
mveCPallini12-Dec-07 21:45 
GeneralRe: Structure as a proc in a DLL Pin
ForNow12-Dec-07 21:56
ForNow12-Dec-07 21:56 
QuestionAdd GIF file as resource? Pin
DigiFaith12-Dec-07 11:31
DigiFaith12-Dec-07 11:31 
AnswerRe: Add GIF file as resource? Pin
Don Box12-Dec-07 17:47
Don Box12-Dec-07 17:47 
AnswerRe: Add GIF file as resource? Pin
KarstenK13-Dec-07 4:46
mveKarstenK13-Dec-07 4:46 
GeneralWinerror 234 Pin
RomTibi12-Dec-07 10:36
RomTibi12-Dec-07 10:36 
GeneralRe: Winerror 234 Pin
CPallini12-Dec-07 10:47
mveCPallini12-Dec-07 10:47 
GeneralRe: Winerror 234 Pin
RomTibi13-Dec-07 8:01
RomTibi13-Dec-07 8:01 
GeneralRe: Winerror 234 Pin
CPallini13-Dec-07 21:12
mveCPallini13-Dec-07 21:12 
GeneralRe: Winerror 234 Pin
RomTibi14-Dec-07 6:08
RomTibi14-Dec-07 6:08 
GeneralXML Reading/Skipping comments question. Pin
Maximilien12-Dec-07 10:16
Maximilien12-Dec-07 10:16 
GeneralRe: XML Reading/Skipping comments question. Pin
George L. Jackson12-Dec-07 12:59
George L. Jackson12-Dec-07 12:59 
GeneralDeploying a simple VS2005 executable Pin
bigdenny20012-Dec-07 9:08
bigdenny20012-Dec-07 9:08 

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.