|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Intergating Multiple VB6.0 Projects into one: Project GroupingHello,
We have done some developments using VB6.0. What we have done is created multiple projects - say: a) Exams b) Enrollments c) HR Now each of a,b and c are 3 different Projects !!! ... What I wanna do is - integrate them into 1 one project - i.e. do Project Grouping and then dynamically call forms of a - while in b and so on !!! Any ideas - as to how do we go about doing the same !!! PLEASE HELP !!!
Show quote
Hide quote
"Ani" <A**@discussions.microsoft.com> wrote in message It's not just a matter of creating a project group which includes these 3 news:98566613-F5C7-4484-8E37-5CC279E9FCFF@microsoft.com... > Hello, > > We have done some developments using VB6.0. What we have done is created > multiple projects - say: > a) Exams > b) Enrollments > c) HR > > Now each of a,b and c are 3 different Projects !!! ... What I wanna do > is - > integrate them into 1 one project - i.e. do Project Grouping and then > dynamically call forms of a - while in b and so on !!! > > Any ideas - as to how do we go about doing the same !!! > projects. Actually, that has nothing to do with it. You need to re-write all 3 of these apps to interact with one another. For example, assuming all 3 projects are currently standard EXEs, you could make them all ActiveX EXEs. Then, you need to provide at least one Public class module that the other 2 projects could instantiate. Hello Mike,
Thanx for your reply !!! Yes - we have 3 or more projects as standard EXE's ... Each projects have quite a no. of forms ... You suggest us to create a New ActiveX Project - and add the forms of all the existing projects into the ActiveX !!! In the 3 projects the forms might be of similar names and so could the global functions, etc ... wud that not cos a problem !!! Please elaborate - cos I had read something about the ActiveX as a solution - but am not full aware as to how do I do it !!! Thanx, Ani Show quoteHide quote "MikeD" wrote: > > "Ani" <A**@discussions.microsoft.com> wrote in message > news:98566613-F5C7-4484-8E37-5CC279E9FCFF@microsoft.com... > > Hello, > > > > We have done some developments using VB6.0. What we have done is created > > multiple projects - say: > > a) Exams > > b) Enrollments > > c) HR > > > > Now each of a,b and c are 3 different Projects !!! ... What I wanna do > > is - > > integrate them into 1 one project - i.e. do Project Grouping and then > > dynamically call forms of a - while in b and so on !!! > > > > Any ideas - as to how do we go about doing the same !!! > > > > It's not just a matter of creating a project group which includes these 3 > projects. Actually, that has nothing to do with it. You need to re-write > all 3 of these apps to interact with one another. For example, assuming all > 3 projects are currently standard EXEs, you could make them all ActiveX > EXEs. Then, you need to provide at least one Public class module that the > other 2 projects could instantiate. > > > I don't know anything about what kinds of projects you have - standard exe?
And what you want to achive by merging them? If you simply want to use a form that you created in one project in another project, you can always add the file (maybe copy it first, if you'll need to make some changes). If you have some files that can be used in several project, you could create a pool of "public" files by first removing them from the project, moving them to a common folder and then adding them from that location. We make heavy use of this in our development team, e.g. we have a module that handles registry access, and nearly everyone uses it. However, this can become tricky if the files heavily depend on each other (and were originally intended only to run within their own project). Robert Show quoteHide quote "Ani" <A**@discussions.microsoft.com> wrote in message news:98566613-F5C7-4484-8E37-5CC279E9FCFF@microsoft.com... > Hello, > > We have done some developments using VB6.0. What we have done is created > multiple projects - say: > a) Exams > b) Enrollments > c) HR > > Now each of a,b and c are 3 different Projects !!! ... What I wanna do is - > integrate them into 1 one project - i.e. do Project Grouping and then > dynamically call forms of a - while in b and so on !!! > > Any ideas - as to how do we go about doing the same !!! > > PLEASE HELP !!! Hello Robert,
Thanx for your reply !!! Yes - all the projects are standard exe's. We do have a pool of public forms which we share ... What we've done here is - that we have sub divided a huge project into different sections - connecting to the same database. If we copy paste forms - it becomes too huge and chances of errors stay -as we have made massive use of modules and functions !!! What we want to do - is allow a single menu - form which multiple projects forms can be called and opened !!! ... Eg.: One project - say accountin - another say Payroll - now we'd like to integrate Payroll and Accounting - we would like the interface to be the same from which - if the user wants to view accounting details or payroll details !!! ... Thanx, Ani Show quoteHide quote "Robert" wrote: > I don't know anything about what kinds of projects you have - standard exe? > And what you want to achive by merging them? > If you simply want to use a form that you created in one project in another > project, you can always add the file (maybe copy it first, if you'll need to > make some changes). If you have some files that can be used in several > project, you could create a pool of "public" files by first removing them > from the project, moving them to a common folder and then adding them from > that location. We make heavy use of this in our development team, e.g. we > have a module that handles registry access, and nearly everyone uses it. > However, this can become tricky if the files heavily depend on each other > (and were originally intended only to run within their own project). > > Robert > > "Ani" <A**@discussions.microsoft.com> wrote in message > news:98566613-F5C7-4484-8E37-5CC279E9FCFF@microsoft.com... > > Hello, > > > > We have done some developments using VB6.0. What we have done is created > > multiple projects - say: > > a) Exams > > b) Enrollments > > c) HR > > > > Now each of a,b and c are 3 different Projects !!! ... What I wanna do > is - > > integrate them into 1 one project - i.e. do Project Grouping and then > > dynamically call forms of a - while in b and so on !!! > > > > Any ideas - as to how do we go about doing the same !!! > > > > PLEASE HELP !!! > > > First, make a backup of all projects.
There is something in VB6 called Project Group, but it may not be what you want. It lets you load multiple projects that depends on each other, like Standard EXE and OCX projects that are used in them for easy development. I can think of 2 ways to do what you are looking for: Option 1: Merging files into a single project: - Scan all projects for modules that have the same file name and/or the same module name as it appears in the module's property. For example, if you have multiple Form1, change the (Name) property to something unique, and use File|Save File As, to save to a new unique file name. Another example, change Module1 to Module2, etc. - If you changed a module name, like Form1, Class1, Module1, etc., use Find and Replace in the original project to replace the name while in the original project. - Do the same for global variables and Public routines that have the same name in other projects. Since you probably have many configuration options, you may want to put them in their own UDF. This reduces the number of global variables that you have to maintain. For example: Public Type cfgT FirstName As String LastName As String ' ' LastSaved As LastSavedT ' Contain controls contents, like TextBoxes End Type Public cfg As cfgT ' Only one global variable In the code, just type "cfg." to access your "global" variables. That way you don't have to remember them, Intellisense will help you. - After you are done with removing conflicts from your projects, copy all source files to a new folder. If 2 files have the same name, then you could rename the second file. However, VB6 will refuse to load files that have the same module name. For example, if you have modWinAPI.bas and modGlobals.bas and both have (Name) property set to Module1, then VB6 will refuse to load them in the same project. See the previous steps. - Open each older project and make a note of what appears in "References" and "Components". Some references in one project may conflict with references with another project. Please open your VBP files with Notepad and post the lines that begin with "Object=" and "Reference=" here so we can help you further. - Start a new Standard EXE project, do not add the files yet. - Right click on Form1, and select "Remove Form1.frm". - Add all references and components used in all 3 projects. If you ignore this step, VB6 would replace some of your controls with PictureBox's and if you save your files while in this status, you loose these controls, unless you had a backup. - Instead of using "Project|Add File" for each file, go to Windows Explorer, use Detailed view and sort by file type. Highlight all frm, cls, bas, ctl files and drag them to VB6 project window. VB will automatically add them. You can do this in steps for each type of file(Recommended) - If there were no errors, save the project. - Use "Public Sub Main()" to show your main form, or select a startup form as needed. You may want to add a new main form and use it to "launch" what was the other 3 projects. Option 2: Converting your Projects to ActiveX EXE. If you convert each of your projects to ActiveX EXE, you can easily make them talk to each other. To convert them, go to each project's properties and change its type to ActiveX EXE. To make the ActiveX EXE's talk to each other, you have to add a Class to each. You could get an instance of a Class that resides in another EXE and call its properties and methods to tell the other EXE what to do, like showing a form. The drawbacks for this method is that you have to maintain binary compatibility. This can be a nightmare sometimes. See my posts in the following thread: http://groups.google.com/group/microsoft.public.vb.enterprise/browse_thread/thread/ef7517c84c5dd330/9cdebfc249927c07 I don't recommend this method because it seems that sooner or later you have to merge the files, but it all depends on what your needs are. Some useful articles that explain how this is done: How To Create a DCOM Client/Server Application by Using Visual Basic http://support.microsoft.com/default.aspx?scid=kb;en-us;266717 How To Create a DCOM Client/Server with Events by Using Visual Basic http://support.microsoft.com/default.aspx?scid=kb;en-us;267836 Using DCOM with complex objects: How To Implement Visual Basic COM Objects Returning Recordsets http://support.microsoft.com/default.aspx?scid=kb;en-us;224424 INFO: Passing ADO Recordsets in Visual Basic Procedures http://support.microsoft.com/default.aspx?scid=kb;en-us;193871 How To Create ADO Disconnected Recordsets in VBA/C++/Java http://support.microsoft.com/default.aspx?scid=kb;en-us;184397 Show quoteHide quote "Ani" <A**@discussions.microsoft.com> wrote in message news:98566613-F5C7-4484-8E37-5CC279E9FCFF@microsoft.com... > Hello, > > We have done some developments using VB6.0. What we have done is created > multiple projects - say: > a) Exams > b) Enrollments > c) HR > > Now each of a,b and c are 3 different Projects !!! ... What I wanna do > is - > integrate them into 1 one project - i.e. do Project Grouping and then > dynamically call forms of a - while in b and so on !!! > > Any ideas - as to how do we go about doing the same !!! > > PLEASE HELP !!! Hello,
Thanx for such a comprehensive reply !!! Thanx for letting me know the backdraws of ActiveX EXE !!! Was trying to avoid option 1 - but guess their seems to be no alternative :) Thanx, Ani Show quoteHide quote "Someone" wrote: > First, make a backup of all projects. > > There is something in VB6 called Project Group, but it may not be what you > want. It lets you load multiple projects that depends on each other, like > Standard EXE and OCX projects that are used in them for easy development. > > I can think of 2 ways to do what you are looking for: > > Option 1: Merging files into a single project: > > - Scan all projects for modules that have the same file name and/or the same > module name as it appears in the module's property. For example, if you have > multiple Form1, change the (Name) property to something unique, and use > File|Save File As, to save to a new unique file name. Another example, > change Module1 to Module2, etc. > > - If you changed a module name, like Form1, Class1, Module1, etc., use Find > and Replace in the original project to replace the name while in the > original project. > > - Do the same for global variables and Public routines that have the same > name in other projects. Since you probably have many configuration options, > you may want to put them in their own UDF. This reduces the number of global > variables that you have to maintain. For example: > > Public Type cfgT > FirstName As String > LastName As String > ' > ' > LastSaved As LastSavedT ' Contain controls contents, like TextBoxes > End Type > > Public cfg As cfgT ' Only one global variable > > In the code, just type "cfg." to access your "global" variables. That way > you don't have to remember them, Intellisense will help you. > > - After you are done with removing conflicts from your projects, copy all > source files to a new folder. If 2 files have the same name, then you could > rename the second file. However, VB6 will refuse to load files that have the > same module name. For example, if you have modWinAPI.bas and modGlobals.bas > and both have (Name) property set to Module1, then VB6 will refuse to load > them in the same project. See the previous steps. > > - Open each older project and make a note of what appears in "References" > and "Components". Some references in one project may conflict with > references with another project. Please open your VBP files with Notepad and > post the lines that begin with "Object=" and "Reference=" here so we can > help you further. > > - Start a new Standard EXE project, do not add the files yet. > > - Right click on Form1, and select "Remove Form1.frm". > > - Add all references and components used in all 3 projects. If you ignore > this step, VB6 would replace some of your controls with PictureBox's and if > you save your files while in this status, you loose these controls, unless > you had a backup. > > - Instead of using "Project|Add File" for each file, go to Windows Explorer, > use Detailed view and sort by file type. Highlight all frm, cls, bas, ctl > files and drag them to VB6 project window. VB will automatically add them. > You can do this in steps for each type of file(Recommended) > > - If there were no errors, save the project. > > - Use "Public Sub Main()" to show your main form, or select a startup form > as needed. You may want to add a new main form and use it to "launch" what > was the other 3 projects. > > Option 2: Converting your Projects to ActiveX EXE. > > If you convert each of your projects to ActiveX EXE, you can easily make > them talk to each other. To convert them, go to each project's properties > and change its type to ActiveX EXE. To make the ActiveX EXE's talk to each > other, you have to add a Class to each. You could get an instance of a Class > that resides in another EXE and call its properties and methods to tell the > other EXE what to do, like showing a form. > > The drawbacks for this method is that you have to maintain binary > compatibility. This can be a nightmare sometimes. See my posts in the > following thread: > > http://groups.google.com/group/microsoft.public.vb.enterprise/browse_thread/thread/ef7517c84c5dd330/9cdebfc249927c07 > > I don't recommend this method because it seems that sooner or later you have > to merge the files, but it all depends on what your needs are. > > Some useful articles that explain how this is done: > > How To Create a DCOM Client/Server Application by Using Visual Basic > http://support.microsoft.com/default.aspx?scid=kb;en-us;266717 > > How To Create a DCOM Client/Server with Events by Using Visual Basic > http://support.microsoft.com/default.aspx?scid=kb;en-us;267836 > > Using DCOM with complex objects: > > How To Implement Visual Basic COM Objects Returning Recordsets > http://support.microsoft.com/default.aspx?scid=kb;en-us;224424 > > INFO: Passing ADO Recordsets in Visual Basic Procedures > http://support.microsoft.com/default.aspx?scid=kb;en-us;193871 > > How To Create ADO Disconnected Recordsets in VBA/C++/Java > http://support.microsoft.com/default.aspx?scid=kb;en-us;184397 > > > > "Ani" <A**@discussions.microsoft.com> wrote in message > news:98566613-F5C7-4484-8E37-5CC279E9FCFF@microsoft.com... > > Hello, > > > > We have done some developments using VB6.0. What we have done is created > > multiple projects - say: > > a) Exams > > b) Enrollments > > c) HR > > > > Now each of a,b and c are 3 different Projects !!! ... What I wanna do > > is - > > integrate them into 1 one project - i.e. do Project Grouping and then > > dynamically call forms of a - while in b and so on !!! > > > > Any ideas - as to how do we go about doing the same !!! > > > > PLEASE HELP !!! > > > |
|||||||||||||||||||||||