TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
vijaya.nutakki
NA
23
0
callback fucntions in unmanaged code
Sep 29 2003 6:29 AM
Here is the syntax of an Unmanaged function : int PBORCA_LibraryDirectory ( int hORCASession, LPSTR lpszLibName, LPSTR lpszLibComments, int iCmntsBuffSize, PBORCA_LISTPROC pListProc, LPVOID pUserData ); pListProc- pointer to a callback function. pUserData- pointer to a structre. Ive used the following prototype in managed fucntion: public class UserData { [ MarshalAs( UnmanagedType.ByValTStr, SizeConst=20000 )] public string buffer; public ulong callcount; public ulong size; public ulong buffoffset; } [DllImport("pborc80.dll",CharSet=CharSet.Ansi,EntryPoint="PBORCA_LibraryDirectory")]//...Ansi)] public static extern int LibraryEntry(int hnd,[MarshalAs(UnmanagedType.LPStr)] string s,[Out] char[] buf,int size,callback c,[In,Out] UserData us1 ); I've also included callback fucntion through the delegates. but it's giving me the error "Object reference not set to an instance of an object" what is the apt managed prototype for this fucntion in C#?
Reply
Answers (
0
)
Create a ".vsd" file
unmanaged code structure with a pointer