http://msdn2.microsoft.com
https://blogs.msdn.com/net
these links may provide some info for u
Main Topics
Browse All TopicsCan someone please tell me how I can call a function from a C dll in C# using delegates?
i.e. I want to change this (C)...
typedef long (*InitializePluginProc)(vo
typedef struct _PluginInterface
{
InitializePluginProc initializePlugin;
.............
}PluginInterface, FAR *LPPluginInterface;
to the equivalent in C# (This is what I have so far!)...
public unsafe delegate int *InitializePluginProc(void
public unsafe struct PluginInterface
{
public InitializePluginProc *initializePlugin;
......
......
}
in main()...
intf = (PluginInterface)Marshal.P
//int err = (int)(*(intf.initializePlu
Cheers guys! T.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
http://msdn2.microsoft.com
https://blogs.msdn.com/net
these links may provide some info for u
LinuxBugs, I haven't looked at you links yet (will do tomorrow thank you) but when I try the above function call I get the following error...
An unhandled exception of type 'System.NullReferenceExcep
Additional information: Object reference not set to an instance of an object.
I think my problems are bigger. If you can check this site and see if you can clear up anything for me!
http://www.codeproject.com
Again many thanks!!! T.
from what I have understood, I think we cant don anything with the function pointer which we get beacause it points to a funtion that is not present in the present existing file. may be we can use it if we try and duplicate the C function in C#
sorry for the late response but I was busy for the past few days :)
Business Accounts
Answer for Membership
by: LinuxBugsPosted on 2005-09-27 at 01:18:33ID: 14964964
http://www.experts-exchang e.com/Prog ramming/ Pr ogramming_ Languages/ C_Sharp/Q_ 21567487.h tml