473,804 Members | 3,259 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unmanaged code interface : Java JNI vs .NET interoperabilit y

Hi,

I am developing a new application running on Windows platform that needs to
interface with existing legacy code - written in basic C / C++. I am trying
to evaluate Java vs C# implementations . Originally, I have the impression
that C# should be a clear winner.

I started with Java and using the guideline from the book "Java Native
Interface". Though complex, the book provide details of the practical
implementation and potential pitfalls for poor implementation. Particularly,
it provides a clear picture on life cycle managment, garbage collection,
exception handling (responsibility ) and retaining of object oriented
implementation (one-to-one mapping). However, when I switched my focus on
C#, I had difficult in finding good literature and examples for handling
those issues. I checked Chapter 1 of "COM and .NET Interoperabilit y" and
Chapter 15/16 of "Essential Guide to Managed Extensions for C++". Hence,
that makes me lean on the Java implementation that the C# implementation -
based on the fact that I know what I will get in details. Did I miss any
information critical? Could anyone point me to better article in this
particular aspect?

Thanks in advance.
Nov 15 '05 #1
1 2525

Hi Sai,

There is a good book give you a deeply insight into the .net framework:
<Applied .net framework programming> by Jeffrey Richter
It talks much about GC, Exception and so on.

Also, you can have a clear look at .net GC in these 2 articles:
http://msdn.microsoft.com/msdnmag/issues/1100/gci/
http://msdn.microsoft.com/msdnmag/issues/1200/GCI2/

Hope this helps.
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Sai Kit Tong" <sk****@mmm.com >
| Subject: Unmanaged code interface : Java JNI vs .NET interoperabilit y
| Date: Fri, 12 Sep 2003 14:38:42 -0500
| Lines: 24
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <ua************ **@TK2MSFTNGP12 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: 130.99.229.109
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1845 01
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Hi,
|
| I am developing a new application running on Windows platform that needs
to
| interface with existing legacy code - written in basic C / C++. I am
trying
| to evaluate Java vs C# implementations . Originally, I have the impression
| that C# should be a clear winner.
|
| I started with Java and using the guideline from the book "Java Native
| Interface". Though complex, the book provide details of the practical
| implementation and potential pitfalls for poor implementation.
Particularly,
| it provides a clear picture on life cycle managment, garbage collection,
| exception handling (responsibility ) and retaining of object oriented
| implementation (one-to-one mapping). However, when I switched my focus on
| C#, I had difficult in finding good literature and examples for handling
| those issues. I checked Chapter 1 of "COM and .NET Interoperabilit y" and
| Chapter 15/16 of "Essential Guide to Managed Extensions for C++". Hence,
| that makes me lean on the Java implementation that the C# implementation -
| based on the fact that I know what I will get in details. Did I miss any
| information critical? Could anyone point me to better article in this
| particular aspect?
|
| Thanks in advance.
|
|
|

Nov 15 '05 #2

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

Similar topics

3
372
by: New World Order Pigs | last post by:
Sorry if this is the wrong group, but it seems like a good place to start. I have a control, creating a dll written in c#/.net and some unmanaged code in c++ using embedded c++ V3. Yes, it is for PPC2002/PPC2003 but I don't believe that's the significant issue. My question is, can I create a solution that wraps the c++ in c# and combine that with the c# control and if so, is this the best way to combine these two elements? I'm not going...
4
6822
by: geilen | last post by:
I'm trying to use a dataset returned from a web service in an unmanaged C++ (MFC) client. The dataset is returned as a BSTR, and I'm having trouble reading the BSTR into an XML document for processing. The data looks correct in the BSTR. Can anyone help point me in the right direction on this?
3
4023
by: Sai Kit Tong | last post by:
Hi, I am developing a new application running on Windows platform that needs to interface with existing legacy code - written in basic C / C++. I am trying to evaluate Java vs C# implementations. Originally, I have the impression that C# should be a clear winner. I started with Java and using the guideline from the book "Java Native Interface". Though complex, the book provide details of the practical implementation and potential...
10
19159
by: Mark Jerde | last post by:
I'm trying to learn the very basics of using an unmanaged C++ DLL from C#. This morning I thought I was getting somewhere, successfully getting back the correct answers to a C++ " int SumArray(int ray, int count)" Now I'm having problems with C++ "return(false)" being True in C#. Here is the C# code. ========================= using System; using System.Runtime.InteropServices; //
4
40042
by: Rachel Suddeth | last post by:
What is the difference between a managed/unmanaged resource, and how do you tell which is which? I'm trying to understand how to write some Dispose() methods, and we are supposed to put code that deals with managed in one place, and code that deals with unmanaged in another place, but I can't seem to find anything that clearly explains what that means. I think if I used a Windows API function to optain a handle, that handle would be an...
4
1164
by: Fredrik Wahlgren | last post by:
hi I have apet aproject that i created a long time ago and I now want to make part of it managed. This is a dtabase application s I want to create a class in which I wrap ADO.NET. The design is such that when I make a query, I want to send each string from the query to unmanaged code. In other words, I simply want to call an unmanaged function from within a managed class within the same dll. Is there anything in particular that I...
5
2808
by: CharlesHenri | last post by:
Hello, i plan to use a managed dll containing WinForm classes in an unmanaged win32 exe. Starting from NOTHING, how do i have to proceed ? I have found the following tutorial on microsoft.com : "Converting Managed Extensions for C++ Projects from Pure Intermediate
2
2262
by: shyam | last post by:
I have a C++ COM based windows service which have more than 30k lines of code and which is stablized over years. We need to take the advantage of the ..NET framework for this project, especially the GUI for this service and the other windows non gui .NET clients. What's the best migaration pattern for us considering not to rewrite the thousands of lines of code. The question i have are the follows.
2
12362
by: Jon Slaughter | last post by:
How difficult is it for one to integrate unmanaged C++ into C#? I know for functions one can use DLLimport but how does one go about doing it for classes? Do I have to completely reimplement the classes in managed C++ as a wrapper to the unmanaged C++ classes or is there an easier way? Essentially what I have done is written a C++ kernel mode driver and I want to use it from my C# program. Because it requires some setup outside the...
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10319
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10303
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5508
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.