Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2005

Tip: Looking for answers? Try searching our database.

passing naitve function pointers to naitve code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MrPugh@gmx.de - 26 Oct 2005 13:37 GMT
Hi!

I have a strange problem:

I need to wrap a C-function in a native DLL into a C#-class. This
function expects one C-function pointer out of a set of some
C-functions defined in the same DLL.

How can I access and pass such a C-function pointer to a C-function out
of C#?

Thank You!
 Ruben
Jack Ukleja - 28 Oct 2005 02:16 GMT
As far as im aware you just pass a delegate through to the C-function (via
P/Invoke) and it all works by "magic"! The C-dll will call back to your C#
delegate transparently.

> Hi!
>
[quoted text clipped - 9 lines]
> Thank You!
>   Ruben
MrPugh@gmx.de - 28 Oct 2005 10:57 GMT
Jack Ukleja schrieb:
> As far as im aware you just pass a delegate through to the C-function (via
> P/Invoke) and it all works by "magic"! The C-dll will call back to your C#
> delegate transparently.

Sorry, my question was obviously bad phrased:

The function B(), which the native function A() in the dll should call
back, is also a native c-function in the same dll.
One way would be to wrap the function B() into a delegate. But this
would mean, that I jump from C# to A(), than back to the delegate in
C#, which calls the function B().

I would like to avoid that, if there is a way...

Thank you!
 Ruben

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.