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

how to work with 3rd party SDK

The 3rd party SDK that I would like to use in C# (I am an C/C++
programmer) is designed to be used from C/C++. This is how it
works:

The vendor is abstracting things a bit. The real DLL has only one
actual exported method, one of the parameters on the DLL takes an
enum which determines which internal function is being called.
Then the vendor provides a header file with a very large number of
enums and structs. There is also a file called function.c with
the sample which contains all the different "internal" functions
and wraps up the parameters to send through the on entry point.

To top it all off, one of the functions in the function.c goes off
to the registry, learns where the DLL is located and then does a
LoadLibrary().

I know that I re-write the whole function.c file in C# and port
the 1000+ lines of header files, too. But my objective in
working in C# is to speed things up, not slow them down;)

Is there an easier way of calling this SDK? I know that I can
compile the function.c as a DLL, but then the issue of the header
files remain, is there any way to include them into the managed
world without having to re-write all the structs and enums?

Sam
Nov 17 '05 #1
1 1501
It sounds like your best bet is to move into the Managed C++ world, and
write a managed C++ wrapper. You will need to translate all the unmanaged
structs etc into their managed counterparts.

The only other alternative I can think of is to P/Invoke your calls into the
unmanaged C++ DLL from C#. But that may not solve the issue of translation
of all the unmanaged structs etc. you will need to look carefully at the
Marshal class which provides a lot of methods to handle this.

Doesn't sound like fun, does it?
Peter

"Sam Carleton" <sc**************@miltonstreet.com> wrote in message
news:tz*******************@fe2.columbus.rr.com...
The 3rd party SDK that I would like to use in C# (I am an C/C++
programmer) is designed to be used from C/C++. This is how it
works:

The vendor is abstracting things a bit. The real DLL has only one
actual exported method, one of the parameters on the DLL takes an
enum which determines which internal function is being called.
Then the vendor provides a header file with a very large number of
enums and structs. There is also a file called function.c with
the sample which contains all the different "internal" functions
and wraps up the parameters to send through the on entry point.

To top it all off, one of the functions in the function.c goes off
to the registry, learns where the DLL is located and then does a
LoadLibrary().

I know that I re-write the whole function.c file in C# and port
the 1000+ lines of header files, too. But my objective in
working in C# is to speed things up, not slow them down;)

Is there an easier way of calling this SDK? I know that I can
compile the function.c as a DLL, but then the issue of the header
files remain, is there any way to include them into the managed
world without having to re-write all the structs and enums?

Sam

Nov 17 '05 #2

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

Similar topics

2
by: Alex | last post by:
Thank you in advance. My ASP page 1 redirect user to third party's website, after the process at third party is finished, in 3rd party's page, there is one link to route user back to my...
2
by: Graham Mattingley | last post by:
Hi Group, I have been building a search engine for about 9 months now of links to other site that I have admin Access to. This has been simple for me to keep mySQL record of page hits, as I...
1
by: Donald Canton | last post by:
Hi, I just changed my browser settings to override automatic cookie handling and block all third party cookies. Now I'm curious. How are third party cookies allowed in the first place? I thought...
0
by: |-|erc | last post by:
-- J o i n I n T h e 1 s t O n l i n e N e w Y e a r s B a s h ! <^> <(·¿·)> <^> ---- <^> <(·¿·)> <^> 2004 <^> <(·¿·)> <^> --- <^> <(·¿·)> <^> Chat at www.chatty.net THE...
1
by: Samuel R. Neff | last post by:
We're using a 3rd party C DLL in a project that we don't have source for. When we call the DLL from a console app everything works fine. However, when we call it from a Windows Service, the DLL...
0
by: UKPostie | last post by:
I am writing a solution using C# under ASP.NET that must make use of a 3rd party DLL (written in C I believe). This DLL handles messaging between my location and a third party location. I have...
4
by: Rob R. Ainscough | last post by:
The task is brain dead simple - Uninstall prior Windows Service and Install newer version of Windows Service Background: 1. My Windows Service written in .NET 1.1 and deployed via MSI (Windows...
4
by: Tarren | last post by:
Hi, All: I am tasked with the following. I need to write a service to monitor an Exchange mailbox and take action when an email is received, put it in a db, etc. I do not need to send emails...
6
by: Ben Finney | last post by:
Howdy all, I'm improving an existing application that's partly written using Python and the standard library. Many of the improvements I want to make can be done by using third-party free...
69
by: Edward K Ream | last post by:
The pros and cons of making 'print' a function in Python 3.x are well discussed at: http://mail.python.org/pipermail/python-dev/2005-September/056154.html Alas, it appears that the effect of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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,...

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.