Is it possible that the project one will connect to project two ?
Project 1:
Form1
Form2
Form3
Form4
Project 2:
frmAdd
frmDel
frmEdt
frmClr
i want that all forms in project one will connect all of the forms in project 2 ?
Printable View
Is it possible that the project one will connect to project two ?
Project 1:
Form1
Form2
Form3
Form4
Project 2:
frmAdd
frmDel
frmEdt
frmClr
i want that all forms in project one will connect all of the forms in project 2 ?
What do you mean by "connect'? Do you want to share forms between the projects or what? :confused:
Yes i want to share the forms between the projects. Like this
If i press a button in form1 in project1. i want that the frmAdd in project2 will appear and vice versa. if i press a button in any forms in project2 some forms will appear in project1. something like that. how im gonna do that ?
Things doesn't work like that, the only way to reference a Form in another Project would be using an Active-X DLL, you can't reference Forms between 2 Standard EXE Projects. An App (EXE) can be created with many VB Projects and that is a Project Group, but if you want inter-comunications between the Project members, one of them must be the Standard EXE Project, and the rest of them should be Active-X DLL Projects compiled and referenced by the first.
Why don't you add the Forms you need in the Main Project? you can create a copy of the Form or add the Form directly from the Path it is in the other Project, but beware that in this case, both Project would work with the same file, if you change code in that Form/Module in one of these Projects, if will affect the other.
And there is still a chance you're saying "Project" when you might be talking about share data between 2 Applications, that would be different.
The reason why i want to do that iter-connection in two different projects. Because we are group into 3, and we are making different projects. So i want that i have a links of my system and i want that if i click one of that links the 2 projects that was made of my groupmates will open. So how im gonna use the Active-X DLL ?
The projects will open? or the applications will open? if you really want to open a Project maybe you could try using ShellExecute API to open them with VB6 :confused: .Quote:
Originally Posted by Loraine
Sorry if i don't explain it clearly. Ok here it is. Lets say In project 1 there a 4 forms and in every forms it has a one button each.
Project 1:
Form1 (include 1 button)
Form2 (include 1 button)
Form3 (include 1 button)
Form4 (include 1 button)
and in project 2 there's also 4 forms
Project 2:
frmAdd
frmEdt
frmDel
frmClr
if i click the button in form1, i want that the frmAdd in project2 will open. Same as if i click the button in form2, the frmDel will open, and so on. something like that
If you are a group of people working together on a project, and each of you is doing a couple of forms for this project, they should ALL be part of a single project. That way they are easily connected, and for the workshare you need to specify who is working on which files (i.e. forms). All of you however should use the same project!
However if you are working on different projects (your Project1 doesn't need the forms of Project2 and vice versa), you need to make that kind of connection.
I'm lost... :confused: Can anybody explain what OP is asking please?
Thats what im asking , how im gonna do that ?Quote:
However if you are working on different projects (your Project1 doesn't need the forms of Project2 and vice versa), you need to make that kind of connection.
@RhinoBull: OP = opus, or what?
@opus = so how im gonna do that inter-connections. Base on jcis suggestion i need to use a active-x dll or shellexecute ? But if you read my post #7 what is the best solution ?
Original Poster ... :)
Could you explain the Clicking part little more.Quote:
Originally Posted by Loraine
Are you saying that in your project 1's Form1 has button , and when your RUN project 1 and press that button , the frmAdd in Project1 should open in the VB IDE?
Or Are you saying, WITHOUT RUNNING project 1, when you click that Button frmAdd Should be open?
:confused:
Do you want to open the other project (using the VB IDE) or do you want to open the .EXE created by the other project??
I have 2 different projects, Project1 and Project2.
The project1 have 4 forms and each forms has corresponding 1 button each
Project 1:
Form1 (has 1 button)
FOrm2 (has 1 button)
Form3 (has 1 button)
Form4 (has 1 button)
the project 2 have also 4 forms but dont have any buttons.
Project 2:
frmAdd
frmDel
frmEdt
frmClr
now what im trying to do is if i click the button in form1 (in project1) i want that the frmAdd in project 2 will open. Same with if i click the button in form2 (also in project1) i want that the frmDel in project2 will open and so on. Hope you get my point
Still couldnt understand the part you say as CLICK.
does it mean when you run project1 one and click the button
or without running the project click the button in design mode?
:(
If you need that at run time (compiled mode) then you'd have to make your Project2 as ActiveX DD and then set references to that dll in your Project1.
Then you'd create an instance of whatever class and one of its methods should have a procedure that will load a form beased on its name or whatever.
And you are still very much unclear... :confused:
Its running.
And when Project 1 is running you want open the frmADD in project 2 to open in VB IDE
or , make frmAdd to run also ?
How to use that Active-X Dll ?Quote:
If you need that at run time (compiled mode) then you'd have to make your Project2 as ActiveX DD and then set references to that dll in your Project1.
Then you'd create an instance of whatever class and one of its methods should have a procedure that will load a form beased on its name or whatever.
What part ?Quote:
And you are still very much unclear...
What does that mean? How can we understand the problem if you don't desribe it? :confused:Quote:
Originally Posted by Loraine
@zeezee - both project1 and project2 are running. heres a example
In a single project you have a different forms on it. You can call a form by just using
[CODE]
form1.show
unload me
' or
form2.show
unload me
[CODE]
simple as that. But the difference is the form that you need to call is in the other project. So how you gonna do that ?
Take a look at this attached sample project.
Thats bit hard for me to explain, I think Rhino will give you some explanation better than this.
What you should do is, Make your project2 an ActiveX project.
Then in your project1 , you make a refernce to that project. simply making a variable of that.
In your project 2 , you should have a pulic method and a puplic class.
In public method like this
you call that method in your Project1, passing the relevant formnameCode:public sub ShowForm(Formname as String)
Forms.add formname
end sub
like that. This may be not the CORRECT way. Please someone clarify this more.
:wave:
For more explanation. Here it is. Look at Project1 pic.
1. For now dont look on project2 pic. If i have a single project which is project1 you will see there i have 4 forms and a button. If you run it if you want to go to form2 or form3 or form1 etc. You can use this code
You can do that because all forms are in a single project.Code:form1.show
unload me
'or
form3.show
unload me
'or
form4.show
unload me
2. Now look on my project2 pic. i also have 4 forms but it only have labels and textboxes. Now both project1 and project2 are now running. Lets say my home page here is the project one. SO imagine that in front of you your just seeing buttons. If you click the "Show Form1" the frmAdd of project2 will now prompting nor will now display and so on.
@zeezee and @rhinobull - I get the idea, and to rhinobull base on you attachment why its saying. User-defined type not defined
Code:Dim obj As Project2.Class1
That's because you need to open TestDll.vbg and not the vbp file.
Ok, Did you try Rhino's code?
It works.
And i tried it by creating the DLL also It works (Thanks Rhino its new for me also. :))
So try it that way.
:wave:
No problem ZZ, you're welcome.
Now i get it. Thank you both of you. For me this is a advance lesson. Thanks i give both of you a points
I'm glad you understood. :thumb:
Oh before i give a rate on this and mark it resolved . How did you put the project2 in the project1 (its bit confusing). Can you give me the steps. I get the idea but the placing of projects dont know how
- Create new project (standard exe)
- Go to File >> Add Project (you will have to select type of project from the list)
- If you select ActiveX.dll then after you add it
- go back to main project and add references (Project > References) to that new dll project
- use code similar to that I gave you
Oh before i give a rate on this and mark it resolved . How did you put the project2 in the project1 (its bit confusing). Can you give me the steps. I get the idea but the placing of projects dont know how
:-) I figured it out. I didn't see the "Add Standard Exe Project" icon on top right. Thank you again