|
Please don't laugh to hard but how do you except a command line parameter such as a flag?
Ex: MyProj.exe /s
Thanks Eric
|
|
|
|
|
In your main program put something like this:
void main(dataType flag)
{
switch flag:
case: s
printf("hello your input param is s"
break;
case:
.............
.............
}
whereas dataType is the dataType you want, such as integer or whatever flags you want. In the main program you can have switch case statement according to each input parameter
Hope this helps!!!
|
|
|
|
|
I knew that it was very simple. Thank you.
Eric
|
|
|
|
|
Very sorry for waisting your time
I figured it out
void main(int argc, char* flag[])
{
// acrgc = number of string param
// flag[1] = first string param
// ...
// flag[n] = n string param
}
Thanks for your time though
Eric
|
|
|
|
|
how can i update the dialogs of my dialog application in my own class. Currently i've inherited from the *Dlg class, and even though the compiler returns no errors, i get a error for the command UpDateData(TRUE) while the program is running, saying Debug Assertion Failed.
Anyone know what the problem is?
|
|
|
|
|
Probably something wrong in the DDX variable mapping declared in ::DoDataExchange(CDataExchange* pDX).
Be sure to use the Dialog classwizard to add or modify those members. Also check if member types are adequate (MSDN MFC Technical Note can help for that).
Let's swallow a small raisin.
|
|
|
|
|
Will you be able to post your code ?? I think it's likely that the data that you're trying to use is no longer exist. This happens when you don't overide the OK button!!
|
|
|
|
|
I'm writing to a database using appendChunk. it just goes and keeps adding to the same database - instead of overwriting it. THere dont seem to be any parameters that I can set in the method. I open the database using the recordset.Open function and I didnt see anything there that I could set either to make the database get rewritten.
PLease help!
ns
|
|
|
|
|
Try setting that field to null first.
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
By default when I create propertysheets for my dialog they have Help button.How can I remove this button?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
In OnInitDialog() , do GetDlgItem(IDHELP)->ShowWindow(SW_HIDE);
---
Shog9
Actually I use to find learning in bars when drinking really useful.
It sort of makes a language liquid. - Colin Davies, Thinking in English?
|
|
|
|
|
Thank you Shog9.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Anybody knows where i can download the OpenML SDK?
Kiddxin
|
|
|
|
|
Have you ever heard of a search engine? I recommend google. And, boy, does this lower the signal-to-noise ratio
|
|
|
|
|
Oh,I'm searching it too .
Tell me when you find it out !
Thank you !
|
|
|
|
|
|
I have an MFC MDI program using VC6. When the application starts I want the initial child window to be maximized within the frame. I've tried ModifyStyle(0,WS_MAXIMIZE); in the OnActivateView() and added cs.style |= WS_MAXIMIZE; to the beginning of PreCreateWindow(); Any other ideas?
|
|
|
|
|
I don't know if this is the correct way, but in the ActivateFrame Method I set the SW_SHOMAXIMIZED flag, this does the job just for the intial activation of the window.
<br />
void CChildFrame::ActivateFrame(int nCmdShow)<br />
{<br />
nCmdShow = SW_SHOWMAXIMIZED;<br />
CMDIChildWnd::ActivateFrame(nCmdShow);<br />
}<br />
If you have more than one window in your MDI, i have noticed it will unmaximize when you switch to a new window.. I tried to get around this by using a ModifyStyle(NULL,WS_MAXIMIZE)
<br />
void CChildFrame::OnSetFocus(CWnd* pOldWnd) <br />
{<br />
CMDIChildWnd::OnSetFocus(pOldWnd);<br />
<br />
ModifyStyle(NULL,WS_MAXIMIZE);<br />
}<br />
As I said, I don't know if this is the correct way to do it.. Its just what I figured out while I was playing.. Please let me know if you find a better way.
-Rick
|
|
|
|
|
Thank you for your help. ActivateFrame() alone works in my program without the problem you described. My view is derived from CHtmlView, which is derived from CFormView. I created two instances of the same view during runtime (that is, I selected File | New), switched between them (Window | <view number="">) and both windows stayed maximized.
|
|
|
|
|
CChildFrame::ActivateFrame() is a recomended way to do this. I don't know if your code in CChildFrame::OnSetFocus() will do anything usefull however.
With MDI only one window is ever maximized at a time. When you switch to another window, the current window is restored to its normal size and then the new window is maximized. This is all a pain in the backside as far as I'm concerned and I assume it has something to do with the early Win 3.x MDI implementation.
One of the problems with this is that you can see the windows flash to restored and then maximized size as you change MDI windows and open and close windows. This flashing varies across different windows versions.
In my CChildFrame::ActivateFrame() in ED for Windows (see sig) I wrap the call to CMDIChildWnd::ActivateFrame() in pMDIClient->SetRedraw( FALSE/TRUE ) calls.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hi, I'm a newbie to MFC.
I have an MDI with CFormView as my base class. I can't find the ActivateFrame() function.
Someone suggested I try this in CMyFormView::OnInitialUpdate()
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit(FALSE);
but this still doesn't work.
Any suggestions?
Cheers
|
|
|
|
|
Kash wrote:
ActivateFrame() is a member of CMDIChildWnd. The Help will tell you this. To access it you need to derive a class from CMDIChildWnd. This is usually named CChildFrame.
Then you can use CChildFrame::ActivateFrame()
If you want to get at the MDI Client Window inside this then use: CWnd* pMDIClient = GetParent();
Make sure you call CMDIChildWnd::ActivateFrame() from within your CChildFrame::ActivateFrame().
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
I've used it in PreCreateWindow in the ChildFrm and it works great. cs.style |= WS_MAXIMIZE. I placed it after the CMDIChildWnd::PreCreateWindow( cs ); Perhaps something else is confusing it.
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
I didn't put it in that class, and that's why it probably did not work. Thanks for your suggestion.
|
|
|
|
|