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

Native wrappers : COM vs Mixed assemblies

Hi,

I am new to .Net development, so please excuse me if some of the
questions ....
So I have Win32 library (using Bluetooth) and I have to expose its
functionality to .Net developers.
I think I have 3 options:
1) Re-implement it in C# - looks impossible:
1) I have to call several native methods with complex parameters like
WSALookupServiceBegin
2) I do not have AF_BTH and similar socket functionality in .Net Socket
releated classes
2) Create a COM wrapper so any .Net language could use it (easy task)
3) Write mixed assembly

So my question is what is your opinion - should I create COM or Mixed
Assembly?

Thanks in advance:
Trever

May 14 '06 #1
2 1166
Hi Trever,
1) Re-implement it in C# - looks impossible:
1) I have to call several native methods with complex parameters like
WSALookupServiceBegin that would be the hard way indeed. Probably only to be done as a research
project, or if you don't know what to do with your free time. :-)
2) I do not have AF_BTH and similar socket functionality in .Net Socket
releated classes
2) Create a COM wrapper so any .Net language could use it (easy task) that would indeed be one of the options. not my favorite, because I'd rather
choose .NET over COM for new projects.
3) Write mixed assembly

that's another option: creating a class library that exports .NET functions
instead of native functions.

I think you are forgetting option number 4:
You mention you already have a win32 library that exposes your
functionality.
if so, you can create a wrapper class library in C#, using DllImport to
PInvoke each of the functions in your your original dll.
that is very easy if your dll interface is not too complex.

how to proceed depends a bit on what you know best. it depends on what you
know best: C++.NET or C#.
Based on the answer to that question, I would personally go with option 3 or
4.

--

Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"
May 14 '06 #2
Thanks Bruno,

I would agree your option is really interesting (may the best)
It will require some small redisign form my site (Objects herarcy)
But I think it is very neat soltution.

May 14 '06 #3

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

Similar topics

1
by: Mike Kamzyuk | last post by:
Hello all. Basically, I need to call a mixed-mode dll's function (which uses managed code) from a native or mixed-mode dll function (which does not use managed code). I'm wondering if this could...
9
by: Edward Diener | last post by:
I received no answers about this the first time I posted, so I will try again. My inability to decipher an MSDN topic may find others who have the same inability and someone who can decipher and...
2
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking afterwards with ILDASM at what is visible in those assemblies from a...
3
by: Steve McLellan | last post by:
Hi, Sorry for the long post, it's a bit epic (and sums up the last 10 hours of my life, apart from my car's gearbox melting). We've got a mixed C++ assembly that's exhibiting odd behaviour...
2
by: James S | last post by:
Hi I've been porting a project to .Net that has several segments of code that I would like to keep as native code in wrappers. I've been using VS2003 and VC++ to create mixed dlls that I then...
3
by: Xavi Sam | last post by:
Hi When I build my asp.net application the ASP.NET generates a net.assembly by page in the directory of my pc: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files Theese...
9
by: Herby | last post by:
Is possible to have a managed method within a Native(un-managed) class within a \clr project? E.g. class myClass { public: #pragma managed void myMethod(void);
8
by: Edward Diener | last post by:
By reuse, I mean a function in an assembly which is called in another assembly. By a mixed-mode function I mean a function whose signature has one or more CLR types and one or more non-CLR...
1
by: bvisscher | last post by:
I posted this recently in microsoft.public.vc.language and was redirected here. I also searched this ng and found some relavant threads. The most relavent I found was: ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...

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.