[reSIProcate] unmanaged dll static function help

Jeremy Geras jgeras at newheights.com
Mon Dec 18 15:58:29 CST 2006


I think you can only use .NET's DllImport with C code, so to do things
the OO way, you will need to write a managed wrapper (managed C++ class
library) for resip/dum.  How much of the functionality you expose to
your C# code is up to you (depends on the kind of application you're
writing), however I've found that trying to mimic the interface of the
C++ code that I'm wrapping is the approach that gives you the most
flexibility (and saves you from writing some of the complicated bits in
C++).  So, for example, for reSIProcate's SipStack class, you would need
a __gc ManagedSipStack class has the same functions as SipStack, and
similarly for other classes in reSIProcate/DUM.

 

Having said this, I know there is already work underway for a DUM v2, so
I'm not sure how much of the wrapper code would need to be re-written
when/if there are interface changes coming with that...

 

Also, if you're lucky enough to be working with .NET 2.0 already then
it's actually C++/CLI that you'll be using (different syntax than
managed C++, which is what you use with previous versions of .NET).
Otherwise you get to look forward to doing the conversion at some point
when you want to switch.

 

________________________________

From: resiprocate-devel-bounces at list.resiprocate.org
[mailto:resiprocate-devel-bounces at list.resiprocate.org] On Behalf Of
Justin Matthews
Sent: Monday, December 18, 2006 1:30 PM
To: 'heather jiang'; resiprocate-devel at list.resiprocate.org
Subject: Re: [reSIProcate] unmanaged dll static function help

 

Yes, resiprocate built on windows is unmanaged code.

 

I have successfully created a test application for C# that uses the
resip library.  To translate the functionality from resiprocate to my C#
app a separate DLL was created with a C-style header function that can
access the required resiprocate code.  This obviously has its drawbacks,
just one example of how this can be done.

 

-justin

 

________________________________

From: resiprocate-devel-bounces at list.resiprocate.org
[mailto:resiprocate-devel-bounces at list.resiprocate.org] On Behalf Of
heather jiang
Sent: Monday, December 18, 2006 4:09 PM
To: heather jiang; resiprocate-devel at list.resiprocate.org
Subject: Re: [reSIProcate] unmanaged dll static function help

 

By the way, to make it clear, the intention is to use unmanaged c++
reSIProcate.dll at managed c#.net environment, and how to use the static
functions which are prohibited at dllimport/dllexport...

heather jiang <heather37j at yahoo.com> wrote: 

Anyone has the case of using the reSIProcate dll at .NET application. I
found that :

 

1. reSIProcate dlls is unmanaged dll and needs a wrapper to be
recognized/used at c#.net code.--Is it true?

 

 2. However, if it is the case, all static functions are not
transferrable by dllimport/export. 

 

Could anybody help with this?

Justin Matthews <jmatthewsr at gmail.com> wrote:

	To build on windows open reSIProcate_7_1.sln using Visual C++
7.1 or higher.

	 

	-justin

	 

	
________________________________


	From: resiprocate-devel-bounces at list.resiprocate.org
[mailto:resiprocate-devel-bounces at list.resiprocate.org] On Behalf Of xu
cai
	Sent: Monday, December 18, 2006 2:41 AM
	To: resiprocate-devel at list.resiprocate.org
	Subject: [reSIProcate] how to config/compile resiprocate on
windows

	 

	I didn't see the document on www.resiprocate.org
<http://www.resiprocate.org/> , anybody can help ? thanks
	
	-- 
	- xucai 

	_______________________________________________
	resiprocate-devel mailing list
	resiprocate-devel at list.resiprocate.org
	https://list.resiprocate.org/mailman/listinfo/resiprocate-devel

 

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

 

 __________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20061218/c6bdd96d/attachment.htm>


More information about the resiprocate-devel mailing list