Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2006-05-09
15
Medium Priority
?
252 Views
Last Modified: 2010-04-23
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
0
Comment
Question by:mikepj
  • 7
  • 7
14 Comments
 
LVL 9

Accepted Solution

by:
sk33v3 earned 500 total points
ID: 16641961
You can turn your common code into a .Net Class library.
0
 
LVL 2

Author Comment

by:mikepj
ID: 16642162
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?
0
 
LVL 9

Expert Comment

by:sk33v3
ID: 16642206
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?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:mikepj
ID: 16642233
i want to be able to have more than one project able to use the latest copy of these files.
0
 
LVL 9

Expert Comment

by:sk33v3
ID: 16642270
Have you tried adding a second project to your current project? File | Add | Existing project
0
 
LVL 2

Author Comment

by:mikepj
ID: 16642532
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.)
0
 
LVL 9

Expert Comment

by:sk33v3
ID: 16642587
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?
0
 
LVL 2

Author Comment

by:mikepj
ID: 16642946
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...

0
 
LVL 9

Expert Comment

by:sk33v3
ID: 16643258
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.
0
 
LVL 2

Author Comment

by:mikepj
ID: 16643338
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?

0
 
LVL 9

Expert Comment

by:sk33v3
ID: 16643383
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.
0
 
LVL 2

Author Comment

by:mikepj
ID: 16643543
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
0
 
LVL 9

Expert Comment

by:sk33v3
ID: 16643655
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.
0
 
LVL 2

Author Comment

by:mikepj
ID: 16643802
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
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Integration Management Part 2
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question