|
when u start a dialog based application from the command line, the moment u press enter a new process is created. So the new process dont have any relation with the console. But in a console based application, both the console and the new application exists in same process. Better u output the help string in a messagebox( check the regsvr32.exe application. It shows the help in message box )
nave
|
|
|
|
|
Thanks for the Reply.
Is there any way to get the HANDLE of the console where we are executing our Dlg Based Appln. I have read about AllocConsole() and GetStdHandle() but could not corelate with my problem. Plz Help
|
|
|
|
|
zxc89 wrote: Is there any way to get the HANDLE of the console
sorry i dont know. Even if there is a way what u gone do if i immediately close the console after pressing enter?
nave
|
|
|
|
|
|
hi DavidCrow,
In both of the link u give the parent application have to redirect the child applications stdout. This is not possible in his case since the parent applicaton is command prompt. He is searching for a way to redirect the output from the child process itself.
nave
|
|
|
|
|
Can anyone Help.I had tried different ways but i coulnot succeed.
|
|
|
|
|
I received the value from one class. now i need send this value to the socket at another class. how do retrieve this value from different class?
void CIPConfig::OnBnClickedButton2()
{
int level, comm;
...........
level = atoi(v_level);
comm = atoi(v_comm);
temp.Format("%d", level);
sIOSetting = temp;
temp.Format("%2d", comm);
sIOSetting+=temp;
}
now i need send sIOSetting to socket in CConfigurationView.
how do i do it?
|
|
|
|
|
u need to keep 1) a pointer of CConfigurationView in the CIPConfig class or
2) a pointer of CIPConfig in the CConfigurationView class.
nave
|
|
|
|
|
/////////////////////In IPConfig.cpp //////////////////////////////
void CIPConfig::OnBnClickedButton2()
{
CConfigurationView *pView = theApp.GetConfigureView();
int level, comm;
CString sIOSetting ="", temp;
........
level = atoi(v_level);
comm = atoi(v_comm);
temp.Format("%d", level);
sIOSetting = temp;
temp.Format("%2d", comm);
sIOSetting+=temp;
return pView->SendConfig(sIOSetting, _IO_SETTING);
}
/////////////////////////In configureationView.cpp//////////////////////
BOOL CConfigurationView::SendConfig(int nCode)
{
CString str;
str.Format("6x1%2d", nCode);
send(conn,str,5,0);
}
is it correct?
|
|
|
|
|
yijia_24 wrote: SendConfig(sIOSetting, _IO_SETTING);
but in the SendConfig function u wrote it take only one parameter. What about the sIOSetting?Dont u want to send that string data?the function should be modified as follows.
BOOL CConfigurationView::SendConfig(CString sIOSetting, int nCode)
{
....
// Send the sIOSetting
}
Everything else is ok.
nave
|
|
|
|
|
yijia_24 wrote: BOOL CConfigurationView::SendConfig(int nCode)
{
CString str;
str.Format("6x1%2d", nCode);
send(conn,str,5,0);
}
missing string argument.. and use const CString& in function argument!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
Hi,
I have been doing an application on Dialogbar.I have added some controls to it.But,My problem is that,the Buttons are appearing as if they are disabled when i run the application.How can i overcome this problem.
Thanks in advance,
Radhika.
|
|
|
|
|
radhika28 wrote: as if they are disabled when i run the application
EnableWindow()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: EnableWindow()
he he he
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
radhika28 wrote: I have been doing an application on Dialogbar.I have added some controls to it.But,My problem is that,the Buttons are appearing as if they are disabled when i run the application.How can i overcome this problem.
You should provide event handlers for these buttons, else it will appear disabled.
|
|
|
|
|
Hi,
I have declared the following event handler void OnUpdateButton1(CCmdUI *pCmdUI); and i have added the following message map ON_UPDATE_COMMAND_UI(IDC_BUTTON1, OnUpdateButton1)and i have defined the above function as follows,
void CMCDilaogbar::OnUpdateButton1(CCmdUI *pCmdUI)
{
pCmdUI->Enable(TRUE);
}
But i am still getting the button as disabled.How can i move further.
Thanks
|
|
|
|
|
radhika28 wrote: I have declared the following event handler void OnUpdateButton1(CCmdUI *pCmdUI); and i have added the following message map ON_UPDATE_COMMAND_UI(IDC_BUTTON1, OnUpdateButton1)and i have defined the above function as follows,
void CMCDilaogbar::OnUpdateButton1(CCmdUI *pCmdUI)
{
pCmdUI->Enable(TRUE);
}
But i am still getting the button as disabled.How can i move further.
Thanks
Open the dialog bar in resource view. Select the button press Ctrl + W to open the class wizard.
Select an event handler like BN_CLICKED . But make sure that you select the proper mainframe class as the class were you wish to add the event handler. Select Add function. This will add a function to the class. Click on edit code to edit the code for the button.
Now this should enable the dialog bar button. Hope this helps.
|
|
|
|
|
I have added BN_CLICKED message handler also earlier only But it the button is not enabling.other controls like edit Box,Combo Box etc are enabled.But only the buttons are not enabled.
Thanks
|
|
|
|
|
radhika28 wrote: I have added BN_CLICKED message handler also earlier only But it the button is not enabling.other controls like edit Box,Combo Box etc are enabled.But only the buttons are not enabled.
Are you adding the event handler to the correct class. For eg: you should add to the mainframe class or to the dialog bar class.
|
|
|
|
|
Hi,
I have added the BN_CLICKED message handler in the Dialog Bar class only.But i haven't done this in MainFrame class.Now i have done it.The button is enabled now.
Thanks
|
|
|
|
|
radhika28 wrote: I have added the BN_CLICKED message handler in the Dialog Bar class only.But i haven't done this in MainFrame class.Now i have done it.The button is enabled now.
There is another easy way of doing this. Just override the following function your derived CMainFrame class and you will have all controls in the dialog bar and tool bar and all menu items enabled without writing event handlers...
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
return TRUE;
} Well this would enable all buttons and menu items but of course you should write event handlers if you want to have something happen.
|
|
|
|
|
radhika28 wrote:
I have added the BN_CLICKED message handler in the Dialog Bar class only.But i haven't done this in MainFrame class.Now i have done it.The button is enabled now.
you can write ON_COMMAND_RANGE, if creating dynamic controls!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
Hi all,
i'am using vc++ in VS2005 , while debugging i'am not able to see View->Debugwindows->Callstack and Memory options in this IDE ,can any one help me in VS2005 how to use these options
mpk1979
|
|
|
|
|
|
mpk1979 wrote: i'am using vc++ in VS2005 , while debugging i'am not able to see View->Debugwindows->Callstack and Memory options in this IDE ,can any one help me in VS2005 how to use these optio
still there .. it might be under debug menu item
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|