1

I tried to import Microsoft's DIA SDK for use with .NET:

call "%VS90COMNTOOLS%\vsvars32.bat"
midl /I "%VSINSTALLDIR%\DIA SDK\include" "%VSINSTALLDIR%\DIA SDK\idl\dia2.idl" /tlb dia2.tlb
tlbimp dia2.tlb

Which seems to work correctly for the most part, except that, for some reason, it doesn't include some of the interfaces (e.g. IDiaEnumFrameData), while it includes the rest just fine.

(The interface is neither present in the .DLL file, nor in the .TLB file -- even though it is present in the C and header files.)

What is causing this?

user541686
  • 205,094
  • 128
  • 528
  • 886

3 Answers3

1

Basically what I did was I added an extra "MIDL hack" method in the IDiaDataSource definition (in DIA SDK\idl\dia2.idl) that takes all the "unused" enum types as arguments. As long as the method is at the end of the interface definition (and you don't actually call it, of course), the rest of the vtable methods will still work fine. You'll also need to add forward declarations for the other interfaces at the beginning of the file.

Drew McGowen
  • 11,471
  • 1
  • 31
  • 57
1

midl.exe shoves to the generated type library only items (and their dependencies) from the 'library' section in the idl description.

Add the missed interface to the 'library' section and you will get what do you want

//...
library Dia2Lib
{
//...
interface IDiaEnumFrameData; // << insert it
//...
}
0

I'm not sure if want to try the hard road, but if you have access to the IDL you could mimick the Interface using work similar to what was done in the TaskScheduler project on Codeproject. (Yes I know it's old).

TaskSchedulerInterop.cs

http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=2407

Paul Farry
  • 4,730
  • 2
  • 35
  • 61