Cross platform component

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
congminh60
Knows some wx things
Knows some wx things
Posts: 39
Joined: Sun Oct 10, 2010 1:02 am

Cross platform component

Post by congminh60 » Wed Dec 12, 2012 1:55 am

Hi every one,

I wonder is there any way to create a component that we can use everywhere? (Cross-platform version of Microsoft COM?)

For example, we have a wxChartCtrl and then we can use it in vb6, c#.net, c++/mfc, qt, wxwidgets, gtk, cocoa... Is there any way to do it?

Thankyou all.

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Re: Cross platform component

Post by Auria » Thu Dec 13, 2012 12:11 am

You are a little vague, so I'm not sure i understood correctly what you want. But I don't think you can have a single code base provide Qt, MFC, WinForms, Cocoa... all at the same time.

That being said, it is possible to have a reusable core that can then be shared by various thin frontends (one for each targeted platform possibly).
"Keyboard not detected. Press F1 to continue"
-- Windows

congminh60
Knows some wx things
Knows some wx things
Posts: 39
Joined: Sun Oct 10, 2010 1:02 am

Re: Cross platform component

Post by congminh60 » Thu Dec 13, 2012 2:04 am

Hi Auria, let me explain some more details.

Suppose that we have a wxChartCtrl. It is a wxWidgets GUI component and it works well with wxWidgets application.

Then, my question is, can I bring that control into an MFC application without any modification?

In MFC/Windows application, I know that I can create an ActiveX Control for reusable purpose. In general, on Windows, ActiveX Control can reuse in VB6, .NET, C++/MFC, Mathlab, Python... And I wonder that do we have something like the ActiveX technology but can run on all platform (Windows, Linux, Mac).

I do some research and I think Mozilla XPCOM is something like that, but I am not sure.

Thankyou all.

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Re: Cross platform component

Post by Auria » Sun Dec 16, 2012 12:24 am

No that's not directly possible. Though you can write a portable core in standard C++, and then bind this core to the various toolkits you target
"Keyboard not detected. Press F1 to continue"
-- Windows

congminh60
Knows some wx things
Knows some wx things
Posts: 39
Joined: Sun Oct 10, 2010 1:02 am

Re: Cross platform component

Post by congminh60 » Wed Dec 19, 2012 12:10 am

Thankyou Auria, I do googled, and saw lot of companies out there have to port theirs code on varying platform. This guy is an example: http://www.advsofteng.com/

stegemma
Earned a small fee
Earned a small fee
Posts: 16
Joined: Mon May 11, 2009 3:15 pm
Contact:

Re: Cross platform component

Post by stegemma » Fri Dec 28, 2012 11:31 am

I've heard of someone who used OpenGL to creates a complete portable interface, designing forms, menus and so on with OpenGL directives.

You can surely write C++ portable classes (i've done by myself for db Handling, sockets, threads, odbc and so on) but you need some pure virtual class to handle screen and keyboard/mouse events, then specylize them to Windows/mac/Linux...

At the end, is simpler to choose a portable environment, like wxWidgets and similar. I use codelite as the ide for Win/Mac and with no work i can just copy project files to Win or to Mac and just compile and debug.

What you ask is not directly possible.

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: Cross platform component

Post by eranon » Mon Jul 08, 2013 12:23 pm

Hello. Here, the way I understand, you ask for a cross-toolkit code rather than a cross-platform one. So, it sounds like your code as firstly to be cross-platform AND toolkit-independent before to add a toolkit interface one by one... So, it means you have to write your own cross-platform code in first place.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]

Post Reply