|
would have loved to answer, but i dont care to experiment with MFC. MFC sucks big time. Stop using it dude! Give C++ Builder a try, and you'll never come back to VC++ for any of your UI-related tasks. Infact, the only reason VC++ is good is: fast "code-completion". Thats it. From a programmers perspective.
Bikram Singh
|
|
|
|
|
|
rigth click onto your dialog and select properties in the context menu. there, you have a property called menu. select the menu you just created (and saved with an explicit name) in the associated combobox...
there you dialog have its menu...
TOXCCT >>> GEII power
|
|
|
|
|
You'll have to associate the resources, if you have not already done that. In MSVC++, you select the dialog box properties in the resource editor, and select the menu from the dropdown Menu.
Note that you will not be able to see the menu in the resource editor - it only shows when running the program.
|
|
|
|
|
How can I make my app not get focus like On-Screen keyboard in XP.
I try to use WM_MOUSEACTIVATE with return value MA_NOACTIVATE but I can't.When I click button in my dialog,it activates.So i can't send key events to other applications(I use SendInput).
Please help me.
|
|
|
|
|
Information not enough for a good answer.
1. Use EnableWindow(hwnd,FALSE) to disable any mouse or kbd input to the window.
This is the only suggestion as of now...
Bikram Singh
|
|
|
|
|
if you want the focus to bet set at the creation of your dialog, call Cwnd::SetFocus() into OnInitDialog() and make this function return TRUE .
if you just need to set the focus on a control when doing someting into the dialog, just call SetFocus().
TOXCCT >>> GEII power
|
|
|
|
|
I think that you must call SetFocus in WM_SETFOCUS and pass its lparam to SetFocus! Is that right?
|
|
|
|
|
WM_SETFOCUS is a message, not a function. moreover, you can call SetFocus() anywhere (in a handler you created for example)
TOXCCT >>> GEII power
|
|
|
|
|
It is right, WM_SETFOCUS is a message.
When a window receive this message, it can reject its focus by calling SetFocus!
|
|
|
|
|
i need c++ source code (library) to covert bitmap file to gif file, the code is in c or c++ style, not COM or ActiveX.
thanks for any link
cheers
includeh10
|
|
|
|
|
|
Dear Friends,
I am using CAsyncSocket and CSocket for writting a server program. In AsyncSocket I am using
virtual void OnAccept(int nErrorCode);
virtual void OnClose(int nErrorCode);
virtual void OnReceive(int nErrorCode); and also in Socket I am using
virtual void OnAccept(int nErrorCode);
virtual void OnClose(int nErrorCode);
virtual void OnConnect(int nErrorCode);
virtual void OnReceive(int nErrorCode);
Also in the dlg.cpp file,
At InitDialog I am writting
m_cSocketServer.Create(4000);
m_cSocketServer.Listen();
m_cAsyncSocketServer.Create(4000);
m_cSocketServer.Listen();
Also at the Onbutton message I am checking and writting a message into a display like this
void CMFCServerDlg::OnButtonConnection()
{
// TODO: この位置にコントロール通知ハンドラ用のコードを追加してください
char DispBuf[256];
if(m_cSocketServer.Create(4000) && m_cSocketServer.Listen()){
sprintf(DispBuf, "Server Started");
AfxGetMainWnd()->GetDlgItem(IDC_STATIC)->SetWindowText(DispBuf);
}
else{
sprintf(DispBuf, "Connection Failed");
AfxGetMainWnd()->GetDlgItem(IDC_STATIC)->SetWindowText(DispBuf);
}
For other reference....
LRESULT CMFCServerDlg::OnAccept(WPARAM wParam, LPARAM lParam)
{
m_cSocketServer.Accept(m_cAsyncSocketServer);
DestroyFlag = TRUE;
return 0;
}
This is a user message send by the AsyncSocket and Socket from OnAcceptMessage....
My applicaion is very simple and with the above code it is not working. Will you please help to detect the error. Why this code is not suitable to develop a simple server.
Here, I have a dialog box with one button and a text box. Button is for to start a server and text box is nothing but to display a message that server is started.
Please help me to find out the solution.
Thanking You in advance.
Billar
|
|
|
|
|
there are few samples in MSDN (VC CD), you can learn from those samples, they are not complex.
cheers
includeh10
|
|
|
|
|
Hi includeh10
I don't have msdn. So if you can provide the such samples, it will be a great help to me.
Waiting for your reply.......
Billar
|
|
|
|
|
I didn`t get your question. where did it not work? Do u hawe IIS or PWS? Change the port ? I`m just guessing, cause i don`t know where is the problem. So the me the detail
|
|
|
|
|
Dear Friends,
I am using CAsyncSocket and CSocket for writting a server program. In AsyncSocket I am using
virtual void OnAccept(int nErrorCode);
virtual void OnClose(int nErrorCode);
virtual void OnReceive(int nErrorCode); and also in Socket I am using
virtual void OnAccept(int nErrorCode);
virtual void OnClose(int nErrorCode);
virtual void OnConnect(int nErrorCode);
virtual void OnReceive(int nErrorCode);
Also in the dlg.cpp file,
At InitDialog I am writting
m_cSocketServer.Create(4000);
m_cSocketServer.Listen();
m_cAsyncSocketServer.Create(4000);
m_cSocketServer.Listen();
Also at the Onbutton message I am checking and writting a message into a display like this
void CMFCServerDlg::OnButtonConnection()
{
// TODO: この位置にコントロール通知ハンドラ用のコードを追加してください
char DispBuf[256];
if(m_cSocketServer.Create(4000) && m_cSocketServer.Listen()){
sprintf(DispBuf, "Server Started");
AfxGetMainWnd()->GetDlgItem(IDC_STATIC)->SetWindowText(DispBuf);
}
else{
sprintf(DispBuf, "Connection Failed");
AfxGetMainWnd()->GetDlgItem(IDC_STATIC)->SetWindowText(DispBuf);
}
For other reference....
LRESULT CMFCServerDlg::OnAccept(WPARAM wParam, LPARAM lParam)
{
m_cSocketServer.Accept(m_cAsyncSocketServer);
DestroyFlag = TRUE;
return 0;
}
This is a user message send by the AsyncSocket and Socket from OnAcceptMessage....
My applicaion is very simple and with the above code it is not working. Will you please help to detect the error. Why this code is not suitable to develop a simple server.
Here, I have a dialog box with one button and a text box. Button is for to start a server and text box is nothing but to display a message that server is started.
Please help me to find out the solution.
Thanking You in advance.
Billar
|
|
|
|
|
do you have an error at compile time or run time ?
what does it say to you ?
TOXCCT >>> GEII power
|
|
|
|
|
Dear Freinds,
Thank you all for the information and kind response. MY problem is solved. Actually the problem was at the client side. I was not initializing the socket at the client side at InitInstance.
But now it is solved.
Thank you once again for everything.
Bye
Billar
|
|
|
|
|
when you first run a MDI app you have the empty space, the dark gray background. I'm wondering if it's possible to draw in that space. For example is it possible to paint it white and place text, perhaps a bitmap, or just paint it white period.
thanks!
|
|
|
|
|
Yep, sure can. The MainFrame (or CMDIFrameWnd) will have a m_wndClientArea variable. From that you can either subclass that window and do what you want, or create a sub-control to place onto it. I used the sub-control method to create a "start page" that had a MRU list and stuff that really wasn't a document.
--
Joel Lucsy
|
|
|
|
|
I guess I'm a little ignorant on implementing that solution. Do you have a sort of "sub-control for dummies" article on what you did? That is pretty much what I am looking for.
Thanks!
|
|
|
|
|
|
|
How do i go about adding a skin to windows? For example, make the window background and it's button controls have picture in them.
|
|
|
|