473,233 Members | 3,106 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,233 software developers and data experts.

Will Whidbey make MFC/WinForms Interop easier?

Right now the only way to use a WinForms control in MFC is to enable COM
Interop for the control and use it in MFC as you would any ActiveX control.
While this works, COM Interop is a pain, and an ActiveX control isn't as
straight-forward as a CWnd-derived object. It also means that I have to
split my code into two projects. Going the other way (using MFC in
WinForms) is only possible by exposing MFC objects as ActiveX controls,
which probalby means adding ATL to an existing MFC project.

Is any of this going to be easier/cleaner in Whidbey? What I have in mind
is something like (I'm sure I don't have all the new syntax right):

generic<typename FORM> where FORM : System::Windows::Forms::Control
ref class CControlWrapper : public CWnd
{
private:
// lots of magic code to make a System::Windows::Forms::Control object
look like a CWnd
protected:
FORM* m_WinFormControl;
};

ref class CMyControl : public CControlWrapper<MyApp::MyUserControl>
{
public:
void Method1() {
m_WinFormControl->Method1();
}
};

This would make using CMyControl as easy as any other CWnd-derived object;
which would make it much easier to integrate WinForms controls into an
existing MFC application. Going the other way would be nice too, as there
are MFC-based controls available (I'm specifically thinking of
http://codejock.com).

Can anybody comment?

Thanks,
Dan
Nov 16 '05 #1
5 1824
Yes, our plans are for more explicit support for integrating MFC and Windows
Forms in the Whidbey release.

It is still too early to share any preliminary design of that feature.

Ronald Laeremans
Visual C++ team

"Dan Smith" <J_************@HoTMaiL.com> wrote in message
news:O3**************@TK2MSFTNGP09.phx.gbl...
Right now the only way to use a WinForms control in MFC is to enable COM
Interop for the control and use it in MFC as you would any ActiveX control. While this works, COM Interop is a pain, and an ActiveX control isn't as
straight-forward as a CWnd-derived object. It also means that I have to
split my code into two projects. Going the other way (using MFC in
WinForms) is only possible by exposing MFC objects as ActiveX controls,
which probalby means adding ATL to an existing MFC project.

Is any of this going to be easier/cleaner in Whidbey? What I have in mind
is something like (I'm sure I don't have all the new syntax right):

generic<typename FORM> where FORM : System::Windows::Forms::Control
ref class CControlWrapper : public CWnd
{
private:
// lots of magic code to make a System::Windows::Forms::Control object
look like a CWnd
protected:
FORM* m_WinFormControl;
};

ref class CMyControl : public CControlWrapper<MyApp::MyUserControl>
{
public:
void Method1() {
m_WinFormControl->Method1();
}
};

This would make using CMyControl as easy as any other CWnd-derived object;
which would make it much easier to integrate WinForms controls into an
existing MFC application. Going the other way would be nice too, as there
are MFC-based controls available (I'm specifically thinking of
http://codejock.com).

Can anybody comment?

Thanks,
Dan

Nov 16 '05 #2
OK...I'll be anxiously waiting to see how this is supported. Glad to see
it's "on ths list". Is this not a "sexy" enough feature to make it onto
things like PDC presentations and .NET blogs?

Dan

"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message
news:ed**************@TK2MSFTNGP10.phx.gbl...
Yes, our plans are for more explicit support for integrating MFC and Windows Forms in the Whidbey release.

It is still too early to share any preliminary design of that feature.

Ronald Laeremans
Visual C++ team

"Dan Smith" <J_************@HoTMaiL.com> wrote in message
news:O3**************@TK2MSFTNGP09.phx.gbl...
Right now the only way to use a WinForms control in MFC is to enable COM
Interop for the control and use it in MFC as you would any ActiveX

control.
While this works, COM Interop is a pain, and an ActiveX control isn't as
straight-forward as a CWnd-derived object. It also means that I have to
split my code into two projects. Going the other way (using MFC in
WinForms) is only possible by exposing MFC objects as ActiveX controls,
which probalby means adding ATL to an existing MFC project.

Is any of this going to be easier/cleaner in Whidbey? What I have in mind is something like (I'm sure I don't have all the new syntax right):

generic<typename FORM> where FORM : System::Windows::Forms::Control
ref class CControlWrapper : public CWnd
{
private:
// lots of magic code to make a System::Windows::Forms::Control object look like a CWnd
protected:
FORM* m_WinFormControl;
};

ref class CMyControl : public CControlWrapper<MyApp::MyUserControl>
{
public:
void Method1() {
m_WinFormControl->Method1();
}
};

This would make using CMyControl as easy as any other CWnd-derived object; which would make it much easier to integrate WinForms controls into an
existing MFC application. Going the other way would be nice too, as there are MFC-based controls available (I'm specifically thinking of
http://codejock.com).

Can anybody comment?

Thanks,
Dan


Nov 16 '05 #3
It is too early in the gestation phase of this feature to have made it into
the PDC, or into current BLOG entries.

Ronald

"Dan Smith" <J_************@HoTMaiL.com> wrote in message
news:Ok**************@TK2MSFTNGP09.phx.gbl...
OK...I'll be anxiously waiting to see how this is supported. Glad to see
it's "on ths list". Is this not a "sexy" enough feature to make it onto
things like PDC presentations and .NET blogs?

Dan

"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message
news:ed**************@TK2MSFTNGP10.phx.gbl...
Yes, our plans are for more explicit support for integrating MFC and

Windows
Forms in the Whidbey release.

It is still too early to share any preliminary design of that feature.

Ronald Laeremans
Visual C++ team

"Dan Smith" <J_************@HoTMaiL.com> wrote in message
news:O3**************@TK2MSFTNGP09.phx.gbl...
Right now the only way to use a WinForms control in MFC is to enable COM Interop for the control and use it in MFC as you would any ActiveX

control.
While this works, COM Interop is a pain, and an ActiveX control isn't as straight-forward as a CWnd-derived object. It also means that I have to split my code into two projects. Going the other way (using MFC in
WinForms) is only possible by exposing MFC objects as ActiveX controls, which probalby means adding ATL to an existing MFC project.

Is any of this going to be easier/cleaner in Whidbey? What I have in mind is something like (I'm sure I don't have all the new syntax right):

generic<typename FORM> where FORM : System::Windows::Forms::Control
ref class CControlWrapper : public CWnd
{
private:
// lots of magic code to make a System::Windows::Forms::Control object look like a CWnd
protected:
FORM* m_WinFormControl;
};

ref class CMyControl : public CControlWrapper<MyApp::MyUserControl>
{
public:
void Method1() {
m_WinFormControl->Method1();
}
};

This would make using CMyControl as easy as any other CWnd-derived object; which would make it much easier to integrate WinForms controls into an
existing MFC application. Going the other way would be nice too, as there are MFC-based controls available (I'm specifically thinking of
http://codejock.com).

Can anybody comment?

Thanks,
Dan



Nov 16 '05 #4
Related to this, did microsoft develop some scenario on what it takes to port
a XP native C++ multimedia application to Longhorn?

My area of interest are:

- Taking advantage of the new UI features (How to Replace Win32)
- Taking advantage of the new multimedia API (How to Replace Directshow)
- Keep tight integration of all API: Mainly how COM Direct3D tightly integrate with
the new UI, media services and WinFS.

Their is allot of information and its easy to get 'lost' and spend days reading very low level info.

Thanks for any pointers...

Stephan

"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message news:ed**************@TK2MSFTNGP10.phx.gbl...
Yes, our plans are for more explicit support for integrating MFC and Windows
Forms in the Whidbey release.

It is still too early to share any preliminary design of that feature.

Ronald Laeremans
Visual C++ team

"Dan Smith" <J_************@HoTMaiL.com> wrote in message
news:O3**************@TK2MSFTNGP09.phx.gbl...
Right now the only way to use a WinForms control in MFC is to enable COM
Interop for the control and use it in MFC as you would any ActiveX

control.
While this works, COM Interop is a pain, and an ActiveX control isn't as
straight-forward as a CWnd-derived object. It also means that I have to
split my code into two projects. Going the other way (using MFC in
WinForms) is only possible by exposing MFC objects as ActiveX controls,
which probalby means adding ATL to an existing MFC project.

Is any of this going to be easier/cleaner in Whidbey? What I have in mind
is something like (I'm sure I don't have all the new syntax right):

generic<typename FORM> where FORM : System::Windows::Forms::Control
ref class CControlWrapper : public CWnd
{
private:
// lots of magic code to make a System::Windows::Forms::Control object
look like a CWnd
protected:
FORM* m_WinFormControl;
};

ref class CMyControl : public CControlWrapper<MyApp::MyUserControl>
{
public:
void Method1() {
m_WinFormControl->Method1();
}
};

This would make using CMyControl as easy as any other CWnd-derived object;
which would make it much easier to integrate WinForms controls into an
existing MFC application. Going the other way would be nice too, as there
are MFC-based controls available (I'm specifically thinking of
http://codejock.com).

Can anybody comment?

Thanks,
Dan


Nov 16 '05 #5
Hi Stephan,

Since this really is a question for the Longhorn team, I think you would get
a better answer asking in one of the Longhorn forums, or in the DirectX
forums that deal with the current technology.

Ronald

"Stephan Schaem" <ss*****@seriousmagic.com> wrote in message
news:uo**************@TK2MSFTNGP11.phx.gbl...
Related to this, did microsoft develop some scenario on what it takes to port a XP native C++ multimedia application to Longhorn?

My area of interest are:

- Taking advantage of the new UI features (How to Replace Win32)
- Taking advantage of the new multimedia API (How to Replace Directshow)
- Keep tight integration of all API: Mainly how COM Direct3D tightly integrate with the new UI, media services and WinFS.

Their is allot of information and its easy to get 'lost' and spend days reading very low level info.
Thanks for any pointers...

Stephan

"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message

news:ed**************@TK2MSFTNGP10.phx.gbl...
Yes, our plans are for more explicit support for integrating MFC and Windows Forms in the Whidbey release.

It is still too early to share any preliminary design of that feature.

Ronald Laeremans
Visual C++ team

"Dan Smith" <J_************@HoTMaiL.com> wrote in message
news:O3**************@TK2MSFTNGP09.phx.gbl...
Right now the only way to use a WinForms control in MFC is to enable COM Interop for the control and use it in MFC as you would any ActiveX

control.
While this works, COM Interop is a pain, and an ActiveX control isn't as straight-forward as a CWnd-derived object. It also means that I have to split my code into two projects. Going the other way (using MFC in
WinForms) is only possible by exposing MFC objects as ActiveX controls, which probalby means adding ATL to an existing MFC project.

Is any of this going to be easier/cleaner in Whidbey? What I have in mind is something like (I'm sure I don't have all the new syntax right):

generic<typename FORM> where FORM : System::Windows::Forms::Control
ref class CControlWrapper : public CWnd
{
private:
// lots of magic code to make a System::Windows::Forms::Control object look like a CWnd
protected:
FORM* m_WinFormControl;
};

ref class CMyControl : public CControlWrapper<MyApp::MyUserControl>
{
public:
void Method1() {
m_WinFormControl->Method1();
}
};

This would make using CMyControl as easy as any other CWnd-derived object; which would make it much easier to integrate WinForms controls into an
existing MFC application. Going the other way would be nice too, as there are MFC-based controls available (I'm specifically thinking of
http://codejock.com).

Can anybody comment?

Thanks,
Dan



Nov 16 '05 #6

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

Similar topics

2
by: Bilo | last post by:
When I add a reference in Visual Studio to quartz.dll it creates a new file named "Interop.QuartzTypeLib.dll" into to bin folder. My app only works when this file is in the application folder. Is...
1
by: Felipe Garcia | last post by:
I`m trying to compile a solution built in vs.net 2003 on whibdey with framework 1.2. I have a project into this solution that uses word automation using office 2003, and when i try to compile this...
2
by: frank_ulbricht | last post by:
Hi folks, I'm a Java programmer and now I have to use C# for a new large project. The language is the best I've ever seen. In some points it goes far beyond Java. I like that. But then there...
20
by: Martin Rosén-Lidholm | last post by:
Although an impossible question to answer, I fell urged to raise it anyhow. Given a fairly complex ERP application scenario, what's your estimation for the X-ratio dev. time for...
4
by: spamfurnace | last post by:
Hi there. Ive just been reading about the Whidbey Provider Pattern on MSDN, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/html/asp02182004.asp and i wanted to...
0
by: spamfurnace | last post by:
Will Whidbey have the features, of a girl i'd like to meet? Will Whidbey be easy to talk to, and rub my tired feet? Will Whidbey bats it eyes at me, and whisper "Baby, your so sweet". Will...
3
by: Richard | last post by:
I know there is a bit of discussion already about this subject, but I'd like to hear any thoughts about which might be a better way to go. I'm developing an app (actually converting an Access...
2
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app...
5
by: brian.wilson4 | last post by:
Our group is currently comparing winforms vs webforms.....app is Corp LAN based - we have control of desktops.....Below is pros and cons list we have come up with - if anything strikes you as...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.