Click here to Skip to main content
15,886,199 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: SymEnumSymbols is getting failed even GetLastError returns 0 Pin
Covean24-Mar-10 4:55
Covean24-Mar-10 4:55 
GeneralRe: SymEnumSymbols is getting failed even GetLastError returns 0 Pin
glitteringsound24-Mar-10 5:00
glitteringsound24-Mar-10 5:00 
GeneralRe: SymEnumSymbols is getting failed even GetLastError returns 0 Pin
Covean24-Mar-10 5:21
Covean24-Mar-10 5:21 
GeneralRe: SymEnumSymbols is getting failed even GetLastError returns 0 Pin
glitteringsound24-Mar-10 5:30
glitteringsound24-Mar-10 5:30 
GeneralRe: SymEnumSymbols is getting failed even GetLastError returns 0 Pin
Covean24-Mar-10 5:38
Covean24-Mar-10 5:38 
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 
exactly that code I am just trying upto large extent..

Here it's
string strPDBPath = "..//..//MathDLL//Release//MathDLL.pdb"
HANDLE hProcess = GetCurrentProcess();
DWORD symOptions = SymGetOptions();
DWORD oldOptions = symOptions;
symOptions|=SYMOPT_PUBLICS_ONLY;

SymSetOptions(symOptions);

bRet = ::SymInitialize(GetCurrentProcess(),NULL,FALSE);
if(bRet==FALSE)
{
_tprintf(_T("Error: SymInitialize() failed. Error code: %u \n"), ::GetLastError());
return 0;
}//end of if
do
{

DWORD BaseAddr = 0;
DWORD FileSize = 0;
// Determine the base address and the file size

const TCHAR* pFileName = (char*)strPDBPath.c_str();// = argv[1];

_tprintf(pFileName,"%s",(char*)strPDBPath.c_str());


if( !GetFileParams( pFileName, BaseAddr, FileSize ) )
{
_tprintf( _T("Error: Cannot obtain file parameters (internal error).\n") );
break;
}

DWORD ModBase = ::SymLoadModule (
GetCurrentProcess(), // Process handle of the current process
NULL, // Handle to the module's image file (not needed)
pFileName, // Path/name of the file
NULL, // User-defined short name of the module (it can be NULL)
BaseAddr, // Base address of the module (cannot be NULL if .PDB file is used, otherwise it can be NULL)
FileSize // Size of the file (cannot be NULL if .PDB file is used, otherwise it can be NULL)
);
if( ModBase == 0 )
{
_tprintf(_T("Error: SymLoadModule() failed. Error code: %u \n"), ::GetLastError());
break;
}
_tprintf( _T("\nLoad address: %u \n"), ModBase );

// Obtain and display information about loaded symbols

ShowSymbolInfo( ModBase );
// Enumerate symbols and display information about them

//if( pSearchMask != NULL )
if((char*)pSearchMask.c_str()!=NULL)
_tprintf( _T("Search mask: %s \n"), (char*)pSearchMask.c_str() );

_tprintf( _T("\nSymbols: \n") );
int NumLocals = 0;
bRet = ::SymEnumSymbols(GetCurrentProcess(),0,0,MyEnumSymbolsCallback,&NumLocals);

Here its code
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 
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 

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.