Can not marshal parameter #4: The type definition of this type has no layout information.
-
Hai In my applcation i want to list all machines in the network. So i used the WNetOpenEnum API . My code looks like, [DllImport("Mpr.dll", EntryPoint="WNetOpenEnumA", CallingConvention=CallingConvention::Winapi)] static ErrorCodes WNetOpenEnum(ResourceScope dwScope, ResourceType dwType, ResourceUsage dwUsage, NETRESOURCE* p, IntPtr &lphEnum); NETRESOURCE* pRsrc = new NETRESOURCE(); //A managed class IntPtr handle = IntPtr::Zero; result = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_DISK, RESOURCEUSAGE_ALL, pRsrc, handle); But when i run the application got an error " Can not marshal parameter #4: The type definition of this type has no layout information. " Whats is the problem. Plz help
-
Hai In my applcation i want to list all machines in the network. So i used the WNetOpenEnum API . My code looks like, [DllImport("Mpr.dll", EntryPoint="WNetOpenEnumA", CallingConvention=CallingConvention::Winapi)] static ErrorCodes WNetOpenEnum(ResourceScope dwScope, ResourceType dwType, ResourceUsage dwUsage, NETRESOURCE* p, IntPtr &lphEnum); NETRESOURCE* pRsrc = new NETRESOURCE(); //A managed class IntPtr handle = IntPtr::Zero; result = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_DISK, RESOURCEUSAGE_ALL, pRsrc, handle); But when i run the application got an error " Can not marshal parameter #4: The type definition of this type has no layout information. " Whats is the problem. Plz help