Results 1 to 8 of 8

Thread: Error if I wont to GetWindowText()?!!

  1. #1

    Thread Starter
    Member rajab natshah's Avatar
    Join Date
    Dec 2001
    Posts
    43

    Smile Error if I wont to GetWindowText()?!!

    Hi ,
    If I wont to GetWindowText () on my project .
    As in the following Cod .
    Code:
    void CMainFrame::OnGetviewtextGettext() 
    {
        CString msg;
    	CLesenView.GetWindowText(msg);
        MessageBox(msg);
    }
    I don’t do whey this Error .


    Code:
    --------------------Configuration: lesen - Win32 Debug--------------------
    Compiling...
    MainFrm.cpp
    H:\lesen\MainFrm.cpp(112) : error C2143: syntax error : missing ';' before '.'
    H:\lesen\MainFrm.cpp(112) : error C2143: syntax error : missing ';' before '.'
    Error executing cl.exe.
    
    lesen.exe - 2 error(s), 0 warning(s)
    Thank you for help me:>

  2. #2

    Thread Starter
    Member rajab natshah's Avatar
    Join Date
    Dec 2001
    Posts
    43
    the Project cod
    Attached Files Attached Files

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    CLesenView.GetWindowText(msg);

    You need a class instance.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Member rajab natshah's Avatar
    Join Date
    Dec 2001
    Posts
    43

    Smile

    thake you for help me .
    yes , but when I create instance of CLesonView as the following .
    Code:
    void CMainFrame::OnGetviewtextGettext() 
    {
        CString msg;
    	CLesenView myView;
    	myView.GetWindowText(msg);
        MessageBox(msg);
    }
    that make the followin error.
    Code:
    --------------------Configuration: lesen - Win32 Debug--------------------
    Compiling...
    MainFrm.cpp
    H:\lesen\MainFrm.cpp(113) : error C2248: 'CLesenView::CLesenView' : cannot access protected member declared in class 'CLesenView'
            h:\lesen\lesenview.h(16) : see declaration of 'CLesenView::CLesenView'
    Generating Code...
    Compiling...
    lesen.cpp
    Generating Code...
    Error executing cl.exe.
    
    lesen.exe - 1 error(s), 0 warning(s)
    and I'm read in one book the CappView and Cappdoc and so are run time class .
    the opration in the EditTextBox are good but in the View inhereted to EditView make error.

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    There must be a view instance already lying around somewhere. Use it.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6

    Thread Starter
    Member rajab natshah's Avatar
    Join Date
    Dec 2001
    Posts
    43

    Smile

    Thank you I will search for it

  7. #7
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    GetActiveView() should do it in the frame class unless it's an MDI program.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  8. #8
    New Member
    Join Date
    Mar 2003
    Posts
    15

    Smile

    hello,
    whow I can do It ?
    Get the Text from the EditView in SDI ...

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