|
I ended deleting all the buttons and then adding them back in and now they work.
I still have dublicate numbers...maybe they are on a window by window basis.
|
|
|
|
|
I still have dublicate numbers...maybe they are on a window by window basis.
what numbers.. of what???
|
|
|
|
|
resource.h example:
#define IDC_RADIO7 1017
#define IDC_CHECK8 1017
#define IDC_ACTV_7 1017
#define IDC_MALF08 1017
#define IDC_MALF08_SYS1 1017
#define IDC_SYS8_FAU 1017
#define IDC_SYS1_MODE_SEL_SWITCH4 1017
#define IDC_MF_FRONT1 1017
#define IDC_ALQ122_DUP 1017
#define IDC_MF1_FRONT 1017
|
|
|
|
|
Its a common problem.
Theres a tool at http://www.codeproject.com/macro/resorg.asp that can help you reorganise.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Has anyone found a workaround for disabling the arrow on an owner drawn menu when the popup menu item is disabled?
|
|
|
|
|
If you mean whether all the items to the left of the => arrow are disabled so you'd like to remove the menu item?
Can't you catch the OnInitMenu handler ( Or whatever it is in CMainFrame ) and call pMenu->ModifyMenu etc... to remove the arrow or just remove that menu item all together.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Hi
Thank you for the reply. What I mean't is that I wanted to show the popup menu arrow as disabled in an owner drawn menu like it is in a standard menu if you disable the popup.
Cheers
Paul
|
|
|
|
|
Yaw all!
Happy new year! (To all Jewish folks)
<font color = blue>CWnd</font>::SetWindowPos(&wndTopMost,0,0,0,0,SWP_NOSIZE | SWP_NOMOVE) doesn't set my window to be topmost ( creates by <font color = blue>CWnd</font>::CreateEx() , Styles: WS_POPUP )!!!
I want it to appear above the taskbar, but it does-NOT!
Any? Help?
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
Ummm... Maybe you can try setting the desktop as the parent of your window with CWnd::SetParent .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
This is an MFC CFormView MDI application and this code is in the View class.
I have a CFileDialogST from which I want to terminate the app in case the user presses cancel. Its a class from CP by Davide Calabro. I trap the IDCANCEL and indeed i do get the messagebox, but I've tried
a. PostQuitMessage is ignored
b. PostMessage(WM_CLOSE) is ignored
c. SendMessage(WM_CLOSE) is ignored
d. exit(0) makes the app crash!
if(nRetValue == IDCANCEL)
{
AfxMessageBox ("No Image folder selected, terminating application");
PostMessage(WM_CLOSE);
}
This message No Image folder selected, terminating application shows up so I know it gets in the if .
Please help!
Thanks,
ns
|
|
|
|
|
|
I think PostMessage is a better alternative here --if using SendMessage(WM_CLOSE) inside a message handler, windows can get destroyed too soon.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I did like you said:
if(nRetValue == IDCANCEL)
{
AfxMessageBox ("No Image folder selected, terminating application");
AfxGetMainWnd()->PostMessage(WM_CLOSE);
}
and it crashes after the messagebox pops up. Same behavior as with exit(0);
???
thank you very much for helping,
ns
|
|
|
|
|
It goes to the end of mainframes destroy() where I write registry info, then suddenly gets into disassembly at the ending curly bracket of destroy(), and I can seem to get out of it, - have no clue how to interpret disassembly...crashes while stepping through disassembly somewhere...
|
|
|
|
|
|
Without the registry info code, the destroy is empty. I commented it all out - still crashes!
thanks.
A peculiar observation:
Atfirst the registry is blank. The app pops up the first thing: a CfileDialogST asking for a location (directory browser). If you hit cancel at this point, things are okay. No crash. Next, you run the app, give it a valid folder, and the main UI comes up. In this UI you can run the same exact function that ran at startup, and the CFileDlg pops up again. Now if you hit cancel, it crashes. I dont know what this means...
Appreciate your help,
ns
|
|
|
|
|
|
When the app crashes, it doesnt die from task manager processes, so I kill it. So I know that when I start the app again (after recompiling or whatever) its the one and only app running...I hope thats what you meant...
Thanks,
ns
|
|
|
|
|
Ummm... These are just guesses:- Try with
AfxGetApp()->m_pMainWnd()->PostMessage(WM_CLOSE) , although I don't think it will work any better.
- What are you doing within
OnDestroy ? Something sensible with your document? Try moving the code to OnClose .
- Is the quit message posted from a thread other than the main thread?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I'm saving registry info in destroy(). Even if I comment it all out it still crashes. My response to the last post mentions a sequencing detail that might be important...
I only have one thread. I'm in the view class from which I post the message. Its not a multithreaded app.
Thanks so much,
ns
|
|
|
|
|
Could you post the code for the InitInstance method? maybe you're doing weird things there.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
BOOL CTrain1App::InitInstance()
{
AfxEnableControlContainer();
#ifdef _AFXDLL
Enable3dControls();
#else
Enable3dControlsStatic();
#endif
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings();
AfxInitRichEdit();
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_TRAIN1TYPE,
RUNTIME_CLASS(CTrain1Doc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CTrain1View));
AddDocTemplate(pDocTemplate);
m_pView1Template = pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_TRAIN1TYPE,
RUNTIME_CLASS(CTrain1Doc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CDlgLists));
m_pView2Template = pDocTemplate;
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (!ProcessShellCommand(cmdInfo))
return FALSE;
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
|
|
|
|
|
I don't see any use of CFileDialogST here (thought you were launching at start up before UI).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Sorry. The code is in a function that is triggered in OnInitDialog (in View) after it queries the registry to see if info exists. If not, this function runs. However this same function can be called from a menu selection once the app is up and running. Its when I cancel at this point, that I get the crash.
Is this clearer. So sorry for miscommunicating...
(I had really wanted the blank UI to come up on which the CFileDlg should sit waiting, but the postmessage I used to trigger my function was having probs, which I fixed with sendmessage, so now it just brings the CFileDlg up instead.)
|
|
|
|
|
Let's keep on rocking. Replace WM_CLOSE with ID_APP_EXIT (and tell us what happens).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|