Results 1 to 6 of 6

Thread: Comport on VB.net

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Location
    Thailand
    Posts
    13

    Thumbs up Comport on VB.net

    I use mscomm for VB6 to get value from com port (serial port)
    but vb.net I can't register mscomm32.ocx to use on vb.net.
    If I install VB6 on computer I can add mscomm32.
    Can help me? Please send solution...
    Thank you very much
    www_vb_ok

  2. #2
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Lightbulb

    If the DLL is installed on the machine you can just open the VB6 project in VB.NET and it will convert it. Sure it will still use the DLL to look at the COM port, but you'll gain all the .NET extras.

    I don't know if that is the answer you were looking for or not. I've never talked to a COM port before.
    ~Peter


  3. #3
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I think I found exactly what you need to get started.
    Here is a direct link to an exe file that has the code.
    http://download.microsoft.com/downlo...SerialComm.exe
    It is from the MSDN magazine, October issue. There was a whole article about using P/Invoke to develp a .net base class library for serial device communications.

    Here is the article:
    http://msdn.microsoft.com/msdnmag/is...m/default.aspx

    Hope that helps you out.

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Location
    Thailand
    Posts
    13

    Thumbs up Thank you all answer

    Thank you all answer.
    I will try it.May I ask one question if I use mscomm.ocx from
    vb6 and run program on vb.net. Can I use library from vb6 without install vb6.
    thank you very much.
    www_vb_ok

  5. #5
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Why would you want to use the old com component? Did you read that article I gave you?
    The library uses Platform Invocation Services to interact with the Win32 API directly. Application programmers can use the library from any .NET language through inheritance; the article explores examples written in C# and Visual Basic .NET.

  6. #6
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    Hi,

    just been reading this(and the article!) and i'm about to start designing an app to read data from a serial input. Was just wondering if anybody else had had to do this with vb.net that could give me some help.

    Cheers
    Nick
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

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