|
Nishant Sivakumar wrote: What puzzles me is why people opt for a Computer Science course and then don't want to write code.
They think learning computer programming is easy and earns big bucks.
-Prakash
|
|
|
|
|
pvatanpour wrote: Witch paragraph is the largest one
How do you know she's a witch ?
Sorry, I don't usually make fun of people who can't spell, especially people who don't speak English. However, more than anything, you need to do your own homework, and you need to learn to look things up on the web. There are a million sites only a google away with all the info you need to do this stuff.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
And, should he suffer the paragraph to die?
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I'm trying to detect if I currently have a connection to the network either over LAN or wireless. If I use IsNetworkAlive, it returns TRUE even if the wireless card is removed from the machine, there is no cable in the wired adapter and there are no active dialup connections. If I disable the wired LAN adapter from control panel, the function works as expected.
Any ideas on how I can test for network TCP/IP connectivity without disabling any adapters? IsDestinationReachable won't work for me because the application will be run behind a firewall.
Thanks
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Is this of any help?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
That's what I've been using for a reference, none of the other methods really seem to apply to me.
modified 12-Jul-20 21:01pm.
|
|
|
|
|
How can I do to include ActiveX Controls to a MFC DLL Project, because when I do that in a dialog and execute this, the dialog isn`t show, thanks
|
|
|
|
|
|
|
# Improve performance and ability to work directly with hardware
# Fit into the real world
This two are more important for me as i work in Embedded domain
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
Hello there,
I have a dialog based application which has two classes, CMainWindow and CChildWindow. I want to create the ChildWindow from the MainWindow, from inside a thread.
My code snippet.
static UINT CMainWindow::_ShowChildWindow(LPVOID parameter)
{
CMainWindow *mainWind = (CMainWindow*) parameter;
mainWind->ShowChildWindow();
return 0;
}
CMainWindow::ShowChildWindow()
{
m_childwindow = new CChildWindow();
m_childwindow->Create(IDD_CHILDWINDOW);
m_childwindow->ShowWindow(SW_SHOW);
}
CMainWindow::OnButtonShow()
{
AfxBeginThread(_ShowChildWindow,this);
}
The newly created window just blinks and vanishes.
Please help me!
Regards
|
|
|
|
|
you need a message loop. See CWinThread::Run for more information.
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
Hello there,
I have a dialog based application which has two classes, CMainWindow and CChildWindow. I want to create the ChildWindow from the MainWindow, from inside a thread.
My code snippet.
static UINT CMainWindow::_ShowChildWindow(LPVOID parameter)
{
CMainWindow *mainWind = (CMainWindow*) parameter;
mainWind->ShowChildWindow();
return 0;
}
CMainWindow::ShowChildWindow()
{
m_childwindow = new CChildWindow();
m_childwindow->Create(IDD_CHILDWINDOW);
m_childwindow->ShowWindow(SW_SHOW);
}
CMainWindow::OnButtonShow()
{
AfxBeginThread(_ShowChildWindow,this);
}
The newly created window just blinks and vanishes.
Please help me!
Regards
|
|
|
|
|
you dont have the message pump in the _ShowChildWindow
i.e.
MSG msg;<br />
<br />
while (GetMessage(&msg, NULL, 0, 0)) <br />
{<br />
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) <br />
{<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}<br />
}
-Prakash
|
|
|
|
|
Hello Prakash,
It works the window pops up and stays. But it does not receive any key events. what could be the problem?
Regards
|
|
|
|
|
Can you dump the code in the thread funtion here?
Probably the keyboard events are not translated.
-Prakash
|
|
|
|
|
Hello Prakash,
Here is the code snippet.
m_chatWindow = new CChatWindow(this);
m_chatWindow->Create(IDD_DIALOG1,GetDesktopWindow());
m_chatWindow->ShowWindow(SW_SHOW);
MSG msg;
HACCEL haccel;
LoadAccelerators(AfxGetInstanceHandle(),AfxGetAppName());
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(m_hWnd, haccel, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
Regards
|
|
|
|
|
Hello Prakash,
Here is the code snippet.
m_chatWindow = new CChatWindow(this);
m_chatWindow->Create(IDD_DIALOG1,GetDesktopWindow());
m_chatWindow->ShowWindow(SW_SHOW);
MSG msg;
HACCEL haccel;
haccel =
LoadAccelerators(AfxGetInstanceHandle(),AfxGetAppName());
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(m_hWnd, haccel, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
Regards
|
|
|
|
|
vyjesh wrote: if (!TranslateAccelerator(m_hWnd, haccel, &msg))
The problem is with the m_hWnd, i guess i overlooked that.
replace m_hWnd with m_chatWindow->m_hWnd
and let me know if it worked.
-Prakash
|
|
|
|
|
Hello prakash,
It did not work. But I got the problem solved by this way
m_chatWindow = new CChatWindow(this); m_chatWindow->Create(IDD_DIALOG1,GetDesktopWindow());
m_chatWindow->ShowWindow(SW_SHOW);
m_chatWindow->RunModalLoop(); //this solved problem.
Regards
|
|
|
|
|
oh cool, I am kinda more conversant with win32. Good that you solved it.
RunModalLoop() kinda does what we were doing before but maybe in a correct way.
-Prakash
|
|
|
|
|
Hello,
I've just installed Visual Studio 2005 and eagerly I converted the C++ project I'm working on, from Studio 2003 project format to Studio 2005 one.
But I can't get the project to compile. Visual Studio 2005 compiler has been made more ISO compliant so it no longer accepts implicit int declaration.
Thus, I need to convert my project back to Studio 2003 format. But I don't know how.
Can someone help?
Thanks
|
|
|
|
|
Your 2003 sln file should still be in your directory. I think all you need to do is load that instead of the converted 2005 sln file (and delete it altogether if you don't want to eventually upgrade) and you should be go to go.
|
|
|
|
|
In the updrade log generated by VC 2005 it is said there is a backup sln file in the project directory.
It is called myproject.sln.old but I can't find it even in the hidden files.
Do you have any idea?
|
|
|
|