473,395 Members | 1,574 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,395 software developers and data experts.

DotNet UI with C++ backend - best way forward?

Hi All,

I am impressed with the aesthetic (UI) appeal of DotNet, but not by much
else, like it's new fangled languages etc... I have a legacy C++ 3tier
application, which uses C++ DLLs. I would like to use the DotNet
frontend (e.g. the PL provided by infragistics). However, I don't want
to start messing about with Managed C++ etc. Is there anyway I can use
my C++ DLLs (and C++ code of my application) and "bind" them to a DotNet UI?

Any ideas/suggestions will be very much appreciated.

MTIA

Takeshi

PS: I want to minimise the risk of going out on a limb with a "new"
language that never catches on (Remember Visual J++?), to minimise
future maintainance issues. Consequently, I would much rather prefer
solutions that use "tried and tested" languages like C and C++
(*possibly* VB, but that won't be my first choice since that has also
been given the .NET treatment)
Nov 17 '05 #1
3 2986
Takeshi wrote:
Hi All,

I am impressed with the aesthetic (UI) appeal of DotNet, but not by
much else, like it's new fangled languages etc... I have a legacy C++
3tier application, which uses C++ DLLs. I would like to use the DotNet
frontend (e.g. the PL provided by infragistics). However, I don't want
to start messing about with Managed C++ etc. Is there anyway I can use
my C++ DLLs (and C++ code of my application) and "bind" them to a
DotNet UI?

Any ideas/suggestions will be very much appreciated.


You can use Interop from any .NET language to use your DLL as long as they
are straight functions. But you will have to use some .NET language to
implement your .NET front end. Even Interop this way may have some
marshalling issues if the .NET types and the DLL function signature types
are different, which will require some .NET marshalling attributes to get
things right. If you use MC++, you don't need to use Interop as IJW ( It
Just Works ) makes it unnecessary.

However if your DLL is C++ classes, you need to use MC++. You can then:
1) Recompile your DLL as an unmanaged DLL and add DLL functions which create
an object and a return a pointer and delete the object, all from within your
DLL. You will use this creation and deletion rather than 'new' and 'delete'.
Then you can have a pure MC++ front end operating with an unmanaged C++ back
end.
or
2) Create a mixed mode MC++ front end assembly which uses your DLL ( DLL
still needs to be compiled as unmanaged C++ DLL with whatever version of
VC++ you are using ). There are a number of things you need to do in order
to implement your mixed mode MC++ assembly, all documented in MSDN under
"Converting Managed Extensions for C++ Projects from Pure Intermediate
Language to Mixed Mode".
Nov 17 '05 #2
Hi Edward,

Thanks for the prompt response. Don't want to use MC++. What about if I
"extern C" my C++ DLLS (i.e. convert them to regular Win32 DLLs) and
then write the GUI logic in VB (calling the functions from VB) ?

Will that work?

Tks

Edward Diener wrote:
Takeshi wrote:
Hi All,

I am impressed with the aesthetic (UI) appeal of DotNet, but not by
much else, like it's new fangled languages etc... I have a legacy C++
3tier application, which uses C++ DLLs. I would like to use the DotNet
frontend (e.g. the PL provided by infragistics). However, I don't want
to start messing about with Managed C++ etc. Is there anyway I can use
my C++ DLLs (and C++ code of my application) and "bind" them to a
DotNet UI?

Any ideas/suggestions will be very much appreciated.

You can use Interop from any .NET language to use your DLL as long as they
are straight functions. But you will have to use some .NET language to
implement your .NET front end. Even Interop this way may have some
marshalling issues if the .NET types and the DLL function signature types
are different, which will require some .NET marshalling attributes to get
things right. If you use MC++, you don't need to use Interop as IJW ( It
Just Works ) makes it unnecessary.

However if your DLL is C++ classes, you need to use MC++. You can then:
1) Recompile your DLL as an unmanaged DLL and add DLL functions which create
an object and a return a pointer and delete the object, all from within your
DLL. You will use this creation and deletion rather than 'new' and 'delete'.
Then you can have a pure MC++ front end operating with an unmanaged C++ back
end.
or
2) Create a mixed mode MC++ front end assembly which uses your DLL ( DLL
still needs to be compiled as unmanaged C++ DLL with whatever version of
VC++ you are using ). There are a number of things you need to do in order
to implement your mixed mode MC++ assembly, all documented in MSDN under
"Converting Managed Extensions for C++ Projects from Pure Intermediate
Language to Mixed Mode".


