Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Sebastiani

    general purpose scanner

    Hello all, I have here an stl-based scanner/tokenizer object that some of you might find useful. It is completely free. http://flashdaddee.com/forums/attachment.php?s=&postid=97313 - Cheers Sebastian G.
  2. Sebastiani

    Thread Programming

    To check if a thread is running, use GetExitCodeThread(), ie: bool thread_active(HANDLE thread) { DWORD status; GetExitCodeThread(thread, &status); return status == STILL_ACTIVE; }
  3. Sebastiani

    CAsycnSocket issues

    Don't use MFC, personally (thank god!). But I did notice this: >>m_sConnectSocket.Send(LPCTSTR(m_strCardNumber), iLen); If m_strCardNumber is an std::string, you shouldn't be casting it to a char*, since the object doesn't define an operator char*() function (implicit conversion operator).
  4. Sebastiani

    Basic Winsock Problem.

    No, you're still off. The struct member S_addr is an unsigned long. It makes no difference. Look: struct foo { unsigned long var; }; foo bar; int sz = sizeof(bar.var); or... int sz = sizeof(unsigned long); Do you see why?
  5. Sebastiani

    Concatenate a variable to a string

    Try out a good ole C solution: char buff[256] = "Time remaining: "; char cat[256]; sprintf(cat, "%d", 101); strcat(buff, cat); printf(buff);
  6. Sebastiani

    Accessing a specific memory location

    >> IonFilipski Almost: int address = 0xffffffff; char * dangerous = (char*)address; // cast necessary >> adholioshake It doesn't matter whether you use ASM or C here. What *does* matter is the operating system you're running. Under a protected mode OS such as Windows, dereferencing the...
  7. Sebastiani

    *another* basic Winsock Problem.

    O.K. Got it. bool bind(SOCKET sock, unsigned long address, unsigned short port = 80) { sockaddr_in local; memset(&local, 0, sizeof(local)); local.sin_family = AF_INET; local.sin_port = htons(port); local.sin_addr.S_un.S_addr = htonl(address); return ::bind(sock, (sockaddr*)&local...
  8. Sebastiani

    mkdir

    Hmmm...pretty elementary stuff, are you that much of a newb? :p Post the entire program so we can see how far you got, first.
  9. Sebastiani

    Exponents don't work!

    No, you didn't listen to uolj's response, it's not a compiler error, it's a keyboard error ( ie: what you typed. ;) ). So again: >> int count=0; ...then >> for(int count=0;count<21;count++) ...declared again! Luckily, there is no side effect in this case, but still, an error's an error...
  10. Sebastiani

    Object Model Trouble

    Could be you declared a member function, but didn't define it, ie: struct foo { void bar(){ } // declared and defined void baz(); // only declared };
  11. Sebastiani

    mkdir

    #include <io.h> // for mkdir() #include <iostream> int main() { if(mkdir(&quot;C:\\MyDirectory&quot;)==0) cout << &quot;Success!&quot;; else cout << &quot;Could Not Create Directory!&quot;; cin.get(); }
  12. Sebastiani

    *another* basic Winsock Problem.

    Sorry about the typos. Corrected it should read: bool bind(SOCKET sock, unsigned long address, unsigned short port = 80) { sockaddr_in local; memset(&local, 0, sizeof(sockaddr_in)); local.sin_family = AF_INET; local.sin_port = port;//...also tried htons(port)...
  13. Sebastiani

    *another* basic Winsock Problem.

    Hi, all. Now that I have the client functioning, I would like to complete the server. The problem I am having now is with bind()ing the listening socket. Here is the code I am using: bool bind(SOCKET sock, unsigned long address, unsigned short port = 80) { sockaddr_in local; memset(&local...
  14. Sebastiani

    Exponents don't work!

    It's in math.h (and cmath).
  15. Sebastiani

    Basic Winsock Problem.

    >> IonFilipski Actually, the two are identical since S_addr is an unsigned long... Take a look: struct in_addr { union { struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b; struct { u_short s_w1,s_w2; } S_un_w; u_long S_addr; << } S_un; But after looking at my code, I saw what I had...
  16. Sebastiani

    Basic Winsock Problem.

    O.K. got it. Thanks for the suggestions.
  17. Sebastiani

    Basic Winsock Problem.

    Thanks for the reply. Unfortunately, it still fails to connect, though I don't know why. The most frustrating thing is that I did this a year or so ago without any problems. :-/ And yes, in the actual program I was using something like: hostent * host =...
  18. Sebastiani

    Exponents don't work!

    Well, let's see what you've tried. Generally a simple for() loop is sufficient.
  19. Sebastiani

    Basic Winsock Problem.

    Hi, all. I am having a problem getting connect() to complete successfully. I've tried to isolate the problem a bit, and in the below example simply use the manifest constant INADDR_LOOPBACK for simplicity. Any help would be greatly appreciated! #include <iostream> #include <winsock.h> int...
  20. Sebastiani

    _outp _inp

    You can use ReadFile/WriteFile for windows. Unfortunately, I've no experience with port communication, so that's all I can tell you...

Part and Inventory Search

Back
Top