description | title | ms.date | ms.topic | dev_langs | helpviewer_keywords | author | ms.author | manager | ms.subservice | ||
---|---|---|---|---|---|---|---|---|---|---|---|
Represents a source file. |
IDiaSourceFile |
11/04/2016 |
reference |
|
|
mikejo5000 |
mikejo |
mijacobs |
debug-diagnostics |
Represents a source file.
IDiaSourceFile : IUnknown
The following table shows the methods of IDiaSourceFile
.
Method | Description |
---|---|
IDiaSourceFile::get_uniqueId | Retrieves a simple integer key value that is unique for this image. |
IDiaSourceFile::get_fileName | Retrieves the source file name. |
IDiaSourceFile::get_checksumType | Retrieves the checksum type. |
IDiaSourceFile::get_compilands | Retrieves an enumerator of the compilands with line numbers referencing this file. |
IDiaSourceFile::get_checksum | Retrieves the checksum bytes. |
Obtain this interface by calling the IDiaEnumSourceFiles::Item or IDiaEnumSourceFiles::Next methods. See the example for details.
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;
}
}
}
Header: Dia2.h
Library: diaguids.lib
DLL: msdia80.dll