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
Sangeetha
NA
2
0
Device Application in C# Marshalling Exception
Apr 22 2009 6:01 AM
Hi,
I am developing a Smart device Application which is communicating with a driver written C using DeviceIOControl().
My structure is as follows
struct IPOD_OUT_GET_ALL_NAMES
{
public UInt32 dwStatus;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
public string []sNamesOfItems;
}
Code is as follows.
IPOD_OUT_GET_ALL_NAMES IPodOutGetAllNames = new IPOD_OUT_GET_ALL_NAMES();
int size = Marshal.SizeOf(typeof(IPOD_OUT_GET_ALL_NAMES));
IntPtr pEvent = IntPtr.Zero;
pEvent = Marshal.AllocHGlobal(size); System.Runtime.InteropServices.Marshal.StructureToPtr(
IPodOutGetAllNames,
pEvent,
false);
At the invocation of Marshal.SizeOf(typeof(IPOD_OUT_GET_ALL_NAMES));
Exception is thrown
system.runtime.interopservices.marshal.SizeOf Internal() exception for the structure which contains 2dimentional string array.
Plese help.
Reply
Answers (
0
)
How to use Ajax in .net
How do i retrive image from word document.