Nov 17 '05 #3
Takeshi wrote:
Hi Edward,

Thanks for the prompt response. Don't want to use MC++. What about if
I "extern C" my C++ DLLS (i.e. convert them to regular Win32 DLLs) and
then write the GUI logic in VB (calling the functions from VB) ?
It will work since you are using functions and not classes. You still have
to use Interop from VB AFAIK. I am not a VB programmer but I am pretty sure
that Interop applies to VB also, just like it does in C# and MC++. In C# and
C++, Interop works through Platform Invoke and the Dllimport attribute. I
don't know what the VB terminology for Interop is but I am sure it must
exist, and I suspect it is essentially the same as C# and C++. For questions
about VB itself, someone else will have to answer you.

Will that work?

Tks

Edward Diener wrote:
Takeshi wrote:
Hi All,

I am impressed with the aesthetic (UI) appeal of DotNet, but not by
much else, like it's new fangled languages etc... I have a legacy
C++ 3tier application, which uses C++ DLLs. I would like to use the
DotNet frontend (e.g. the PL provided by infragistics). However, I
don't want to start messing about with Managed C++ etc. Is there
anyway I can use my C++ DLLs (and C++ code of my application) and
"bind" them to a DotNet UI?

Any ideas/suggestions will be very much appreciated.

You can use Interop from any .NET language to use your DLL as long
as they are straight functions. But you will have to use some .NET
language to implement your .NET front end. Even Interop this way may
have some marshalling issues if the .NET types and the DLL function
signature types are different, which will require some .NET
marshalling attributes to get things right. If you use MC++, you
don't need to use Interop as IJW ( It Just Works ) makes it
unnecessary.

However if your DLL is C++ classes, you need to use MC++. You can
then: 1) Recompile your DLL as an unmanaged DLL and add DLL
functions which create an object and a return a pointer and delete
the object, all from within your DLL. You will use this creation and
deletion rather than 'new' and 'delete'. Then you can have a pure
MC++ front end operating with an unmanaged C++ back end.
or
2) Create a mixed mode MC++ front end assembly which uses your DLL (
DLL still needs to be compiled as unmanaged C++ DLL with whatever
version of VC++ you are using ). There are a number of things you
need to do in order to implement your mixed mode MC++ assembly, all
documented in MSDN under "Converting Managed Extensions for C++
Projects from Pure Intermediate Language to Mixed Mode".

Nov 17 '05 #4

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

Similar topics

2
by: matt | last post by:
Hi all- I'm trying to port an ajax spell-checker (http://www.broken-notebook.com/spell_checker/index.php) to use with the moin moin wiki and have been somewhat successful. (By successful I...
2
by: Rolland Han | last post by:
hi, somebody nice to meet you. I'm a professor from China,and a half-time author. Now a magazine named THE PROGRAM'S AGE ask me to write an article "The History of Microsoft DotNet" for them.I...
0
by: Takeshi | last post by:
Hi All, I am impressed with the aesthetic (UI) appeal of DotNet, but not by much else, like it's new fangled languages etc... I have a legacy C++ 3tier application, which uses C++ DLLs. I would...
7
by: Peter | last post by:
I have noticed a difference in the processing of XSL transforms between dotnet and MSXML. Dotnet formats the resulting output differently, and since we use the <pre> tag in the HTML output it makes...
13
by: bill | last post by:
I am trying to convince a client that dotNet is preferable to an Access project (ADP/ADE). This client currently has a large, pure Access MDB solution with 30+ users, which needs to be upgraded....
3
by: DD | last post by:
Hi I have a split database, that is packaged and used in a runtime enviroment. I want to make it easier for the user, a button on the frontend "Export Backend" They can click on the button...
5
by: Geir Baardsen | last post by:
Hi! I wonder if anybody can help with the following: I need to password-protect tables in MyBackEnd.DB, which is placed in the same folder as the MyFrontEnd.DB Now I've tried the KB_209953...
11
by: BillCo | last post by:
I'm using a backend that's been around for years before I joined the company. It kind of grew exponentially and has some design problems including large unused tables some temporary tables. It...
5
by: sekarm | last post by:
Hi all, Happy to see you all again, I am going to develop one client server application using dotnet(vb.net or c#.net).The task is to develop two applications seperately. one application...
4
by: corey11 | last post by:
I'm a very low-level developer with limited VB knowledge but nonetheless was able to put together a very user-friendly and extremely helpful Access 97 database for my company some 10 years back. We...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.