|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Reusing VB.NET Form dialogs in VC appsHmm... 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 CoCreateInstance 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. >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 -- Show quoteHide quote( OHM ) - One Handed Man AKA Terry Burns - http://TrainingOn.net <kun1***@gmail.com> wrote in message news:1145264237.722077.277580@v46g2000cwv.googlegroups.com... > 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 CoCreateInstance 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. > <kun1***@gmail.com> schrieb:
> Hmm... reusing VB.NET Form dialogs in other VB.NET projects seems very Is your application a classic C++ application, or MC++, or C++/CLI? If it's > 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? 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/> 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... Yes, thats your only option if your using C
-- Show quoteHide quote( OHM ) - One Handed Man AKA Terry Burns - http://TrainingOn.net <kun1***@gmail.com> wrote in message news:1145328059.306102.232180@v46g2000cwv.googlegroups.com... > 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... > 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?
Is there a Filename.IsValid function anywhere?
radio button user settings Confused Using VB in VS2003 Populating a combobox from dataset Starter Kit Problem Using new control that inherits from Form Working with data adapter/binding source at runtime Combobox, Count Entries Successfully executing queries Registry Help Needed |
|||||||||||||||||||||||