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
marabo82
NA
1
0
C# calling C++ DLL: pass struct
Jun 22 2004 7:12 PM
Hi, i am trying to call unmanaged C++ DLL in my C# application i converted all the structures to be .net compatible (e.g TCHAR to string (including Marshal As) one of the functions i try to call is defined in the DLL bool hhpConnect(Connection_tag* ptag, PTCHAR msg); where Connection_tag is defined as typedef Connection_tag { ...... } when i try to call it in C#, i use [DllImport("MyDLL.dll", CharSet=CharSet.Auto)] i am not sure how to call the Pointer to a structure? should i use public static extern bool hhpConnect([Ref, MarshalAs(UnmanagedType.Struct)] ref Connection_tag ptag,[MarshalAs(UnmanagedType.ByValTStr)] msg); i am confused, the *ptag would hold the connection setup parameters..? also, i think i need to MRashal the string msg too? how this be different if *ptag was to be changed in the hhpConnect? Thanks ALL Mo
[email protected]
Reply
Answers (
0
)
Building a web interface
WinForms