Results 1 to 4 of 4

Thread: serial communication

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Posts
    74
    I want to create an activeX DLL.
    The DLL does not have a form to put an MScomm control on. The DLL however still have to be able to communicate trough the serial port.
    Is the best way to do this by using API? If so - where do I find information about these API's?

    Best regard/Lennart

  2. #2
    Lively Member
    Join Date
    Oct 2000
    Location
    Leicestershire; ENGLAND
    Posts
    71
    A little trick that I recently discovered...

    Create a form within your DLL and then whilst editing the form layout, select the MSComm controll and put it onto the control bar.

    Now, within your class (in the DLL project), declare a member variable as type MSComm.

    Within the Class Initialise (or wherever is appropriate),
    Set m_MyCommControl = new MSComm

    You may now reference m_MyCommControl and use it as if it were a control on a form.

    At this point, you may also delete the form that you inserted into the project, VB will remember that the MSComm control needs to be included !

    <now sit back with a smug expression before completing the project .............>

    [Edited by Orpheus on 01-09-2001 at 01:21 PM]

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Posts
    74
    I also posted this question in the general section and got the suggestion to do like this:

    'load the commcontrol without a form
    dim C1 as Object
    set C1 = CreateObject("MSCommLib.MSComm")

    then I could use the C1 as an MSComm-control






  4. #4
    Lively Member
    Join Date
    Oct 2000
    Location
    Leicestershire; ENGLAND
    Posts
    71
    There is always more than one way to skin a cat.

    Both of the options result in the same scenario; a MSComm control available as an object in your project.

    I do not believe that either method is any better than the other, however, you may find that you have to manually add the MSCommLib to your distribution with the CreateObject method, whereas the method that I described should force the Packaging and Deployment wizard, along with the Windows Installer, to pick up the MSCommLib automatically.

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