CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2004
    Location
    Mumbai
    Posts
    20

    Unhappy Using Visual Basic Group (.vbg) URGENT !!!

    Hey all,
    I have two different modules that are saved as projects (i.e I have two .vbp's). I have added (or merged) those two projects and created one .vbg. Now there is one .vbg containing the above two .vbp's.
    Please tell me how do I access form of one project from the form of the other project. Please do it fast as this is urgent
    Thanks a lot.

    Harry
    Signature..... Premium Whiskey

  2. #2
    Join Date
    Dec 2001
    Posts
    6,332
    This does not seem possible, probably because two seporate projects would be compiled as two seporate exe's, so they would not be linked in any way. Why can't you put all the files you need together in one project? There may be other solutions depending on what you need, such as a UserControl, Dll, etc..
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

  3. #3
    Join Date
    Nov 2002
    Posts
    82
    sorry WizBang,

    it seems that two separates apllications can communicate. the callback.dll from Jürgen Thümmler shows how.
    james

  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726
    if the two project are an activex and an exe standard, you can have easy communication
    ie:
    a dll can be accessed via its public methods from an exe standard, and they vvoth
    could haveinterfaces in common

    If they are two exe standard, things are different, as they are private as per
    outside the single projects.

    You could commnuicate in different ways. Ie: have the two exes writing and
    reading from a table (this is common, but the two project are still independent),
    or one could use api to findwindow of the other and manage to get some infos
    (but that is not a fair way to develope your projects).
    Better you consider redesign it a bit...
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  5. #5
    Join Date
    Dec 2001
    Posts
    6,332
    Quote Originally Posted by jamesa
    sorry WizBang,

    it seems that two separates apllications can communicate. the callback.dll from Jürgen Thümmler shows how.
    While it is true that two compiled applications can communicate, this does not appear to be what Harry7979 wants. Unless I misunderstand, the question is more along the lines of how to make two projects compile into one exe.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

  6. #6
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726
    Quote Originally Posted by jamesa
    sorry WizBang,

    it seems that two separates apllications can communicate. the callback.dll from Jürgen Thümmler shows how.
    Took a look.
    First, it is not a com object but a C++ one
    *************added later*******
    Having had a second look, and sawing the Api findwindow and
    the like, I think underhood process might be different:
    it resemble more subclassing, to get messages - and data
    with messages
    *****************************
    Can this make a difference? Maybe: the equivalent would be
    a dll that could be a singleObject and could be instantiate by two standard exe.
    Then you could make it receive an identifier from each exe (which both should
    implement same interface to communicate with the dll), and from dll you could
    switch calls from one to the others...

    I have played with callbacks, but never tried an object that could be a single
    object that could act as single object for many clients. For sure it is possible,
    as you can invoke "GetObject()", but I am afraid of deadlocks...
    Last edited by Cimperiali; August 10th, 2004 at 07:18 AM.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  7. #7
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726
    Quote Originally Posted by WizBang
    Unless I misunderstand, the question is more along the lines of how to make two projects compile into one exe.
    ...Not sure, but thought -as he asked
    access form of one project from the form of the other project
    -only to communicate between the two...
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  8. #8
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726
    a dll that could be a singleObject and could be instantiate by two standard exe
    (that is: two exes that shares same data through a dll)
    seems not makable that easy in vb:

    from msdn:

    Apartment-Model Threading in Visual Basic
    In Visual Basic, apartment-model threading is used to provide thread safety.
    In apartment-model threading, each thread is like an apartment — all objects
    created on the thread live in this apartment, and are unaware of objects in other
    apartments.

    Visual Basics implementation of apartment-model threading eliminates conflicts in
    accessing global data from multiple threads by giving each apartment its own
    copy of global data[...]

    This means that you cannot use global data to communicate between objects on
    different threads.

    Note Objects in different apartments can only communicate with each other if a
    client passes them references to each other.
    Last edited by Cimperiali; August 10th, 2004 at 08:08 AM.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured