|
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
|
|
|
|
|
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
|
|
|
|