Need Architecture Advice - Creating an app based on controls.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Need Architecture Advice - Creating an app based on controls.

  1. #1
    Jody Breshears Guest

    Need Architecture Advice - Creating an app based on controls.


    Hello all.
    I am looking for a little advice on which way to proceed with an app. This
    is a VB abb that must interface seamlessly with a C++ mapping application.
    My app must expose seperate forms, but be able to communicate with my application
    object. Moreover, we would prefer that the user not be able to tell that
    my forms are not native to the C++ app.

    The first approach I saw was to expose my forms as ActiveX controls, and
    have the client pass my application object references to the controls. This
    approach seems to promise seamless integration, but I don't know about performance.
    Will my messages between my objects have to be marshalled across threads/processes?
    Is there an easier way for my objects to communicate?

    The other approach was to compile my app as an ActiveX .exe, and expose my
    forms normally. This would solve my communication problems, but now I get
    all sorts of z-order problems when the user clicks on a piece of his app
    or mine. I can solve these, but it starts to get complicated. Either I
    have to subclass my own controls to detect and manage the incoming windows
    messages, or I have to pass the C++ app my window handles and he has to do
    the management. Either way, it seems like there has to be a better way.
    Any advice would be appreciated.

    (To reply by e-mail remove the countermeasures.

  2. #2
    Michael Culley Guest

    Re: Need Architecture Advice - Creating an app based on controls.

    Jody,

    I would go with the first approach. The controls run in process so should be
    quite fast. You could create a single C dialog called VBContainter or
    something. You will have to become familiar with VB's project compatibility
    and binary compatibility. You could require that the user control
    implements, say, IVBControl. Then pass in IVBContainer so VB can control the
    form (size, unloading etc)

    > The other approach was to compile my app as an ActiveX .exe, and expose my
    > forms normally. This would solve my communication problems


    This would _create_ the problems you described, not solve them.

    Michael Culley

    "Jody Breshears" <leftwing66@flaresandchaff.yahoo.com> wrote in message
    news:3a645d89$1@news.devx.com...
    >
    > Hello all.
    > I am looking for a little advice on which way to proceed with an app.

    This
    > is a VB abb that must interface seamlessly with a C++ mapping application.
    > My app must expose seperate forms, but be able to communicate with my

    application
    > object. Moreover, we would prefer that the user not be able to tell that
    > my forms are not native to the C++ app.
    >
    > The first approach I saw was to expose my forms as ActiveX controls, and
    > have the client pass my application object references to the controls.

    This
    > approach seems to promise seamless integration, but I don't know about

    performance.
    > Will my messages between my objects have to be marshalled across

    threads/processes?
    > Is there an easier way for my objects to communicate?
    >
    > The other approach was to compile my app as an ActiveX .exe, and expose my
    > forms normally. This would solve my communication problems, but now I get
    > all sorts of z-order problems when the user clicks on a piece of his app
    > or mine. I can solve these, but it starts to get complicated. Either I
    > have to subclass my own controls to detect and manage the incoming windows
    > messages, or I have to pass the C++ app my window handles and he has to do
    > the management. Either way, it seems like there has to be a better way.
    > Any advice would be appreciated.
    >
    > (To reply by e-mail remove the countermeasures.




  3. #3
    Jody Breshears Guest

    Re: Need Architecture Advice - Creating an app based on controls.


    Michael,
    Thanks for the reply. We have decided to go with the first approach (Several
    VB ActiveX controls painted on C++ forms.)
    However, we now have a communication problem that is giving us fits. Since
    I am fairly new to COM, this could simply be my ignorance. Our problem is
    this:

    I need to expose at least three different controls. In the background I need
    an application object that can call methods and propoerties of and respond
    to events from these controls.
    We cannot seem to figure out how to get the application object a valid reference
    to the various controls.

    I have tried exposing a function to recieve the reference
    (in the dll containing the app object)
    Public Sub SetRef(val As ctlUC1.UC1)
    Set UC1 = val
    End Sub

    I have also tried simply exposing the reference in the dll as a public property
    of the correct type.

    Problem is, my partner the C++ programmer cannot seem figure out what to
    feed into that reference.

    Any suggestions?


    "Michael Culley" <mike@vbdotcom.com> wrote:
    >Jody,
    >
    >I would go with the first approach. The controls run in process so should

    be
    >quite fast. You could create a single C dialog called VBContainter or
    >something. You will have to become familiar with VB's project compatibility
    >and binary compatibility. You could require that the user control
    >implements, say, IVBControl. Then pass in IVBContainer so VB can control

    the
    >form (size, unloading etc)
    >
    >> The other approach was to compile my app as an ActiveX .exe, and expose

    my
    >> forms normally. This would solve my communication problems

    >
    >This would _create_ the problems you described, not solve them.
    >
    >Michael Culley
    >
    >"Jody Breshears" <leftwing66@flaresandchaff.yahoo.com> wrote in message
    >news:3a645d89$1@news.devx.com...
    >>
    >> Hello all.
    >> I am looking for a little advice on which way to proceed with an app.

    >This
    >> is a VB abb that must interface seamlessly with a C++ mapping application.
    >> My app must expose seperate forms, but be able to communicate with my

    >application
    >> object. Moreover, we would prefer that the user not be able to tell that
    >> my forms are not native to the C++ app.
    >>
    >> The first approach I saw was to expose my forms as ActiveX controls, and
    >> have the client pass my application object references to the controls.

    >This
    >> approach seems to promise seamless integration, but I don't know about

    >performance.
    >> Will my messages between my objects have to be marshalled across

    >threads/processes?
    >> Is there an easier way for my objects to communicate?
    >>
    >> The other approach was to compile my app as an ActiveX .exe, and expose

    my
    >> forms normally. This would solve my communication problems, but now I

    get
    >> all sorts of z-order problems when the user clicks on a piece of his app
    >> or mine. I can solve these, but it starts to get complicated. Either

    I
    >> have to subclass my own controls to detect and manage the incoming windows
    >> messages, or I have to pass the C++ app my window handles and he has to

    do
    >> the management. Either way, it seems like there has to be a better way.
    >> Any advice would be appreciated.
    >>
    >> (To reply by e-mail remove the countermeasures.

    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center