Click here to Skip to main content
16,005,209 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: destructor question Pin
Paul M Watt23-Aug-02 9:02
mentorPaul M Watt23-Aug-02 9:02 
GeneralRe: destructor question Pin
ns23-Aug-02 9:10
ns23-Aug-02 9:10 
GeneralRe: destructor question Pin
John Fisher23-Aug-02 9:07
John Fisher23-Aug-02 9:07 
GeneralRe: destructor question Pin
ns23-Aug-02 9:14
ns23-Aug-02 9:14 
GeneralSTL set iterator - simple question Pin
ns23-Aug-02 8:11
ns23-Aug-02 8:11 
GeneralRe: STL set iterator - simple question Pin
Stuart Dootson23-Aug-02 8:26
professionalStuart Dootson23-Aug-02 8:26 
GeneralRe: STL set iterator -very cool! Pin
ns23-Aug-02 8:43
ns23-Aug-02 8:43 
GeneralRichEdit Question Pin
Nick Parker23-Aug-02 6:59
protectorNick Parker23-Aug-02 6:59 
Ok, I am working with the RichEdit control and trying to view a file in it. Two questions, first and more importantly why/how is this only reading the first line of the file and no more. How do I get it to read the entire file into the Rich Edit control. Second is how do you allow/tell the control to resize when the maximize button is pressed. Thanks in advance. The code I am using is listed below. Any help in explaining how the call back function works would be great as well, trying to learn as much as I can here. Smile | :)

void CFileViewerDlg::OnSelectFile() 
{
	EDITSTREAM es;
	CFileDialog cd(true);

	if(cd.DoModal() == IDOK)
	{
		UpdateData(true);
		m_FileName = cd.GetPathName();
		UpdateData(false);

		
		CFile cFile(cd.GetPathName(), CFile::modeRead);
		es.dwCookie = (DWORD) &cFile;
		es.pfnCallback = MyStreamInCallback;
		m_RichEditValue.StreamIn(SF_TEXT, es);

	}
	

}

DWORD CALLBACK CFileViewerDlg::MyStreamInCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{

   CFile* pFile = (CFile*) dwCookie;

   *pcb = pFile->Read(pbBuff, cb);

   return 0;


}


Nick Parker


GeneralRe: RichEdit Question Pin
Chris Losinger23-Aug-02 7:11
professionalChris Losinger23-Aug-02 7:11 
GeneralRe: RichEdit Question Pin
Nick Parker23-Aug-02 7:28
protectorNick Parker23-Aug-02 7:28 
GeneralRe: RichEdit Question Pin
Chris Losinger23-Aug-02 7:39
professionalChris Losinger23-Aug-02 7:39 
GeneralRe: RichEdit Question Pin
Nick Parker23-Aug-02 8:12
protectorNick Parker23-Aug-02 8:12 
GeneralSetting a wait cursor on a dialog using pure Win32 Pin
Todd Jeffreys23-Aug-02 6:46
Todd Jeffreys23-Aug-02 6:46 
GeneralRe: Setting a wait cursor on a dialog using pure Win32 Pin
Tomasz Sowinski23-Aug-02 6:54
Tomasz Sowinski23-Aug-02 6:54 
GeneralRe: Setting a wait cursor on a dialog using pure Win32 Pin
Todd Jeffreys23-Aug-02 7:12
Todd Jeffreys23-Aug-02 7:12 
GeneralRe: Setting a wait cursor on a dialog using pure Win32 Pin
Tomasz Sowinski23-Aug-02 7:18
Tomasz Sowinski23-Aug-02 7:18 
GeneralRe: Setting a wait cursor on a dialog using pure Win32 Pin
Todd Jeffreys23-Aug-02 7:40
Todd Jeffreys23-Aug-02 7:40 
GeneralRe: Setting a wait cursor on a dialog using pure Win32 Pin
Tomasz Sowinski23-Aug-02 7:44
Tomasz Sowinski23-Aug-02 7:44 
Generalchanges in database -- Pin
ns23-Aug-02 6:04
ns23-Aug-02 6:04 
GeneralRe: changes in database -- Pin
Mauricio Ritter23-Aug-02 7:29
Mauricio Ritter23-Aug-02 7:29 
GeneralBooks.. Books.. Books... Pin
Ryan B.23-Aug-02 5:58
Ryan B.23-Aug-02 5:58 
GeneralRe: Books.. Books.. Books... Pin
valikac23-Aug-02 6:40
valikac23-Aug-02 6:40 
QuestionHow to debug System crash with right cross exiting Pin
ns23-Aug-02 5:55
ns23-Aug-02 5:55 
AnswerRe: How to debug System crash with right cross exiting Pin
Tomasz Sowinski23-Aug-02 5:58
Tomasz Sowinski23-Aug-02 5:58 
GeneralRe: How to debug System crash with right cross exiting Pin
ns23-Aug-02 6:06
ns23-Aug-02 6:06 

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.