Click here to Skip to main content
15,891,431 members
Home / Discussions / C#
   

C#

 
AnswerRe: Draw a rectangle in a richtextbox? Pin
jtmtv183-Mar-03 6:39
jtmtv183-Mar-03 6:39 
Questionvoid* interop? Pin
Anonymous2-Mar-03 19:55
Anonymous2-Mar-03 19:55 
AnswerRe: void* interop? Pin
Jeff J2-Mar-03 21:16
Jeff J2-Mar-03 21:16 
GeneralRe: void* interop? Pin
Anonymous3-Mar-03 2:04
Anonymous3-Mar-03 2:04 
GeneralRe: void* interop? Pin
leppie3-Mar-03 7:06
leppie3-Mar-03 7:06 
GeneralRe: void* interop? Pin
Jeff J4-Mar-03 14:36
Jeff J4-Mar-03 14:36 
GeneralInterop - Marshaling nested structs Pin
Nathan Tran2-Mar-03 19:01
Nathan Tran2-Mar-03 19:01 
GeneralRe: Interop - Marshaling nested structs Pin
leppie3-Mar-03 7:38
leppie3-Mar-03 7:38 
Nathan Tran wrote:
I'm getting a System.ArgumentException trying to call the following
IActiveDesktop method:

STDMETHOD (AddDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;

This is how I'm marshaling the call.

void AddDesktopItem(
[In, MarshalAs( UnmanagedType.LPStruct )] COMPONENT pcomp,
[In] int dwReserved
);

I believe the problem is with marshaling the COMPONENT structure.


STOP! Smile | :) Its exactly what it says. Dont use LPStruct. Just add ref to it, or Marshall the structure to unmanaged memory 1st, then pass an IntPtr into the function (obviously you will need to change the function definition).

Once (and only then), you can lok at the HRESULT you are getting to see if the struct size is infact correct (which probably wont be the case, never is with these nested structs). Good luck Smile | :)
NOT lol, where is the functions DllImportAttribute? Thats the problem. Not sure how it compiled...

I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
GeneralRe: Interop - Marshaling nested structs Pin
Nathan Tran3-Mar-03 11:56
Nathan Tran3-Mar-03 11:56 
GeneralRe: Interop - Marshaling nested structs Pin
leppie4-Mar-03 7:03
leppie4-Mar-03 7:03 
GeneralHowto: image to byte array Pin
Smitha Nishant2-Mar-03 18:56
protectorSmitha Nishant2-Mar-03 18:56 
GeneralRe: Howto: image to byte array Pin
Jeff J2-Mar-03 21:26
Jeff J2-Mar-03 21:26 
GeneralRe: Howto: image to byte array Pin
Smitha Nishant2-Mar-03 22:10
protectorSmitha Nishant2-Mar-03 22:10 
General***capturing image from video*** Pin
henrykao2-Mar-03 18:37
henrykao2-Mar-03 18:37 
QuestionCan you use resources to embed a wav? Pin
jtmtv182-Mar-03 13:48
jtmtv182-Mar-03 13:48 
AnswerRe: Can you use resources to embed a wav? Pin
leppie3-Mar-03 8:02
leppie3-Mar-03 8:02 
GeneralRe: Can you use resources to embed a wav? Pin
jtmtv183-Mar-03 8:32
jtmtv183-Mar-03 8:32 
GeneralRe: Can you use resources to embed a wav? Pin
leppie4-Mar-03 6:57
leppie4-Mar-03 6:57 
GeneralAeru IRC is looking for developpers and artist Pin
Shock The Dark Mage2-Mar-03 12:46
Shock The Dark Mage2-Mar-03 12:46 
GeneralRe: Aeru IRC is looking for developpers and artist Pin
jtmtv183-Mar-03 19:17
jtmtv183-Mar-03 19:17 
GeneralRe: Aeru IRC is looking for developpers and artist Pin
Shock The Dark Mage5-Mar-03 15:47
Shock The Dark Mage5-Mar-03 15:47 
GeneralFlattening The TreeView... Pin
LokiSD2-Mar-03 10:26
LokiSD2-Mar-03 10:26 
GeneralRe: Flattening The TreeView... Pin
LokiSD3-Mar-03 7:42
LokiSD3-Mar-03 7:42 
GeneralRe: Flattening The TreeView... Pin
Furty4-Mar-03 1:49
Furty4-Mar-03 1:49 
GeneralRe: Flattening The TreeView... Pin
LokiSD5-Mar-03 6:51
LokiSD5-Mar-03 6:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.