Click here to Skip to main content
15,884,298 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: SymEnumSymbols is getting failed even GetLastError returns 0 Pin
glitteringsound24-Mar-10 5:50
glitteringsound24-Mar-10 5:50 
GeneralRe: SymEnumSymbols is getting failed even GetLastError returns 0 Pin
Covean24-Mar-10 6:00
Covean24-Mar-10 6:00 
GeneralRe: SymEnumSymbols is getting failed even GetLastError returns 0 Pin
glitteringsound24-Mar-10 6:07
glitteringsound24-Mar-10 6:07 
GeneralRe: SymEnumSymbols is getting failed even GetLastError returns 0 Pin
Covean24-Mar-10 6:18
Covean24-Mar-10 6:18 
GeneralRe: SymEnumSymbols is getting failed even GetLastError returns 0 Pin
glitteringsound24-Mar-10 6:42
glitteringsound24-Mar-10 6:42 
GeneralRe: SymEnumSymbols is getting failed even GetLastError returns 0 Pin
Covean25-Mar-10 3:25
Covean25-Mar-10 3:25 
GeneralRe: SymEnumSymbols is getting failed even GetLastError returns 0 Pin
cmk24-Mar-10 12:28
cmk24-Mar-10 12:28 
GeneralRe: SymEnumSymbols is getting failed even GetLastError returns 0 Pin
glitteringsound24-Mar-10 20:27
glitteringsound24-Mar-10 20:27 
bool GetFileParams( const TCHAR* pFileName, DWORD64& BaseAddr, DWORD& FileSize )
{
// Check parameters

if( pFileName == 0 )
{
return false;
}


// Determine the extension of the file

TCHAR szFileExt[_MAX_EXT] = {0};

_tsplitpath( pFileName, NULL, NULL, NULL, szFileExt );


// Is it .PDB file ?

if( _tcsicmp( szFileExt, _T(".PDB") ) == 0 )
{
// Yes, it is a .PDB file

// Determine its size, and use a dummy base address

BaseAddr = 0x10000000; // it can be any non-zero value, but if we load symbols
// from more than one file, memory regions specified
// for different files should not overlap
// (region is "base address + file size")

if( !GetFileSize( pFileName, FileSize ) )
{
return false;
}

}
else
{
// It is not a .PDB file

// Base address and file size can be 0

BaseAddr = 0;
FileSize = 0;
}


// Complete

return true;

}

bool GetFileSize( const TCHAR* pFileName, DWORD& FileSize )
{
// Check parameters

if( pFileName == 0 )
{
return false;
}


// Open the file

HANDLE hFile = ::CreateFile( pFileName, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, 0, NULL );

if( hFile == INVALID_HANDLE_VALUE )
{
_tprintf( _T("CreateFile() failed. Error: %u \n"), ::GetLastError() );
return false;
}


// Obtain the size of the file

FileSize = ::GetFileSize( hFile, NULL );

if( FileSize == INVALID_FILE_SIZE )
{
_tprintf( _T("GetFileSize() failed. Error: %u \n"), ::GetLastError() );
// and continue ...
}


// Close the file

if( !::CloseHandle( hFile ) )
{
_tprintf( _T("CloseHandle() failed. Error: %u \n"), ::GetLastError() );
// and continue ...
}


// Complete

return ( FileSize != INVALID_FILE_SIZE );

}
QuestionDifference between C and Visual C. Pin
Razanust24-Mar-10 4:17
Razanust24-Mar-10 4:17 
QuestionRe: Difference between C and Visual C. Pin
David Crow24-Mar-10 4:32
David Crow24-Mar-10 4:32 
AnswerRe: Difference between C and Visual C. Pin
Chris Losinger24-Mar-10 7:10
professionalChris Losinger24-Mar-10 7:10 
QuestionWindow is not getting Maximize on WINDOWS 7 operating system Pin
pandit8424-Mar-10 2:30
pandit8424-Mar-10 2:30 
AnswerRe: Window is not getting Maximize on WINDOWS 7 operating system Pin
KarstenK24-Mar-10 3:16
mveKarstenK24-Mar-10 3:16 
Question[solved] What benefit has a MULTIBYTE application compared to a UNICODE version ? [modified] Pin
Eugen Podsypalnikov24-Mar-10 0:45
Eugen Podsypalnikov24-Mar-10 0:45 
AnswerRe: What benefit has a MULTIBYTE application compared to a UNICODE version ? Pin
Moak24-Mar-10 1:02
Moak24-Mar-10 1:02 
GeneralRe: What benefit has a MULTIBYTE application compared to a UNICODE version ? Pin
Eugen Podsypalnikov24-Mar-10 1:38
Eugen Podsypalnikov24-Mar-10 1:38 
GeneralRe: What benefit has a MULTIBYTE application compared to a UNICODE version ? Pin
Saurabh.Garg24-Mar-10 17:41
Saurabh.Garg24-Mar-10 17:41 
AnswerRe: [solved] What benefit has a MULTIBYTE application compared to a UNICODE version ? Pin
Saurabh.Garg24-Mar-10 17:43
Saurabh.Garg24-Mar-10 17:43 
GeneralRe: [solved] What benefit has a MULTIBYTE application compared to a UNICODE version ? Pin
Eugen Podsypalnikov24-Mar-10 21:19
Eugen Podsypalnikov24-Mar-10 21:19 
GeneralRe: [solved] What benefit has a MULTIBYTE application compared to a UNICODE version ? Pin
Saurabh.Garg24-Mar-10 21:35
Saurabh.Garg24-Mar-10 21:35 
GeneralRe: [solved] What benefit has a MULTIBYTE application compared to a UNICODE version ? Pin
Moak24-Mar-10 22:27
Moak24-Mar-10 22:27 
QuestionWindows Media Player Pin
gmallax24-Mar-10 0:39
gmallax24-Mar-10 0:39 
AnswerRe: Windows Media Player Pin
KarstenK24-Mar-10 3:18
mveKarstenK24-Mar-10 3:18 
Questiondocumenting .c files using doxygen,which doesnot have any comment or description or documents in it except code Pin
itssheen24-Mar-10 0:21
itssheen24-Mar-10 0:21 
AnswerRe: documenting .c files using doxygen,which doesnot have any comment or description or documents in it except code Pin
Richard MacCutchan24-Mar-10 1:56
mveRichard MacCutchan24-Mar-10 1:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.