Results 1 to 5 of 5

Thread: How to share files

  1. #1

    Thread Starter
    Addicted Member cheesebrother's Avatar
    Join Date
    Jul 2011
    Posts
    153

    How to share files

    A thing which i've discovered with vb2010 is that you can't share files like a form or something that way it comes at least. If you attach a form or usercontrol from a different folder it will automatically copy it into the current project folder and then save to that. How can i stop vb from doing this? It won't always be but in this case i need to share a few forms among multiple projects and it would be a royal pain to have to copy them each time manually.
    Hooked for good.

  2. #2
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    Re: How to share files

    Compile the forms into a separate library (.dll) and refrence that library from each project that needs those forms.
    "Ok, my response to that is pending a Google search" - Bucky Katt.
    "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
    "Before you can 'think outside the box' you need to understand where the box is."

  3. #3
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,470

    Re: How to share files

    the library idea is key to code reuse

    but remember that each alteration to a library function will affect all other programs that use it

    you will not notice until you need to rebuild a program.. at which point the function will suddenly not do what you expected

    so keep an eye on the versions and what you break each time you upgrade a version

    here to talk

  4. #4

    Thread Starter
    Addicted Member cheesebrother's Avatar
    Join Date
    Jul 2011
    Posts
    153

    Re: How to share files

    It's not like i'm reusing code within several different programs it's just that i've a rather large program. What i've been doing in vb6 is have each form (each is a seperate data editor) in its own project. That way i can work on one part of the program in one project and then it will also be changing the main project, that's the one where everything's connected and it all works. I'm not opposed to using .dlls my only concern is, you don't have to register them on computers do you? I'm asking this because this project is being worked on by multiple people over a network. Also, can usercontrols can be compiled to a .dll too? Even better, can i have a project of all my usercontrols, make on big dll, reference the one dll and have all the controls for my project? Thanks for replying and giving help.
    Hooked for good.

  5. #5

    Thread Starter
    Addicted Member cheesebrother's Avatar
    Join Date
    Jul 2011
    Posts
    153

    Re: How to share files

    I ended up answering my own question (at least i'm pretty sure) as to whether you can have usercontrols in dlls. I've now run into a new problem. I've made a class library project and i've got a usercontrol in it. My problem is that i can't do anything with graphics whatsoever. I've attached it so that everybody can check it out to see what need fixing. By graphics i mean everything from a graphics object to a color. Another problem i had was when i had another project attached to test my control with (it said to do this). It worked fine (except for the graphics issue) and i was able to drop my control onto the other project's form. When i tried to run it i got an error which said that the control's version of framework was different or something. Does anybody know what happened there? I'm completely new to the concept of sharing my code with .dlls but i really like it.
    Attached Files Attached Files
    Hooked for good.

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