|
HEY...
thanks for the help.
I tried using CFormView ...
but when I build and run, the main window or the dialog window doesnt show up. I must be missing some line..
i tried debugging but in vain......
any help appreciated.
thanks heaps......
|
|
|
|
|
I want to programatically launch all menus and the submenu items belonging to each menu using their short cut keys only.
e.g in wordpad programatically launch 'File' menu using 'Alt+F' key. once the 'File' menu is up and displayed we have to programatically launch all 'File' submenu items one after the other e.g submenu item 'New' using 'Alt+N' key next launch 'Open' submenu item using ''Alt+O' and so on.
I cld retrieve all short cut keys for menu and submenu items and have logged it into a file.i have extracted the shortcut key from each menu and submenu text using GetMenuString(). I plan to append it to 'Alt' to get 'Alt+F' and so on and use this shorcut key to launch each.pls suggest how do i go ahead from here??
i can take care of closing each window launched by the submenu item but launching menu and submenu items programatically with shortcut keys is posing a problem.
urgent help needed. Pls suggest me a sample code if any.
Thanks in advance.
Sincerely
Giftsana
Singapore
|
|
|
|
|
Hi,
I created a MFC doc/view application.
1. When the main window( the mdi ) is loaded it displays a empty chiled form. I don't want it to display anything.
2.Now I have dialog which i want to dock along the bottom of the parent window when it's displayed.
I am really enw and have done readings and stuff onlien but nothing seem to point in right direction.
Any pointers towards this?
Any help is appreciated
Thanks
|
|
|
|
|
hi ven,
for this approach follow this steps you will get.
1) in OnInitialUpdate(...) of the MDI Form call a
SendMessage(...,Functionname(...))/PostMessage(...,Functionname(...))
in the FunctionName(...) initiate the
Dialog Dlgname d;
d.DoModel(...);
thats it! you will get Cheers and You will get it.
good luck..
uday.
uday kiran
|
|
|
|
|
where is this OnInitialUpdate
sorry am new to MFC.
|
|
|
|
|
I did that man. here is the problem
first if i get rid of the startup child form, the CGUIView OnInitialUpdate does not even get called, so that code do nothing.
Second i have no idea how to use SendMessage
but this is what i did:
void CQCProGUIView::OnInitialUpdate( )
{
LoadLaunchBar( );
}
int CQCProGUIView::LoadLaunchBar( )
{
m_launchbar = new CLaunchBar( );
m_launchbar->DoModal( );
return 0;
}
now this what this does is basically the application runs, but i don't seee anything at all( not even main MDi form ).
if i replace that with:
m_launchbar->ShowWindow( SW_NORMAL);
the following assertion fails:
BOOL CWnd::ShowWindow(int nCmdShow)
{
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
if (m_pCtrlSite == NULL)
return ::ShowWindow(m_hWnd, nCmdShow);
else
return m_pCtrlSite->ShowWindow(nCmdShow);
}
|
|
|
|
|
Hi,
Add cmdInfo.m_nShellCommand =CCommandLineInfo::FileNothing;
in Initinstance().
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
hey thanks cool ju, that FileNothign worked like a charm.
am still trying to show up the dialog thou
|
|
|
|
|
Hi,
Instead of Dialog use a DialogBar which can be docked like a toolbar. Create the dialog bar in MainFrm::OnCreate() function and dock it where ever you want.
Adios,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
how do you dock, actually I am using a dialog bar
I thoguht docking was not possible , so i was doign poisitioning and sizing myself.\
how would you suggest I try docking?
|
|
|
|
|
Hi,
You have to the dock the dialogbar using SetWindowPos() function.
I suggest you to do in MainFrm class not in View class.
Insert a dialog and change the style to child.
Declare a CDialogbar object(eg: m_dlgbar) in MainFrm.h
In MainFrm::OnCreate funtion
m_dlgBar.Create(this, Id of the dialog template,CBRS_LEFT|CBRS_TOOLTIPS|CBRS_FLYBY,id of the dialog template);
m_dlgBar.SetWindowPos(&m_wndStatusBar, x,y,cx,cy,SWP_NOSIZE|SWP_NOMOVE);
Adios,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
A couple fo things:
1. The object was a CDialog so I changed the base class to CDialogBar
2.I used following code
m_launchbar->Create( this,IDD_LAUNCHBAR,CBRS_BOTTOM ,IDD_LAUNCHBAR );
this docs the window fine at the bottom without any setting of position and size using the SetWindowPos.
Now what happens is every button on the dialogbar is disabled and it took away the WinXp kind of look from the buttons too!!!
Any ideas, am reading MSDN too on this.
Thanks for your help , it was awesome
|
|
|
|
|
I have a code base that can produce two separate programs with different functionality. This functionality is controlled via #defines in the main code. I would like to use the same #define to control the program’s icon, and the wording in a few menus. I found that the following code will allow me to control the icon:
<br />
#if defined(APSTUDIO_INVOKED)<br />
IDR_MAINFRAME ICON "..\\res\\MAIN.ico"<br />
#else<br />
#if defined(MAIN_PROG)<br />
IDR_MAINFRAME ICON "..\\res\\MAIN.ico"<br />
#else<br />
IDR_MAINFRAME ICON "..\\res\\SECONDARY.ico"<br />
#endif<br />
#endif<br />
The problem is that as soon as someone actually edits a file with the resource editor, all of the conditional code is removed.
Is it actually possible to conditionally change the icon of a program, and if so what is the recommended method. I’m trying to avoid going to multiple rc files, since we will have to keep them in sync from this point on.
|
|
|
|
|
Yeah, I've noticed that in MSVC6. Bloody annoying and bloody stupid of Microsoft.
Steve
|
|
|
|
|
An RC File is Automatically maintained by the MFC Editor. That's the whole Idea behind IDE, and ofcourse it will wipe it.This is an MFC Feature since the days of Windows 3.1, and NOT a feature of MFC 6.0(or earlier or later) If you want resource code, not edited by the IDE, handwrite it in the .RES File (which is a Text File Similar to the RC File) found in your resource directory(underneath Debug and Release)
Tip, If you do not know the Syntax, create it first in the Resource Editor, then copy the entire text to the .Res File, and then delete the item from your resource editor window. It will still be in the res File, The Resource Editor does no know about that File and will leave it alone)
regards
LateNightsInNewry
|
|
|
|
|
The whole idea of the IDE is not to destroy information but to make it easier to author/modify it. And it has nothing to do with MFC; it's the resource editor where the fault lies and it manifests itself whether MFC is used or not. I used the word "fault" intentionally because it is a fault: There is nothing to stop the resource editor getting the current defines from the project settings for the currently selected configuration and only editing the relevant subset.
Steve
|
|
|
|
|
LateNightsInNewry wrote: ...the .RES File (which is a Text File Similar to the RC File)...
No it's not. It's a temporary binary file that the resource compiler creates.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
hi,
use CStudioFile Instead of the CFile, because there is One Method called
ReadLine(...) which will solve your problem. also to Read use only
ReadHuge(...).
good luck.
thanks,
uday.
uday kiran
|
|
|
|
|
I think this reply might be in the wrong thread?
Steve
|
|
|
|
|
How about:
IDR_MAINFRAME1 ICON "..\\res\\MAIN.ico"
IDR_MAINFRAME2 ICON "..\\res\\MAIN.ico"
IDR_MAINFRAME3 ICON "..\\res\\SECONDARY.ico"
...
CMyDlg::CProgressTestDlg(CWnd* pParent )
: CDialog(CMyDlg::IDD, pParent)
{
#if defined(APSTUDIO_INVOKED)
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME1);
#elif defined(MAIN_PROG)
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME2);
#else
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME3);
#endif
}
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: How about:
IDR_MAINFRAME1 ICON "..\\res\\MAIN.ico"
IDR_MAINFRAME2 ICON "..\\res\\MAIN.ico"
IDR_MAINFRAME3 ICON "..\\res\\SECONDARY.ico"
...
CMyDlg::CProgressTestDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMyDlg::IDD, pParent)
{
#if defined(APSTUDIO_INVOKED)
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME1);
#elif defined(MAIN_PROG)
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME2);
#else
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME3);
#endif
}
If I'm reading the above correctly, this will cause the program to use the correct icon when it is running, but not when the executable is being displayed in explorer, folder browser, etc. It would appear that windows uses the icon with the lowest ID number for for this.
|
|
|
|
|
How do I forward an API Call from one DLL to the Next, i.e. What is the syntax for writing a .DEF file for MYUSER.DLL, to effect linkage via that to MYPRIVATE.DLL, where the 'Real code' is located
LateNightsInNewry
|
|
|
|
|
Should have been headed as 'Forwarding APIs'
LateNightsInNewry
|
|
|
|
|
hi all,
i've got a quick question about cfile::read. i just need to get each line of a text file in a loop so i can process each line. can someone show me how, or tell me where to look?
thanks in advance,
sam kline
|
|
|
|
|