Click here to Skip to main content
16,010,488 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Which user interface? Pin
Steve L.18-Jul-02 16:05
Steve L.18-Jul-02 16:05 
GeneralRe: Which user interface? Pin
ColinDavies18-Jul-02 21:39
ColinDavies18-Jul-02 21:39 
GeneralListView Pin
Anthony988718-Jul-02 14:18
Anthony988718-Jul-02 14:18 
GeneralTrouble accessing a control in a view from a frame: Pin
ns18-Jul-02 12:13
ns18-Jul-02 12:13 
GeneralRe: Trouble accessing a control in a view from a frame: Pin
jmkhael18-Jul-02 12:20
jmkhael18-Jul-02 12:20 
GeneralRe: Trouble accessing a control in a view from a frame: Pin
Mandalay18-Jul-02 12:21
Mandalay18-Jul-02 12:21 
GeneralRe: Trouble accessing a control in a view from a frame: Pin
Anonymous18-Jul-02 12:26
Anonymous18-Jul-02 12:26 
GeneralpView is NULL!! NOw what? Pin
ns18-Jul-02 12:35
ns18-Jul-02 12:35 
I found that:

CTrain1View * pView = (CTrain1View *)GetActiveView();
if(pView == NULL) AfxMessageBox("trouble");


pView is NULL. I dont even reach the line where I'm trying to get at the control (which probably isnt created yet).

The trouble I had was that I can only modifymenu with the sample i have, if I call it from MAinFrame class menu handler. (My coding inexperience)


CString str;
CString str1 = "Display2";

CString str2 = " Save selection ???";

mmenu->GetMenuString(ID_DISPLAY2, str, MF_BYCOMMAND);

if (str == str1)
{
// m_listdisplay.ShowWindow(SW_SHOW);
mmenu->ModifyMenu(ID_DISPLAY2, MF_BYCOMMAND,ID_DISPLAY2, " Save selection ???");
pMain->DrawMenuBar();

}

if (str == str2)
{

mmenu->ModifyMenu(ID_DISPLAY2, MF_BYCOMMAND,ID_DISPLAY2, "Display2");
pMain->DrawMenuBar();


In response to the menu title changing, in the mainframe handler I'm trying to get the control to get visible in the view. The null pointer is telling me the view isnt active yet, which isnt true since I have seen the gui already (thats where I press the menu to switch titles). I am using another sample that someone gave me to create my view (I need to be switching between views so I use this since it doesnt destroy the hidden view):

BOOL CMainFrame::SwitchView(CMultiDocTemplate *pTemplate, CRuntimeClass *pViewClass)
{
CMDIChildWnd* pChild = (CMDIChildWnd*) MDIGetActive();

if ( pChild == NULL ) return FALSE;

CDocument* pDoc = pChild->GetActiveDocument();

if ( pDoc == NULL ) return FALSE;

CView* pView;


POSITION pos;

pos = pDoc->GetFirstViewPosition();

while( pos != NULL )
{
pView = pDoc->GetNextView( pos );

if( pView->IsKindOf( pViewClass ) )
{
pView->GetParentFrame()->ActivateFrame();

return TRUE;
}
}


pChild = (CMDIChildWnd*) pTemplate->CreateNewFrame(pDoc, NULL ); //error here ERROR: Dialog with IDD 0x0082 must have the child style.

if( pChild == NULL ) return FALSE;

pChild->MDIActivate();


pTemplate->InitialUpdateFrame( pChild, pDoc);

return TRUE;
}

ANy pointers would be greatly appreciated,
thanks,
ns
Generalproblem resolved! Pin
ns19-Jul-02 4:01
ns19-Jul-02 4:01 
GeneralRetreiving a user's signature Pin
Shog918-Jul-02 11:24
sitebuilderShog918-Jul-02 11:24 
GeneralRe: Retreiving a user's signature Pin
ColinDavies18-Jul-02 21:43
ColinDavies18-Jul-02 21:43 
GeneralHelp please : "Detected memory leaks!" Pin
Mandalay18-Jul-02 10:19
Mandalay18-Jul-02 10:19 
GeneralRe: Help please : "Detected memory leaks!" Pin
[CoY0te]18-Jul-02 11:05
[CoY0te]18-Jul-02 11:05 
GeneralRe: Help please : "Detected memory leaks!" Pin
Mandalay18-Jul-02 11:48
Mandalay18-Jul-02 11:48 
GeneralRe: Help please : "Detected memory leaks!" Pin
Nathan Blomquist18-Jul-02 12:17
Nathan Blomquist18-Jul-02 12:17 
GeneralRe: Help please : "Detected memory leaks!" Pin
[CoY0te]18-Jul-02 22:44
[CoY0te]18-Jul-02 22:44 
GeneralRe: Help please : "Detected memory leaks!" Pin
Alexandru Savescu18-Jul-02 21:01
Alexandru Savescu18-Jul-02 21:01 
GeneralRe: Help please : "Detected memory leaks!" Pin
Joaquín M López Muñoz18-Jul-02 11:13
Joaquín M López Muñoz18-Jul-02 11:13 
GeneralRe: Help please : "Detected memory leaks!" Pin
[CoY0te]18-Jul-02 11:21
[CoY0te]18-Jul-02 11:21 
GeneralRe: Help please : "Detected memory leaks!" Pin
Joaquín M López Muñoz18-Jul-02 11:25
Joaquín M López Muñoz18-Jul-02 11:25 
GeneralBUT IT WORKS (: Pin
Mandalay18-Jul-02 11:54
Mandalay18-Jul-02 11:54 
GeneralCHtmlView - trapping the right click when an HT ML page is displayed Pin
BeavisInAz18-Jul-02 10:18
BeavisInAz18-Jul-02 10:18 
GeneralRe: CHtmlView - trapping the right click when an HT ML page is displayed Pin
ColinDavies18-Jul-02 21:49
ColinDavies18-Jul-02 21:49 
GeneralRe: CHtmlView - trapping the right click when an HT ML page is displayed Pin
BeavisInAz19-Jul-02 5:01
BeavisInAz19-Jul-02 5:01 
Questionhow to hide or remove separator bars in toolbar programmatically? Pin
ns18-Jul-02 10:08
ns18-Jul-02 10: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.