Click here to Skip to main content
15,888,802 members
Home / Discussions / C#
   

C#

 
GeneralRetrive value of Address from xml file Pin
ksanju100012-May-05 3:01
ksanju100012-May-05 3:01 
GeneralRe: Retrive value of Address from xml file Pin
Dave Kreskowiak12-May-05 9:03
mveDave Kreskowiak12-May-05 9:03 
Generalmonitor file system Pin
s2111979212-May-05 2:17
s2111979212-May-05 2:17 
GeneralRe: monitor file system Pin
Dave Kreskowiak12-May-05 9:02
mveDave Kreskowiak12-May-05 9:02 
GeneralA Link to forum Pin
MoustafaS12-May-05 1:52
MoustafaS12-May-05 1:52 
GeneralRe: A Link to forum Pin
Colin Angus Mackay12-May-05 2:52
Colin Angus Mackay12-May-05 2:52 
Generalchange image on CrystalReport Pin
fivestart200312-May-05 1:41
fivestart200312-May-05 1:41 
GeneralGuid to intPtr Pin
Mikke_x12-May-05 1:34
Mikke_x12-May-05 1:34 
Hi all!

I have a small Interop question:

I have a COM object that takes a structure as in-parameter. One of the fields in the structure is an IID*. When doing this in C++ the code:
GUID rrid = __uuidof( _InterfaceName );
parStruct.riid = &rrid;
works fine.

How would I do this in C#? I have tried several things, but can´t get it to work. The type of the struct-field in C# is intPtr. And the only way I can find such a type, that I can think of, is:
Type t = typeof( _InterfaceName );
System.RuntimeTypeHandle h = t.TypeHandle;
parStruct.riid = h.Value;
But I guess that I am way off here.

Any one that can give me a hand here?

Regards
Mikke


Added info:

Hi again!

I tried to create a C++ .Net project instead, just to try and find a work-around. When I took the COM objects needed and tried to import them into my brand new cpp project i got this error message:
TlbImp warning: The type library importer could not convert the signature for the member 'RobEventParams.riid'.
And a couple of other ones like this one for other similar parameter-structs with riid fields. What does that mean for me? Is it impossible to marshal something from .Net into this COM? The purpose is to set up a sink and recieve events from the COM object, to do this I should send a ref to an object that should recieve the events and the signature of an interface implemented in the receiver. It is the interface "signature" that is the riid, and also the problem here. When I execute my C# code above I get an exception telling me that "No such interface supported". Do I have to submit a non-.net method as a sink here?

Best regards again / Mikke


Generallistview select Pin
x-trate12-May-05 0:28
x-trate12-May-05 0:28 
GeneralRe: listview select Pin
leppie12-May-05 2:14
leppie12-May-05 2:14 
Generalreinterpret_cast in C# Pin
trannampro11-May-05 22:56
trannampro11-May-05 22:56 
GeneralRe: reinterpret_cast in C# Pin
S. Senthil Kumar12-May-05 3:31
S. Senthil Kumar12-May-05 3:31 
GeneralRe: reinterpret_cast in C# Pin
mav.northwind12-May-05 23:16
mav.northwind12-May-05 23:16 
Questionconverting long to string, string to long? Pin
george ivanov11-May-05 22:47
george ivanov11-May-05 22:47 
AnswerRe: converting long to string, string to long? Pin
V.11-May-05 23:27
professionalV.11-May-05 23:27 
AnswerRe: converting long to string, string to long? Pin
Indagro11-May-05 23:31
Indagro11-May-05 23:31 
Generalthe one who know vb.net and cSharp Pin
Rizwan Bashir11-May-05 22:41
Rizwan Bashir11-May-05 22:41 
GeneralRe: the one who know vb.net and cSharp Pin
S. Senthil Kumar12-May-05 3:37
S. Senthil Kumar12-May-05 3:37 
GeneralRe: the one who know vb.net and cSharp Pin
Luis Alonso Ramos12-May-05 12:18
Luis Alonso Ramos12-May-05 12:18 
GeneralRe: the one who know vb.net and cSharp Pin
mav.northwind12-May-05 23:37
mav.northwind12-May-05 23:37 
GeneralRe: the one who know vb.net and cSharp Pin
Rizwan Bashir13-May-05 2:22
Rizwan Bashir13-May-05 2:22 
Generalopen .exe file Pin
eng.mohamed11-May-05 22:40
eng.mohamed11-May-05 22:40 
GeneralRe: open .exe file Pin
Polis Pilavas12-May-05 0:15
Polis Pilavas12-May-05 0:15 
GeneralNew to remote procedure calls, please help... Pin
AfzalHassen11-May-05 22:16
AfzalHassen11-May-05 22:16 
GeneralOOP concept - C# Pin
Anonymous11-May-05 21:34
Anonymous11-May-05 21:34 

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.