473,385 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

Apr 17 '06 #1
6 1759
>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
<ku*****@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.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.

Apr 17 '06 #2
<ku*****@gmail.com> schrieb:
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?


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

Apr 17 '06 #3
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...

Apr 18 '06 #4
Yes, thats your only option if your using C

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
<ku*****@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.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...

Apr 18 '06 #5
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?

Apr 18 '06 #6
Found an article that answers my question...

http://www.codeproject.com/managedcpp/ijw_unmanaged.asp

Apr 19 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sebastien maraux | last post by:
Hello NG, I would like to display dialogs such as CDialog and CMenu in fullscreen exclusive mode. I noticed that CMenu always display under openGL drivers (my app is a 3D Renderer window) but...
5
by: MrNobody | last post by:
I am using the no-arg ShowDialog() method hoping that the window would not be modal to any other window like the other ShowDialog(IWin32Window) method does, but when this opens it somehow becomes...
1
by: Jiang Yue Brandon | last post by:
I am very confused about the different ways of VC++ and C# for doing windows form/dialog design in Visual Studio.NET. In C#, after you drag & drop the components to the form, the underlying...
21
by: Just Me | last post by:
I've tried in a few places using a variable name Form and it appears to be OK. For example: Public Shared Sub WritePositionsInRegistry(ByVal Form As Form, ByVal SubkeyName As String) Is it OK...
5
by: Luis Arvayo | last post by:
Hi, - Is there a way to that every form in my app use the same icon withouth adding it to the Icon property one form by one ? - Do I must add to my app the icon(s) I will use in my forms as...
6
by: Steve Barnett | last post by:
I need to include a wizard in my application that will, as one of the steps, ask the user to select a file to open and (later) a file to save it as. The naff way to do this would be to have a...
3
by: garyusenet | last post by:
Dear Professionals, I have recently been using the wonderful krypton toolkit and am trying to use them in my small hobby application. I include this bit of info as an aside really because i'm...
11
by: Zytan | last post by:
I have created a new form from the main form. When I close the main form with the 'x' close button, its Form.FormClosed event is run, but not the dialog's. Is this normal? It is ok /...
24
by: MichaelK | last post by:
Who knows how to prevent submitting a form on the press Enter button before all fields on the form are filled up. People just enter the first field hit Enter and it submits the form and doing...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.