471,570 Members | 940 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,570 software developers and data experts.

question on wrapping IOleContainer

I am trying to wrap IOleContainer and having trouble getting the ENumObjects
declaration correct.
This is what I have so far:

[ComImport,
Guid("0000011B-0000-0000-C000-000000000046"),
InterfaceTypeAttribute(ComInterfaceType.InterfaceI sIUnknown)]
public interface IOleContainer
{
void ParseDisplayName(
[In, MarshalAs(UnmanagedType.Interface)] object pbc,
[In, MarshalAs(UnmanagedType.BStr)] string pszDisplayName,
[Out, MarshalAs(UnmanagedType.LPArray)] int[] pchEaten,
[Out, MarshalAs(UnmanagedType.LPArray)] object[] ppmkOut);
void EnumObjects([In, MarshalAs(UnmanagedType.U4)] int grfFlags,
[Out, MarshalAs(UnmanagedType.LPArray)] object[] ppenum);
void LockContainer([In, MarshalAs(UnmanagedType.I4)] int fLock);
}

Any suggestions?
Dec 1 '05 #1
1 2375
Sheldon,

When you come across IEnumUnknown, that is an interface pointer that is
being returned, so you need to actually declare that interface type, and
then pass it by ref (with the ref keyword), or, you can always pass an
IntPtr by ref (and ignore it).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"sheldon woloshyn" <sh******@accesswave.ca> wrote in message
news:ea**************@TK2MSFTNGP09.phx.gbl...
I am trying to wrap IOleContainer and having trouble getting the
ENumObjects declaration correct.
This is what I have so far:

[ComImport,
Guid("0000011B-0000-0000-C000-000000000046"),
InterfaceTypeAttribute(ComInterfaceType.InterfaceI sIUnknown)]
public interface IOleContainer
{
void ParseDisplayName(
[In, MarshalAs(UnmanagedType.Interface)] object pbc,
[In, MarshalAs(UnmanagedType.BStr)] string pszDisplayName,
[Out, MarshalAs(UnmanagedType.LPArray)] int[] pchEaten,
[Out, MarshalAs(UnmanagedType.LPArray)] object[] ppmkOut);
void EnumObjects([In, MarshalAs(UnmanagedType.U4)] int grfFlags,
[Out, MarshalAs(UnmanagedType.LPArray)] object[] ppenum);
void LockContainer([In, MarshalAs(UnmanagedType.I4)] int fLock);
}

Any suggestions?

Dec 1 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by yawnmoth | last post: by
35 posts views Thread by David Cleaver | last post: by
8 posts views Thread by Nathan | last post: by
4 posts views Thread by phl | last post: by
1 post views Thread by m.banaouas | last post: by
4 posts views Thread by Abubakar | last post: by
9 posts views Thread by martymix | last post: by
35 posts views Thread by rebeccatre | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.