Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# & mswinsock.ocx

C# & mswinsock.ocx

Scheduled Pinned Locked Moved C#
csharphelpcomtutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shahin77
    wrote on last edited by
    #1

    Hi guys, This activex control has optionals parameters for GetData method: this.axWinsock1.GetData(ref object data,object type,object maxlen) i tried these: object rec= string.Empty; object type = 0; object maxlen = 0; this.winsock.GetData(ref rec, type, maxlen); or object rec= string.Empty; object type = string.Empty; object maxlen = string.Empty; this.winsock.GetData(ref rec, type, maxlen); but all i get is "Unsupported variant types" error message, do you know how to call this getdata method in c#? i know if you call it in vb.net you dont need to pas optional parameteres. Please help:confused:

    E 1 Reply Last reply
    0
    • S Shahin77

      Hi guys, This activex control has optionals parameters for GetData method: this.axWinsock1.GetData(ref object data,object type,object maxlen) i tried these: object rec= string.Empty; object type = 0; object maxlen = 0; this.winsock.GetData(ref rec, type, maxlen); or object rec= string.Empty; object type = string.Empty; object maxlen = string.Empty; this.winsock.GetData(ref rec, type, maxlen); but all i get is "Unsupported variant types" error message, do you know how to call this getdata method in c#? i know if you call it in vb.net you dont need to pas optional parameteres. Please help:confused:

      E Offline
      E Offline
      Ed Poore
      wrote on last edited by
      #2

      You might be able to pass a null value as the optional parameter.  Alternatively you might want to look at the System.Net.Sockets class of the framework which does essentially the same thing except that it's more powerful and it's the proper .NET way of reading and writing data across Sockets.

      Sig cops got me...

      S 1 Reply Last reply
      0
      • E Ed Poore

        You might be able to pass a null value as the optional parameter.  Alternatively you might want to look at the System.Net.Sockets class of the framework which does essentially the same thing except that it's more powerful and it's the proper .NET way of reading and writing data across Sockets.

        Sig cops got me...

        S Offline
        S Offline
        Shahin77
        wrote on last edited by
        #3

        Null is not working, im done with this if i just know what to send for this.:doh:

        E 1 Reply Last reply
        0
        • S Shahin77

          Null is not working, im done with this if i just know what to send for this.:doh:

          E Offline
          E Offline
          Ed Poore
          wrote on last edited by
          #4

          I would take a look through the documentation and try and find out what it expects or what the values default to if not supplied. In VB there's usually a default setting provided for the optional parameters, try using that.

          Sig cops got me...

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups