CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11

Threaded View

  1. #4
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,241

    Re: Why wont thsi mfc code work?

    Quote Originally Posted by printz0r View Post
    This makes sense. So how would I write strings to the document? Or highlight certain words in the document and display it to the active view?

    Code:
    FILE *f;
    CMyDoc *pDoc=(CMyDoc *)GetActiveDocument();
    f=fopen(pDoc,"wb");
    char buffer[] = { 'x' , 'y' , 'z' };
    fwrite (buffer , 1 , sizeof(buffer) , f);
    fclose (f);
    pDoc->UpdateAllViews(NULL,0,0);
    Would the above code work?
    That may work but makes no sense as long as you are using MFC.
    Last edited by ovidiucucu; May 31st, 2012 at 01:35 PM.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured