CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Winsock: Div by Zero Error

    I am using someone's winsock module that gives me my ip and hostname. Whether or not it is imperative that you know the source, I am not sure. Anyways, when I run the program in vb it has no problems and runs as expected but... theres always a but... when I compile it and then run it my program doesnt work. Windows pops up one of those cute little windows to tell me...

    Error Div by Zero

    If anyone can help I would appreciate very much. And if sending you the source will help... please just ask.

    [email protected]


  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Winsock: Div by Zero Error

    Taking a look at the source code wouldn't be a bad idea. I've written several applications using the winsock, including one to get the hostname and ip, but never encounterd such error. My guess is that the program does some calculations wich cause the error. Try posting (or mailing) the COMPLETE code, and I'll have a look.

    Tom Cannaerts
    [email protected]

    The best way to escape a problem, is to solve it.
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Winsock: Div by Zero Error

    When compiled your code, and running, all works fine, but I took a look at the code and found only 2 divisions, so the problem is in one of them (or both)

    public const WS_VERSION_Major as long = WS_VERSIONREQD \ &H100 And &HFF&
    ' this will give WS_VERSION_MAJOR the value = 1, so the problem isn't here
    ' however, &h100 and &hff& equals 0. Wich can have led to the error



    The other division is wParam \ &h100 and &hff&


    Tom Cannaerts
    [email protected]

    The best way to escape a problem, is to solve it.
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured