Results 1 to 3 of 3

Thread: *RESOLVED* [2.0] Properties and methods of dll not being exposed

  1. #1

    Thread Starter
    Addicted Member A.P.Gumby's Avatar
    Join Date
    Oct 2005
    Location
    Outside the assylum
    Posts
    147

    Resolved *RESOLVED* [2.0] Properties and methods of dll not being exposed

    Hi,

    After 10 years of vb and c I am making the transition to C#.

    First project is to write a dll.

    I am using visual studio 2005. The only tutorials that I could find were for 2003 but I basically followed the instructions as given.

    I have built the dll and I am now creating a form within the solution in order to test my dll.

    I have created a reference to the dll but intellisense is not showing any of the properties or methods despite the fact that the object browser shows the public and private properties of my dll.

    The basic code structure of the dll is as follows :

    VB Code:
    1. using System;
    2. using System.Collections.Generic;
    3. using System.Text;
    4. using System.IO.Ports;
    5.  
    6. namespace CommsDLL
    7. {
    8.     public class Class1
    9.     {
    10.  
    11.         #region Events
    12.         public delegate void OnCommsError(byte byrNumber, byte byErrorCode);
    13.         public event OnCommsError CommsError;
    14.          #endregion
    15.  
    16.         #region Public Methods
    17.         public void OpenPort(byte byNumber, string strPortName, int intBaudRate)
    18.         {
    19.             //SOME CODE HERE
    20.         }
    21.  
    22.         #region Private Methods
    23.         private string[] BuildTransmitString(byte[] byData, int intDataLength)
    24.         {
    25.             //INPUT  - Board address and command as bytes
    26.             //OUTPUT - Transmit data string including checksum and any reqired transparency characters
    27.             //SOME CODE HERE
    28.         }
    29.         #endregion
    30.  
    31.     }
    32. }

    I would appreciate any suggestions to what I am doing wrong or a link to other tutorials that might help.
    Last edited by A.P.Gumby; Aug 1st, 2006 at 05:15 AM. Reason: Resolved
    Using Visual Studio 2008.
    I am not young enough to know everything - Oscar Wilde

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Properties and methods of dll not being exposed

    Once you've added a reference to the library into an application, you'll need to create an instance of the Class1 class and then you will be able to access its members, e.g.
    Code:
    CommsDLL.Class1 myClass1 = new CommsDLL.Class1();
    
    myClass1.OpenPort(byNumber, strPortName, intBaudRate);
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member A.P.Gumby's Avatar
    Join Date
    Oct 2005
    Location
    Outside the assylum
    Posts
    147

    Resolved Re: [2.0] Properties and methods of dll not being exposed

    Thanks for the reply,

    I thought that I had tried that but I obviously got the syntax wrong
    Using Visual Studio 2008.
    I am not young enough to know everything - Oscar Wilde

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