Reusing VB.NET Form dialogs in VC apps

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kun1he2@gmail.com

    #1

    Reusing VB.NET Form dialogs in VC apps

    Hmm... reusing VB.NET Form dialogs in other VB.NET projects seems very
    straight forward.

    However, I'm now trying to reuse these dialogs within an existing
    C-based app.

    The VB.NET project has already been configured for registration for COM
    interop, so next question is how do I get retrieve/invoke the dialog's
    interfaces/properties?

    I'd think that it involves CoCreateInstanc e initially... but some
    examples would be great... e.g. how to do a ShowDialog for starters?

    Hmm... still scouring the web for more info... but any pointers/help
    will be most appreciated! Thanks.

  • OHM \( One Handed Man \)

    #2
    Re: Reusing VB.NET Form dialogs in VC apps

    >Hmm... still scouring the web for more info... but any 'pointers'/help

    Any 'pointers' must be a C based joke. I have never used it but I know that
    there are .NET extensions for C++

    ;-D

    --
    ( OHM ) - One Handed Man
    AKA Terry Burns - http://TrainingOn.net
    <kun1he2@gmail. com> wrote in message
    news:1145264237 .722077.277580@ v46g2000cwv.goo glegroups.com.. .[color=blue]
    > Hmm... reusing VB.NET Form dialogs in other VB.NET projects seems very
    > straight forward.
    >
    > However, I'm now trying to reuse these dialogs within an existing
    > C-based app.
    >
    > The VB.NET project has already been configured for registration for COM
    > interop, so next question is how do I get retrieve/invoke the dialog's
    > interfaces/properties?
    >
    > I'd think that it involves CoCreateInstanc e initially... but some
    > examples would be great... e.g. how to do a ShowDialog for starters?
    >
    > Hmm... still scouring the web for more info... but any pointers/help
    > will be most appreciated! Thanks.
    >[/color]


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Reusing VB.NET Form dialogs in VC apps

      <kun1he2@gmail. com> schrieb:[color=blue]
      > Hmm... reusing VB.NET Form dialogs in other VB.NET projects seems very
      > straight forward.
      >
      > However, I'm now trying to reuse these dialogs within an existing
      > C-based app.
      >
      > The VB.NET project has already been configured for registration for COM
      > interop, so next question is how do I get retrieve/invoke the dialog's
      > interfaces/properties?[/color]

      Is your application a classic C++ application, or MC++, or C++/CLI? If it's
      one of the latter two, then using the class should be pretty
      straightforward .

      \\\
      using namespace ClassLibrary1;
      ....
      Form1 ^f = gcnew Form1;
      f->Show();
      ///

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      • kun1he2@gmail.com

        #4
        Re: Reusing VB.NET Form dialogs in VC apps

        Actually, it's a C application.

        Guess the next step will be to look at calling through to the VB.NET
        COM objects via some C++ wrapper code...

        Btw, OHM... that was a good one... thank you both for the pointers!
        heh...

        Comment

        • OHM \( One Handed Man \)

          #5
          Re: Reusing VB.NET Form dialogs in VC apps

          Yes, thats your only option if your using C

          --
          ( OHM ) - One Handed Man
          AKA Terry Burns - http://TrainingOn.net
          <kun1he2@gmail. com> wrote in message
          news:1145328059 .306102.232180@ v46g2000cwv.goo glegroups.com.. .[color=blue]
          > Actually, it's a C application.
          >
          > Guess the next step will be to look at calling through to the VB.NET
          > COM objects via some C++ wrapper code...
          >
          > Btw, OHM... that was a good one... thank you both for the pointers!
          > heh...
          >[/color]


          Comment

          • kun1he2@gmail.com

            #6
            Re: Reusing VB.NET Form dialogs in VC apps

            Okay thanks, managed to implement a C++ CLR DLL to wrap around the
            VB.NET COM objects, which is dynamically linked in at run-time by the C
            application.

            Next question... I'm not quite familiar with managed code, so apologies
            if it turns out to be a trivial issue...

            The C++ DLL is called from the C code multiple times throughout the
            application's lifetime. These calls need to store "global" variables
            for use in subsequent calls, e.g. "managed Strings" to set up the
            VB.NET Forms.

            Since "managed" data cannot be declared as global, I'm working around
            it for now by marshalling these data into "unmanaged" memory, and then
            marshalling back again into "managed" memory for subsequent calls.

            I believe there should be a cleaner and more efficient way of doing
            this?

            Comment

            • kun1he2@gmail.com

              #7
              Re: Reusing VB.NET Form dialogs in VC apps

              Found an article that answers my question...



              Comment

              Working...