Hi! I run the debugger and it shows the disassembly of my code, but no source level debugging.
What's wrong?
thanks
Quote from: Freddy on August 20, 2007, 06:50:03 AM
Hi! I run the debugger and it shows the disassembly of my code, but no source level debugging.
What's wrong?
thanks
What have you set in "Project Options" on the compiler and linker tabs?
John
I create a simple console app.
Then I go to project options, and add to debug information "full" under compiler and codeview & COFF format under linker on debug information.
I click OK, the rebuild all files, and try to debug.
It opens the disassembly, instead of steping throught source.
Solved.
I didn't know I had to check "break always" on the breakpoints tab.
Now works!
Anyway, I'll use this thread to ask something else.
While I'm debugging this code:
SOCKET sock, msock;
WSADATA wsa;
struct sockaddr_in saddr;
char buf[4096];
int len;
WSAStartup(MAKEWORD(1,1),&wsa);
sock = socket(AF_INET,SOCK_STREAM,0);
memset(&saddr,'\0',sizeof(struct sockaddr_in));
saddr.sin_family=AF_INET;
saddr.sin_port=htons(80);
saddr.sin_addr.s_addr=inet_addr("66.94.233.46");
msock=connect(sock, (struct sockaddr *)&saddr,sizeof(struct sockaddr));
if(msock==0)
return -1;
msock is always 0, and so I can't use it. Why?
I'm trying to create a simple client, using winsock.
Thanks!
msock=connect(sock, (struct sockaddr *)&saddr,sizeof(struct sockaddr));
According to MSDN returning 0 is correct for no error.
=============
Return Values
If no error occurs, connect returns zero. Otherwise, it returns SOCKET_ERROR, and a specific error code can be retrieved by calling WSAGetLastError.
=============
John