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. COM
  4. C# & mswinsock.ocx

C# & mswinsock.ocx

Scheduled Pinned Locked Moved COM
csharphelpcomtutorial
2 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:

    M 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:

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      Don't use this control in C#. Instead, use the System.Net.Sockets.Socket class, or the TcpClient, UdpClient, TcpListener classes which are a little more friendly to use. The data you get from the socket will be in raw bytes. You will need to use one of the System.Text.Encoding classes to turn text from the byte-oriented wire format into a string. As a starting point, try Encoding.Default.

      Stability. What an interesting concept. -- Chris Maunder

      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