|
When you are create an application using AppWizard, choose MFC AppWizard.
On page 1 of 6, choose "Multiple Documents" / MDI.
On page 6 of 6, choose CFormView as the base CView class.
Choose other options sensibly.
This will give you an MDI Formview application. Now just change the dialog
the form uses to match the one you've already made elsewhere.
Tada!
Iain.
|
|
|
|
|
I want to evaluate each option's value in a dropdown listbox,but I don't know how to use the function get_options of IHTMLSelectElement.
I try this:
IHTMLElementCollection *lpCol=NULL;
IHTMLSelectElement *lpList=NULL;
IDispatch *lpDisp = NULL;
//init lpList
lpList->get_options((IDispatch **)&lpCol); //this doesn't work!!!!!!!
and
lpList->get_options(&lpDisp);
lpDisp->QueryInterface(IID_IHTMLElementCollection,(void**)&lpCol); //doesn't work either.
please help me!!
Thanks in advance!
Alan Shen.
|
|
|
|
|
Hi,
My application has many dialog box, and I use the following code to go from one to another..
CcamsetfinDlg dlg8;
CcsettDlg dlg2;
CsettDlg dlg3;
Ctstdlg dlg4;
CtmpsetDlg dlg5;
CtmrsetDlg dlg6;
CSimpletonDlg dlg;
//m_pMainWnd = &dlg; //I removed the line or else the dialog vanishes immediately
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{m_pMainWnd = &dlg4;
dlg4.DoModal();
}
else if (nResponse == IDCANCEL)
{
INT_PTR pRet = -1;
pRet= dlg3.DoModal();
if(pRet==5)
{
m_pMainWnd = &dlg8;
pRet=dlg8.DoModal();
}
if(pRet==0)
{
m_pMainWnd= &dlg4;//
dlg4.DoModal();
}
The problem is the dialog box pointed by &dlg4 in the above if loop pops up and vanishes immediately.I had this problem with the first dialog box, but got over it as I got a suggestion that I should remove the line m_pMainWnd = &dlg; which I have quoted as a comment statement. Please help me in this regard.
Thanks.
Deepak Samuel
|
|
|
|
|
Hi,
from which type is your application? (e.g. dialog-based)
Why do you set the m_pMainWnd variable to current dialog? Because if your application dialog based and the m_pMainWnd = current dialog and the dialog close, then the application get a "signal" that the mainwindow is closed and the application terminates itself.
Regards Frank
|
|
|
|
|
Right. While not exactly the same, I bet it is closely related to MSDN article Q138681.
|
|
|
|
|
There is an article about "Dialog Tips & Trics" on CP.
read it!
I guess its because m_pMainWnd
|
|
|
|
|
How can enumerate LPT ports on machine?
If possible, with sample code please.
Best regards,
Eugene Pustovoyt
|
|
|
|
|
i don't know anything about coding with LPT ports...
but try this:
char buffer[32];<br />
unsigned int i;<br />
HANDLE hPort;<br />
<br />
for( i = 1; i < 10; i++ )<br />
{<br />
sprintf( buffer, "LPT%i", i );<br />
hPort = CreateFile( buffer, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL )<br />
<br />
if( hPort == INVALID_HANDLE_VALUE )<br />
break;
<br />
CloseHandle( hPort );<br />
}<br />
Don't try it, just do it!
|
|
|
|
|
Your question intrigued me, as not long ago there were a series of articles / questions on
how impossible it was to enumerate serial ports...
I've done a little digging, and there are two functions that should interest you:
EnumPorts and EnumPrinters.
Here is some sample code for each:
DWORD dwNeed = 0;
DWORD dwPorts = 0;
BOOL b = EnumPorts (NULL, 2, NULL, dwNeed, &dwNeed, &dwPorts);
if (!b && GetLastError () == ERROR_INSUFFICIENT_BUFFER)
{
BYTE *buf = new BYTE [dwNeed];
memset (buf, 0, dwNeed);
PORT_INFO_2 *p = (PORT_INFO_2 *)buf;
b = EnumPorts (NULL, 2, buf, dwNeed, &dwNeed, &dwPorts);
delete [] buf;
}
dwNeed = dwPorts = 0;
b = EnumPrinters (PRINTER_ENUM_LOCAL, NULL, 1, NULL, dwNeed, &dwNeed, &dwPorts);
if (!b && GetLastError () == ERROR_INSUFFICIENT_BUFFER)
{
BYTE *buf = new BYTE [dwNeed];
memset (buf, 0, dwNeed);
PRINTER_INFO_1 *p = (PRINTER_INFO_1 *)buf;
b = EnumPrinters (PRINTER_ENUM_LOCAL, NULL, 1, buf, dwNeed, &dwNeed, &dwPorts);
delete [] buf;
}
You may also want to look at EnumMonitors, and the results different report levels give.
Iain.
|
|
|
|
|
Thank you. That's all I need
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Hello, everyone!
If I want to ask question about C/C++ under Linux environment. Can you introduce some forums?
regards,
George
|
|
|
|
|
this is a windows site
Don't try it, just do it!
|
|
|
|
|
Hi, Alexander buddy!
Linux is our future. Can you answer my question in a direct way?
Thanks in advance,
George
|
|
|
|
|
What do you want to know? What is Linux-specific about it? If it's about a library, ask on that libraries mailing list; if it's not Linux specific, ask here.
|
|
|
|
|
Thanks, roel_ buddy!
I want to ask IPC, PThread, memory management and device driver questions under Linux environment.
Do you know some forums?
regards,
George
|
|
|
|
|
Have you checked out any of the linux.dev.* newsgroups?
|
|
|
|
|
A very nice idea!
But are there some web based?
George
|
|
|
|
|
You can access them from Google.
|
|
|
|
|
Thanks, DavidCrow buddy!
George
|
|
|
|
|
You could start with http://leapster.org/linoleum/ (I admit, it's the second link when you type 'linux programming' in Google). Find some mailing lists to subscribe to, most development and support is on mailing lists and not on web-based boards in the Linux world (suggestion: get yourself a threading mail reader, like Mozilla Mail or even better, Mutt, it will greatly enhance your mailing list reading)
|
|
|
|
|
Thanks, roel_ buddy!
It is a very nice site!!
George
|
|
|
|
|
everybody knows what is the meaning of stdin, stdout, stderr, stdaux, and stdprm?
i just know those are standard input device, standard out device, and so on ...
but i don't have any idea(i don't understand) about standard input device, and its friends.
can somebody explain to me?
thousands thanx
>>when someone know more and more, they will feel they have weakness<<
|
|
|
|
|
They are io-streams that are opened by the runtime lib for you. Stdin is by connected to the console by default (but may be connected to some file with '<' on the command line.
Stdout is connected to to a console window on the screen by default, but can be redirected to a file with '>' on the command line.
Stderr is by default connected like stdin , but can not be redirected.
I hope this could help you a bit.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Those are just streams! just like any files streams, memory streams,...
You should find all the information you need in the MSDN library
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
I want to achieve the following:
Suggest you have a property sheet with three property pages which all have a combobox named IDC_COMBOBOX. The comboboxes named IDC_COMBOBOX, all have te same items stored in it. The list of items is large, so it takes a wile to put (initialize) all the items into the combobox. Therefore I want all the three comboboxes to share the same list of items, so that I only have to initialize one time to get all the three comboboxes filled with the same items.
How can I achieve this?
Is there a way to access the storage of the combobox from another dialog?
Thnxx
|
|
|
|
|