|
Just add a WM_PAINT handler.
Nibu thomas
Software Developer
|
|
|
|
|
Thanks
but it will refresh the form and pictrebox, how can i
cause only the picturebox to be refreshed. Any idea
how to obtain drawing handle for picturebox, little code
will be helpful for me.
Regards
Masood
|
|
|
|
|
If you want to do stuff like that, subclass the picturebox and handle WM_PAINT . Don't write picture box painting code inside dialog WM_PAINT handler.
Nibu thomas
Software Developer
|
|
|
|
|
Add WM_PAINT and this function OnPaint
You can use handle dc(CPaint dc(this)
dc.line..
dc.textout
|
|
|
|
|
Thanks for providing code
would not it draw the line/text on form,
i want to draw on picturebox, is there any way to
generate paint event for picturebox as provided
in vb, c# etc.
Regards
Masood
|
|
|
|
|
Hi Engineer Masood,
I m not sure because i dont test this suggestion but
I think you can derived from one class that you need and then insert wm_paint in the derived class
|
|
|
|
|
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
|
|
|
|