|
See this URLs :
http://www.dotnet247.com/247reference/articles/0/1537.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/windows_sockets_2_architecture_2.asp
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi all,
I am placing a MENU on a Dialog window.
And trying to enable and disable the Menu Items plus putting checkmark and radio, I am overiding the Update<menuitem-name>(... pCmdUI,...) method.
The problem is it not working, I also override the UpdatePopupMenu(...) method of CFrame by using a sample code from MSDN.
Please anybody helps me in this regard.
Dammy More
|
|
|
|
|
Update Command UI Handlers Do Not Work for Menu in dialogs.
You can use ON_WM_INITMENUPOPUP message instead of this.
See this article in msdn
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q242/5/77.asp&NoWebContent=1
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi,
I have a project I downloaded from cp and dont know why, but when I try to use some classes that are in many (8 0r 9) files, I get this message:
*.cpp(2) : fatal error C1010: unexpected end of file while looking for precompiled header directive *.cpp
I get about 10 of these when I compile. Does anyone know what this means?
Where is a good place to look up compiler and linker errors?
I have had this problem with classes Ive wrote before.
Thanks.
|
|
|
|
|
The best place to lookup errors is in the help.
This means you are attempting to use precompiled headers, but the precompiled header is not present in the files. For Wizard generated files, this is "stdafx.h".
You can turn precompiled headers off for a project in the project settings. For large projects it will slow down the compiles significantly, for small projects, the impact is negligable, though measurable.
|
|
|
|
|
It's also possible to turn precompiled headers off for separates files so the project compilation won't slow down too much. Right click on the .cpp file, choose settings, go in the C/C++ tab, select Precompiled headers category and choose Not using precompiled headers
This is a better solution when you need to disable them only for a few files in a big project
|
|
|
|
|
Joe Woodbury have detailed it.
the same you can include"stdafx.h" to solve it .
dupengfei
|
|
|
|
|
Still confusing,
Goto Project->Settings->C/C++->Precompiled Headers
Select Automatic use of Precompiled Headers.
Thanks.
The Phantom.
|
|
|
|
|
Thanks. I fixed my problem. You say precompiled header files will speed up or slow down compile?
|
|
|
|
|
When the .PCH file is being created, the compile time will take longer. Subsequent compiles will be much shorter. If, however, you have a small project, the difference will not be noticeable.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Very easy, add
#include "stdafx.h"
to the files that give those errors.
Make sure it's the first #include though.
|
|
|
|
|
Hi, i have a question abt displaying doubles. Under _MBCS the following codes work but how do i display the double under Unicode? Thanks!
char *buffer;
int decimal, sign;
buffer = _ecvt( m_Height, 5, &decimal, &sign );
AfxMessageBox(buffer);
or
int decimal, sign;
AfxMessageBox(_ecvt(m_Height, 5, &decimal, &sign);
|
|
|
|
|
|
|
How about ansi.org?
Bernd
|
|
|
|
|
|
Only compiler designers and people with a strange liking for dull reading need it anyway.
Bernd
|
|
|
|
|
hi..
can someone tell me how do i get the IP address of my own PC???
tks a lot...
With Regards
Joseph R. Thomas
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
|
|
|
|
|
....
char host[80];
gethostname(host,80);
LPHOSTENT lpHost;
lpHost = gethostbyname(host);
UINT ip = ((LPIN_ADDR)lpHost->h_addr)->s_addr;
....
|
|
|
|
|
nope...doesnt work!!!
With Regards
Joseph R. Thomas
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
|
|
|
|
|
Try initializing winsock first:
#include "Winsock2.h"
#pragma comment(lib,"Ws2_32.lib")
int main(int argc, char* argv[])
{
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested = MAKEWORD( 2, 2 );
err = WSAStartup( wVersionRequested, &wsaData );
if ( err != 0 ) {
return -1;
}
char host[80];
gethostname(host,80);
LPHOSTENT lpHost;
lpHost = gethostbyname(host);
UINT ip = ((LPIN_ADDR)lpHost->h_addr)->s_addr;
char* addr= inet_ntoa(*(LPIN_ADDR)lpHost->h_addr);
return 0;
}
John
|
|
|
|
|
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Autoconfiguration IP Address. . . : 169.254.159.128
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
PPP adapter PacNet:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 210.24.247.6
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 210.24.247.6
the codes u gave me are fetching Autoconfiguration IP Address i.e 169.254.159.128
what i need is IP Address i.e 210.24.247.6
can someone please help???
With Regards
Joseph R. Thomas
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
|
|
|
|
|
Joseph_R_Thomas wrote:
can someone please help???
The problem is you have more than one ip address. The code above will return the first.
replace h_addr in the previous examples with h_addr_list[1] to get the second.
John
|
|
|
|
|
|
but what if the program keeps on shifting from one machine to another where some machine have more than one IP addresses and soem have only one????
With Regards
Joseph R. Thomas
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
|
|
|
|