472,805 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 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 2954
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: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.