Link to home
Start Free TrialLog in
Avatar of mikepj
mikepjFlag for Canada

asked on

easy but urgent: how can i set up some .vb files for use as a bunch of shared files for various projects

how can i split out some .vb files for use as a bunch of shared files?  

i have some files that i plan to use for several projects.  i want there to be only one copy of those files.  

here's what i have done so far:

1.  movd these files that were going to be shared into a folder like c:\prj\shared\
2.  removed the shared files from the project
3.  added all the .vb files from c:\prj\shared to the project (for easy access)

strangely, VB.NET 2003 then COPIED all those files into the directory structure of the project:

C:\Prj\SW\Src30\CE\

then i removed the files it had copied (undoing "step 3" (see above)).

then i added a Reference to c:\prj\shared\ in the project properties...figuring then it would see the files and i could compile even though they weren't part of the project.  didn't work...it wouldn't compile because the functions in the shared files were not visible.

i use this kind of unofficial "shared files" scheme for all my other languages/projects...how can i use a simple scheme like that with VB.NET 2003???

HELP!

thank you!
mp
ASKER CERTIFIED SOLUTION
Avatar of sk33v3
sk33v3

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mikepj

ASKER

thank you for your reply!  i suppose that won't be possible because it's for CE/Pocket PC...do you know the answer to that?
Avatar of sk33v3
sk33v3

Do you want to use these files as a template or as live connections to the files? IE you can create a project based off of them or when you open a previous project they are actually part of that project?
Avatar of mikepj

ASKER

i want to be able to have more than one project able to use the latest copy of these files.
Have you tried adding a second project to your current project? File | Add | Existing project
Avatar of mikepj

ASKER

have tried to do as you suggest but it always wants to start with a new Solution.

looked into the class library but:

- i'm not exactly sure what that entails (COM?  some kind of assembly?)
- i didn't want to add extra complexity to the application

(it's starting to look like this is simply not worthwhile.)
Creating a class Library is like creating an ActiveX component. However the class library is not like a traditional COM component. It does nto really add any complexity per se. It is more of an item to reduce complexity by allowing you to easily split off different portions of the project into different Libraries. Allowing say your Application developer to concentrate on making a user interface and linking that interface to a class library that someone who specializes in Network communications made. Does that make sense to you?
Avatar of mikepj

ASKER

i understand but it gets into an area i didn't want to enter...have made delphi COM stuff and used COM objects in VB and Delphi.  just have a bunch of routines (and a few classes) that i'd like to be used by several apps.  would that result in a DLL/OCX/whatever or would it be compiled into the app?  in typical microsoft fashion, they force a person into a solution like that.  for these projects, the line i most don't want to cross is making a bunch of changes to app to go this other way.

sorry for being a big grumpy...i really dislike running into microsoft roadblocks.  just want to get a job done quickly...and that is starting to look increasingly difficult.  on the other hand, i don't want the extra overhead to several sets of (nearly) identical files...

Have you tried manually modifying the vbproj file with something like notepad or ultraedit? You might try that and see if Visual studio keeps the links going properly.
Avatar of mikepj

ASKER

no.  i don't want to invite trouble by making such a move.  also am not sufficiently experienced in vs.net.

would the class library entail changes to my application in order to use the routines moved into the class?

you would need to make an imports statement to import the proper namespace. Otherthan that, there shouldn't be any need in making any other changes.
Avatar of mikepj

ASKER

gave it a try and couldn't get it to work sufficiently smoothly.  i guess i'll do it the way vb wants to do it with duplicate copies since the time and effort to get that stuff actually working.  an ugly and revolting solution but it appears to be the least of trouble.  might do it in delphi instead--a place where i _can_ share files like that.

Public Class Class1
      Public Sub Test()

      End Sub
End Class

' can't do this because it appears it needs to be in a class
' still didn't work when i declared a namespace around both these routines
Public Shared Sub MikeRoutine1()

End Sub

thank you for your prompt and ongoing help today!  it was also good collaborating with you on the pdf question earlier today.

best regards,
mp
Another option is when you update the files to make a script that goes through and updates all the other copies to keep them up to date for you. Let me see If I can play with some stuff and get something usable for you. It was most definately educational for me. I have not used ABCPDF in several years and they have added some very nice features.
Avatar of mikepj

ASKER

i've been using OneStep http://sourceforge.net/projects/onestep  (it's a build tool that works uses delphi-like scripting commands.)  i suppose i could write a program or a OneStep script to scan those files for differences but i don't think it's worth it.  besides, if a difference emerges, it couldn't possibly know what to do.  *** i'd say it's not worth your time.***  another tool i use is:  http://www.oneysoft.com/fcompare.htm   can't beat it for comparing files and migrating differences between them...
thank you for using EE
mp