IDiaSourceFile
Represents a source file.
IDiaSourceFile : IUnknown
Methods in Vtable Order
The following table shows the methods of IDiaSourceFile.
Method |
Description |
---|---|
Retrieves a simple integer key value that is unique for this image. |
|
Retrieves the source file name. |
|
Retrieves the checksum type. |
|
Retrieves an enumerator of the compilands with line numbers referencing this file. |
|
Retrieves the checksum bytes. |
Remarks
Notes for Callers
Obtain this interface by calling the IDiaEnumSourceFiles::Item or IDiaEnumSourceFiles::Next methods. See the example for details.
Example
This function displays the names of all source files contributing to the specified table.
void ShowSourceFiles(IDiaTable *pTable)
{
CComPtr<IDiaEnumSourceFiles> pSourceFiles;
if ( SUCCEEDED( pTable->QueryInterface(
_uuidof( IDiaEnumSourceFiles ),
(void**)&pSourceFiles )
)
)
{
CComPtr<IDiaSourceFile> pSourceFile;
while ( SUCCEEDED( hr = pSourceFiles->Next( 1, &pSourceFile, &celt ) ) &&
celt == 1 )
{
CDiaBSTR fileName;
if ( pSourceFile->get_fileName( &fileName) == S_OK )
{
printf( "file name: %ws\n", fileName );
}
pSourceFile = NULL;
}
}
}
Requirements
Header: Dia2.h
Library: diaguids.lib
DLL: msdia80.dll
See Also
Reference
IDiaLineNumber::get_sourceFile
IDiaSession::findLinesByLinenum