Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

How to Design a good library! I had 2 questions to ask.

Back to Forum: Tech Off
  • User profile image

    I had 2 questions. I want to design a library like this below:

    -> Chit Chat
    -> General Discussion
    ---------------------------> WenChing
    ---------------------------> Someone

    all of them are classes.


    Just say i sell this library to vendor A and wants to limit it to use WenChing class.

    Just say i sell this library to vendor B and wants to let them to use all the class.

    It depends on how much they pay us for the library - Enterprise edition, Standard edition, Professional Edition.

    I just want to use 1 dll to represent all this. I do not want to rewrite each dll to suit each vendor. Very troublesome.


    Just say i sell the library to vendor C, and they found out that in the library does not have a suitable function. I need to write a class that somehow understands it (maybe when you plug in a camera, it can understand the new branded camera and work with my dll).

    How do i achieve all this? I have limited experience to design libraries.

    Any tips?


  • User profile image

    1) Easy to do.
    You have to use a 'conditional compilation constant'. This is a constant that you define right before you compile, like 'standard', 'professional' or 'enterprise'. You can place such a constant in your Project properties box.
    In your code (I assume you use visual you have to put if-statements with a # to check which constant you used:

    #If standard Then
       [place standard code here]
    #ElseIf professional Then
       [place pro code here]
    #ElseIf enterprise Then
       [place enterprise code here]
    #End If

    You can also use 'Else' if you want.
    For more information look in your help or MSDN for: Conditional compilation.

    2) You have to be more specific. Explain your situation, with this information I can't help you.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.