Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to use the Microsoft Debug Interface Access SDK from C#. This is installed with Visual Studio, but the docs don't seem to mention how you use this from C#.

I've found example code on interweb but no information on how to link to the DIA SDK. I.e. I can't import it as an assembly. I don't think I have to include it into a managed C++ application and use it as COM (that would be hell).

There is an IDL file, is this the correct way? If so, how?


Edit: The following will create the type library for use as a referenced assembly. Paste into a batch file.

call "%VS80COMNTOOLS%vsvars32.bat"
midl /I "%VSINSTALLDIR%DIA SDKinclude" "%VSINSTALLDIR%DIA SDKidldia2.idl" /tlb dia2.tlb
tlbimp dia2.tlb
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
457 views
Welcome To Ask or Share your Answers For Others

1 Answer

You need to convert the IDL to a typelib first:

Something like:

midl /I "%VSINSTALLDIR%DIA SDKinclude" dia2.idl /tlb dia2.tlb
tlbimp dia2.tlb

Then you can import the tlb.

I've never used the DIA SDK this way, so don't know how friendly it would be. You could also consider using it directly from a managed C++ assembly and presenting a managed interface to the functionality you need.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...