Results 1 to 36 of 36

Thread: [RESOLVED] Project Connections

  1. #1

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Resolved [RESOLVED] Project Connections

    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 ?

  2. #2

  3. #3

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    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 ?

  4. #4
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Project Connections

    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.
    Last edited by jcis; Aug 27th, 2007 at 06:07 AM.

  5. #5

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    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 ?

  6. #6
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Project Connections

    Quote Originally Posted by Loraine
    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.
    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 .

  7. #7

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    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

  8. #8
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: Project Connections

    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.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  9. #9

  10. #10

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    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.
    Thats what im asking , how im gonna do that ?

  11. #11
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: Project Connections

    @RhinoBull: OP = opus, or what?
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  12. #12

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    @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 ?

  13. #13

  14. #14
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: Project Connections

    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
    Could you explain the Clicking part little more.
    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?

    IIF(Post.Rate > 0 , , )

  15. #15
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: Project Connections

    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??
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  16. #16

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    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

  17. #17
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: Project Connections

    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?
    Last edited by zeezee; Aug 27th, 2007 at 08:20 AM. Reason: Typo
    IIF(Post.Rate > 0 , , )

  18. #18
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Project Connections

    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...

  19. #19

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    Its running.

  20. #20
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: Project Connections

    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 ?
    IIF(Post.Rate > 0 , , )

  21. #21

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    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.
    How to use that Active-X Dll ?

    And you are still very much unclear...
    What part ?

  22. #22

  23. #23

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    @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 ?

  24. #24

  25. #25
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: Project Connections

    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
    Code:
    public sub ShowForm(Formname as String)
     Forms.add formname
    end sub
    you call that method in your Project1, passing the relevant formname
    like that. This may be not the CORRECT way. Please someone clarify this more.
    Last edited by zeezee; Aug 27th, 2007 at 08:42 AM. Reason: typos :)
    IIF(Post.Rate > 0 , , )

  26. #26

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    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
    Code:
    form1.show
    unload me
    
    'or
    
    form3.show
    unload me
    
    'or
    
    form4.show
    unload me
    You can do that because all forms are in a single project.

    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.
    Attached Images Attached Images   

  27. #27

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    @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

  28. #28

  29. #29
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: Project Connections

    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.
    IIF(Post.Rate > 0 , , )

  30. #30

  31. #31

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    Now i get it. Thank you both of you. For me this is a advance lesson. Thanks i give both of you a points

  32. #32

  33. #33

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    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

  34. #34
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Project Connections

    - 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

  35. #35

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    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

  36. #36

    Thread Starter
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: Project Connections

    :-) I figured it out. I didn't see the "Add Standard Exe Project" icon on top right. Thank you again

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