|
Hi all,
I have an app done in MFC, but I am having some problems with the ethernet part. My app is the client end that connects perfectly fine with a server up and running. The problem I am running into is when the server is not up but I type in the IP of it. It continues to say that it is connect. The only error that I ignore is error #10035 WSAEWOULDBLOCK. (i was told that this was an "OK" error) Basically as long as the IP or host name I enter is valid it says it is connected even though there is nothing there to connect to.
How do I fix this problem so it recognize errors such as #10064 WSAEHOSTDOWN or #11001 WSAEHOST_NOT_FOUND
Can someone also please tell me to how to check if at anytime that the connection is lost, reset by peer (or any other error that occurs that will not let me send data to the server) occurs how to immediately tell the user?
Here is the code I am using:
int connection = sock->Create(0, SOCK_STREAM, FD_READ | FD_WRITE, NULL );
if (connection == FALSE)
{
int ret = sock->GetLastError();
m_Listbox.AddString("Failed to create socket");
}
else
m_Listbox.AddString("Socket Created");
int rVal = sock->Connect(servername, port) ;
if (rVal == FALSE)
{
int ret = sock->GetLastError();
if(ret == WSAEWOULDBLOCK)
{
}
else
{
m_Listbox.AddString("Didn't connect");
return;
}
}
else
m_Listbox.AddString("Connected");
Many thanks in advance
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
The error WSAWOULDBLOCK not indicate that all was right. This code is returned because you are using non-blocking sockets and the operation can't be completed(you have a pending connect). After it, you have to use select api (unless you are using WSAAsyncSelect or WSAEventSelect) to check when the operation is completed. When this occur(after connection timeout), then check the error code of the operation and you will see that the connection can't be established.
|
|
|
|
|
hi,
my application sdi with doc support. i change the title of the application on initinstance of application. after that click in the bar. the caption is changed to untitle-application name. where i capture the this event of caption change. or how to prevent the application caption change on click. any one help to me.
thanks in advance.
|
|
|
|
|
|
thank ravi. i visit us url. very nice.
once again thank u.
email : murali_utr@hotmail.com
|
|
|
|
|
I have opened image file, and create Graphics object from it.
Image image(L"myImage.png");
Graphics grImage(&image);
How can I resize myImage.png ?
yiy
|
|
|
|
|
I need to insert into a list control (with report view) another control into itself, I mean, when I introduce a new item into the report, it needs to have a progress bar (like napster, and emule). But in other column for example, I need a button. To sum up, how I may introduce CONTROLS into a listview control ??
Thank you very much !!!
MaestroProgramador.Com
Where every source code is loved like a girl.
|
|
|
|
|
See if this works:
http://www.codeproject.com/listctrl/xlistctrl.asp
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I've just installed VS .NET and I can't find any SDK samples. can anyone tell me where they are? Specifically, I'm looking for the MAPI samples including the ones providing edk.h, edkutils.lib, etc.
Don't tell me they're no longer provided...
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
"If you think education is expensive, try ignorance."
|
|
|
|
|
Have you downloaded and installed the Platform SDK as well?
Steve S
|
|
|
|
|
I haven't downloaded the SDK but then I expected to find it on the set of disks. I have looked for the samples, and it seems MS have seen fit to archive them off and not include them with the SDK anymore. So how are people supposed to find samples on one of the MS core technologies, MAPI?
I guess I should never have bothered with VS .NET, it's been nothing but trouble since I installed it. Bring back VC 6.0...
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
"If you think education is expensive, try ignorance."
|
|
|
|
|
I found that I needed to install the Exchange SDK. I installed the latest version, 2003, and it seems it needs ctl3d.h which isn't provided with VS .NET, but is provided by the original MAPI samples, the ones that have been removed from the SDK! So I included that and it got as far as then wanting rtflib.h. Can't get any further, and though this file is mentioned on MSDN as containing a core function of Exchange Server, the Exchange SDK doesn't contain it!
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
"If you think education is expensive, try ignorance."
|
|
|
|
|
Hi, I'm trying to implement a owner draw button but I don't know how to bring it to the top. I have a row of overlaping buttons, and when I try to bring one of then to top, they refreshes for left to right. Can someone help me, with this. Thanks in advance...
|
|
|
|
|
|
Hi all,
i'm looking for some info about Pager stuff in general, like what is the data format, network used to send those messages etc.
i'm familiar with SMS & GSM using AT commands and i wonder if there would something similar for pagers ?
tx
F
|
|
|
|
|
hi
i need to insert some string value in registry key. any on help to me.
thanks in advance.
|
|
|
|
|
Have a look at the RegOpenKeyEx and RegSetValueEx Windows API functions.
Hope that helps
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
I make a project then I took *.exe.When I wanted to run this project on a computer which has no visual studio.it asked me *.DLL .How could I run my exe on other computers ?
emroz
|
|
|
|
|
you need to take install pack for ur package using install shield or any application like this. or if u develop this project in vc++ means need vc++ in the other machine also.
|
|
|
|
|
I installed IntallShield but I couldn't create setup file.
I created a media which is 2.19 MB.then I setup this file on another computer but there was same problem which was about *.dll.I think I don't know how to use InstallShield.What should I do?
emroz
|
|
|
|
|
Well, you have to know what libraries you need to execute your app. Look, if you developed your app with VC++7 (.NET) and you programmed it with MFC, you'll need at least mfc70.dll as well to run it in other computer, just copying that file (and others that you may need, it depends on what did you use) in the app folder.
I hope this help you !!
MaestroProgramador.Com
Where every source code is loved like a girl.
|
|
|
|
|
Which values does the * in *.dll take? I.E. what libraries are you missing?
Emre Zorlu wrote:
I think I don't know how to use InstallShield. What should I do?
Maybe its time for some reading?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I assume that the computer asked for a name like mfc42d.dll?
This is the debug version of the mfc.
You need to make a release build on your computer (see top toolbar or menu 'projects/configurations'. This one will then work with the non-debug version of the mfc, whose dll is available almost everywhere.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Or you can have your project built in static MFC library linking mode.
If the MFC library is the only library you are using.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|