|
Hi ,
What is the best way for working with hardware in VC++?
Please help me,
Thanks.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
i doubt that you will get any answers with this question, please post what are you trying to do, which hardware do you want to work with?
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Hi dSolariuM,
With which hardware (mouse,keyboard...)
and what do you need?
|
|
|
|
|
Hi!
I have made menu item dynamically, by CWnd::InsertMenu
I don't know how to add command handlers to new items, which
I create dynamically.
Can you help me?
Thanks.
|
|
|
|
|
Just add WM_COMMAND handlers using the id of the menu you created. Keep track of the ids.
Nibu thomas
Software Developer
|
|
|
|
|
The problem is that I don't know the ID of my command at compile-time.
I'm reading menu data from database and building menu dynamically at run-time.
So event handlers must be set at run-time also.
|
|
|
|
|
You can override OnCommand and handle the menu events. For more info look up OnCommand in MSDN .
Nibu thomas
Software Developer
|
|
|
|
|
you can use ON_COMMAND_RANGE(id, idLast, memberFxn) to handle a rande of id's.
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
maybe it is some helpful to you
/////////In the h File/////////////
afx_msg void Ontest();
/////////In cpp file//////////
#define IDC_TEST 1000
ON_COMMAND(IDC_TEST,Ontest)
...
...
CMenu* MainMenu = AfxGetApp()->m_pMainWnd->GetMenu();
MainMenu->GetSubMenu(0)->InsertMenu(-1, MF_BYPOSITION, IDC_TEST, TEXT("&My menu"));
DrawMenuBar();
void CAnswerView::Ontest()
{
MessageBox("test");
}
|
|
|
|
|
Hi,
I use PuttY for establish connection between two PC. connection establish using SSH on port 22. I establish connection, but problem occur in authentication.
error message is
server disconnected
type 2(SSH_DISCONNECT_PROTOCOL_ERROR)
Pls provide solution for this error. so I will authenticate and able to access PC.
Regards
kedar
Girish
Software Developer
|
|
|
|
|
This is Visual C++ / MFC forum, how do you expect to get an answer here.
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
I need to authenticate user with their name & password before displaying the video from webcam in different dialog (IDD_LOCAL_DIALOG).
When I close my IDD_LOCAL_DIALOG my webcam sill capturing video.
How can I stop capturing video from webcam?
JAYARAJ
|
|
|
|
|
J5121982 wrote: How can I stop capturing video from webcam?
did you try to unplug the webcam
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
|
NO.
I just close my video capturing dialog i.e IDD_LOCAL_VIDEO.
i noticed that my webcam indicator light in on.
JAYARAJ
|
|
|
|
|
Hi!
I have the following problem:
I'm making dynamic menu this way:
CMenu* MainMenu = m_pMainWnd->GetMenu();
MainMenu->InsertMenu(-1, MF_BYPOSITION, 1, TEXT("&My menu"));
But after the program does this, the menu appears only after I
change something in my window, for example move mouse over menu.
The command: m_pMainWnd->UpdateWindow(); doesn't help.
So, what should I do?
Thanks for any help!
|
|
|
|
|
Call DrawMenuBar() ...
Nibu thomas
Software Developer
|
|
|
|
|
use DrawMenuBar.And this link maybe it is some helpful to you
http://www.codeproject.com/menu/newmenuxpstyle.asp
|
|
|
|
|
i want to query to a particular URL so is there any method for get http request to particular url in anybody have idea please share with me.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
this url might useful for you
http://www.codeproject.com/internet/getwebfile.asp
Vivek.S
You only have to do a very few things right in your life so long as you don't do too many things wrong.
|
|
|
|
|
Hi!
Im using postmessage to automatically clicked a certain button IDC_EDIT_TEXT ( AfxGetMainWnd()->PostMessage(WM_COMMAND,IDC_EDIT_TEXT); ) which will open a new dialog.
But how will i know which button was clicked inside this new dialog?
|
|
|
|
|
One simple thing you can do is that to create a control of the button which was clicked and then check the caption on that button.
In this manner you can get the caption of the button and do anything that you want to do on that control
Does this solver your problem
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
lorey wrote: Im using postmessage to automatically clicked a certain button IDC_EDIT_TEXT ( AfxGetMainWnd()->PostMessage(WM_COMMAND,IDC_EDIT_TEXT); ) which will open a new dialog.
Since you are posting the message through code why don't just pass the id of the button to the constructor of the new dialog to indicate which button was pressed.
Nibu thomas
Software Developer
|
|
|
|
|
Hello all MFC Gurus
I have a problem in creating a spin button control.
I want to create an edit box & spin button dynamically. The problem is that both are getting created but only edit box is visible when I change the position of spin button control using MoveWindow it is visible. But when clicked on Up & down Arrow of spin button the edit box values are not getting changed. Following is what i have done. Someone please help me
dwStyle = ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_LEFT | ES_NOHIDESEL;
BOOL bCreated = m_pInPlaceEdit->Create(dwStyle, rCellRect, pParentWnd, uiResourceID);
bool b = m_spinCtrl.Create(WS_CHILD|WS_VISIBLE, CRect(0,0,0,0), m_pInPlaceEdit, 123);
m_spinCtrl.MoveWindow(5, 10 , 15 , 20); //just checking whether the control is created or not
m_spinCtrl.SetRange32(0, 72270);
m_spinCtrl.SetBuddy(m_pInPlaceEdit);
Thank you
|
|
|
|
|
m_Spin1.SetRange32(0, 72270);
m_Spin1.SetBuddy(GetDlgItem(IDC_EDIT1));
void Answer::OnDeltaposSpin1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMUPDOWN pNMUpDown = reinterpret_cast<lpnmupdown>(pNMHDR);
SetDlgItemInt(IDC_EDIT1,m_Spin1.GetPos());
*pResult = 0;
}
|
|
|
|