473,786 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
WSALookupServic eBegin
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 1187
Hi Trever,
1) Re-implement it in C# - looks impossible:
1) I have to call several native methods with complex parameters like
WSALookupServic eBegin 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************* *********@hotma il.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
2202
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 be accomplished and how. Here's the problem. We have a third party app (TPA) capable of loading native and mixed-mode dlls somehow (we don't know how). It loads our native dll (OND) and allows us to use our code inside the app (that is, we...
9
2592
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 explain it. I have some questions about the instructions for creating a mixed mode DLL in the MSDN topic "Converting Managed Extensions for C++ Projects from Pure Intermediate Language to Mixed Mode" in the "Managed Extensions for C++ Reference"....
2
2058
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 managed point-of-view I've noticed that: 1) for each managed and unmanaged C function (not C++ classes) I get a public managed static method (defined on a 'Global Functions' class) in the generated assembly with an export name of the form
3
1566
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 when the /OPT:REF (remove unreferenced data) linker option is set. We first noticed the problem after removing the /DEBUG option (which silently alters the defaults for the /OPT option) and assumed that was the cause for a few hours until I read the...
2
1242
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 can used from C#. I see that the new 2005 version has a new and significantly different syntax and way of doing things with native code, and was wondering if anyone has any experience of using the new version to perform this sort of task. And...
3
1433
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 assemblies to be executed must be tranlated to native code, the question is: Which is the time of live of the native assemblies? It is possible to configure the time? Are they storaged in some directory in my PC?
9
2075
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
2322
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 types. The problem: I have a number of mixed-mode functions which I want reuse. These functions revolve around converting a CLR String to a C++ std::string or
1
2229
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: http://groups.google.com/group/microsoft.public.dotnet.languages.vc/browse_frm/thread/dac4c07f8678cc0a/32919fdc1ee07313?q=static+initialization+mixed&rnum=2#32919fdc1ee07313
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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
10164
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
10110
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,...
0
9962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7515
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
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4067
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
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.