.NET COM Callback

I am trying to write C # code that uses the DIA (Debug Interface Access) SDK to request a PDB file. I used the batch file described in this to create a wrapper assembly around the DIA type library. Now I was able to instantiate the various COM classes open by the SDK.

However, a problem arose. The method IDiaDataSource::loadDataForExerequires a callback object that implements one of the following interfaces:

  • IDiaLoadCallback
  • IDiaLoadCallback2
  • IDiaReadExeAtOffsetCallback
  • IDiaReadExeAtRVACallback

All of these interfaces are defined in the IDL, but they are not available in the generated .NET assembly.

Am I missing something or is this the only way to implement these interfaces in C # to manually declare them first using various COM attributes?

+4
source share
1 answer

Yes, this is a problem, the library of the generated type does not contain these interfaces. Something you can see by running the OleView.exe command, View + Typelib, displays the contents of a type library decompiled back into IDL syntax. Please note that IDiaLoadCallback and others are missing.

IDL, ++, DIA, , . , Midl.exe , [library]. , [coclass] . .

. dia2.idl , . , [library]. Midl.exe. .

+3

Source: https://habr.com/ru/post/1584245/


All Articles