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. Visual Basic
  4. DLLs and Compiler Directives

DLLs and Compiler Directives

Scheduled Pinned Locked Moved Visual Basic
announcementsysadmindebugginghelpquestion
6 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.
  • T Offline
    T Offline
    TheComputerMan
    wrote on last edited by
    #1

    I hope this explains my problem. I have two versions of a program, not basically very different, a 'standard' and a 'pro' version that are controlled using compiler directives. My problem is that the 'standard' version uses one DLL and the 'pro' version uses a different one completely, by a different vendor. Basically zedgraph and spreadsheetgear respectively. I don't particularly want to send both to both versions of the program but I can't seem to see a method using compiler directives (?) of having one reference for one and the different reference for the other. This also extends to the setup and deployment program as that also seems to only relate back to the project assemblies as far as debug/release are concerned and does not allow for different file sets, or have I missed something?

    L 1 Reply Last reply
    0
    • T TheComputerMan

      I hope this explains my problem. I have two versions of a program, not basically very different, a 'standard' and a 'pro' version that are controlled using compiler directives. My problem is that the 'standard' version uses one DLL and the 'pro' version uses a different one completely, by a different vendor. Basically zedgraph and spreadsheetgear respectively. I don't particularly want to send both to both versions of the program but I can't seem to see a method using compiler directives (?) of having one reference for one and the different reference for the other. This also extends to the setup and deployment program as that also seems to only relate back to the project assemblies as far as debug/release are concerned and does not allow for different file sets, or have I missed something?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You can have references to both DLLs in the same project. The compiler will not add the dependency reference if none of its members are used by your code. So it doesn't create any problem, you see. And regarding Setup & Deployment, you have to create two different setup projects for your Standard and Pro versions.

      T 1 Reply Last reply
      0
      • L Lost User

        You can have references to both DLLs in the same project. The compiler will not add the dependency reference if none of its members are used by your code. So it doesn't create any problem, you see. And regarding Setup & Deployment, you have to create two different setup projects for your Standard and Pro versions.

        T Offline
        T Offline
        TheComputerMan
        wrote on last edited by
        #3

        Many thanks indeed for that. I did not realise that the reference would not be created if the DLL was not used. Two setups is not a problem. Gave you a 5 for that one! :)

        L 1 Reply Last reply
        0
        • T TheComputerMan

          Many thanks indeed for that. I did not realise that the reference would not be created if the DLL was not used. Two setups is not a problem. Gave you a 5 for that one! :)

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Even if any Type in your dependency is used in your code, the assembly is not loaded at the time of starting the process itself; it is loaded only at the point where any of its Type is first used.

          T 1 Reply Last reply
          0
          • L Lost User

            Even if any Type in your dependency is used in your code, the assembly is not loaded at the time of starting the process itself; it is loaded only at the point where any of its Type is first used.

            T Offline
            T Offline
            TheComputerMan
            wrote on last edited by
            #5

            Thanks again. Just one final question, does this also apply to Forms in the project, i.e. if a form is not referenced in code because of the compiler directives it does not get assembled into the exe?

            L 1 Reply Last reply
            0
            • T TheComputerMan

              Thanks again. Just one final question, does this also apply to Forms in the project, i.e. if a form is not referenced in code because of the compiler directives it does not get assembled into the exe?

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Yes, it applies to Form class too. As far as the Runtime is concerned, Form is just a Type, it gets no special treatment from the Runtime.

              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