Click here to Skip to main content
15,896,063 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: get the window's rect Pin
David Crow17-Nov-09 7:08
David Crow17-Nov-09 7:08 
GeneralRe: get the window's rect Pin
CPallini17-Nov-09 6:03
mveCPallini17-Nov-09 6:03 
AnswerRe: get the window's rect Pin
Richard MacCutchan17-Nov-09 5:39
mveRichard MacCutchan17-Nov-09 5:39 
JokeRe: get the window's rect Pin
CPallini17-Nov-09 5:47
mveCPallini17-Nov-09 5:47 
QuestionExamples of SaveAs in winapi / c++ Pin
Nicola Curran17-Nov-09 2:07
Nicola Curran17-Nov-09 2:07 
QuestionRe: Examples of SaveAs in winapi / c++ Pin
CPallini17-Nov-09 2:21
mveCPallini17-Nov-09 2:21 
AnswerRe: Examples of SaveAs in winapi / c++ Pin
Nicola Curran17-Nov-09 2:38
Nicola Curran17-Nov-09 2:38 
AnswerRe: Examples of SaveAs in winapi / c++ Pin
CPallini17-Nov-09 2:46
mveCPallini17-Nov-09 2:46 
GeneralRe: Examples of SaveAs in winapi / c++ Pin
Nicola Curran17-Nov-09 3:10
Nicola Curran17-Nov-09 3:10 
GeneralRe: Examples of SaveAs in winapi / c++ Pin
Nicola Curran17-Nov-09 3:13
Nicola Curran17-Nov-09 3:13 
GeneralRe: Examples of SaveAs in winapi / c++ Pin
Nicola Curran17-Nov-09 3:13
Nicola Curran17-Nov-09 3:13 
QuestionDont send error message occured only once Pin
thippipriya17-Nov-09 2:02
thippipriya17-Nov-09 2:02 
QuestionRe: Dont send error message occured only once Pin
David Crow17-Nov-09 3:37
David Crow17-Nov-09 3:37 
AnswerRe: Dont send error message occured only once [modified] Pin
thippipriya17-Nov-09 16:25
thippipriya17-Nov-09 16:25 
QuestionCalling dll function Pin
Le@rner17-Nov-09 1:05
Le@rner17-Nov-09 1:05 
AnswerRe: Calling dll function Pin
SandipG 17-Nov-09 1:29
SandipG 17-Nov-09 1:29 
AnswerRe: Calling dll function Pin
Kushagra Tiwari17-Nov-09 2:46
Kushagra Tiwari17-Nov-09 2:46 
QuestionHow to create a vector? Pin
deadlyabbas17-Nov-09 0:58
deadlyabbas17-Nov-09 0:58 
AnswerRe: How to create a vector? Pin
Jijo.Raj17-Nov-09 1:30
Jijo.Raj17-Nov-09 1:30 
GeneralRe: How to create a vector? Pin
deadlyabbas17-Nov-09 3:50
deadlyabbas17-Nov-09 3:50 
GeneralRe: How to create a vector? Pin
«_Superman_»17-Nov-09 7:17
professional«_Superman_»17-Nov-09 7:17 
Questiondde problem Pin
trioum17-Nov-09 0:24
trioum17-Nov-09 0:24 
QuestionFind out Build Configuration from exe Pin
Maya_16-Nov-09 23:21
Maya_16-Nov-09 23:21 
AnswerRe: Find out Build Configuration from exe Pin
Randor 17-Nov-09 2:13
professional Randor 17-Nov-09 2:13 
Hi Maya,

The PE format is documented here:

Microsoft Portable Executable and Common Object File Format Specification[^]

You can check the IMAGE_FILE_HEADER section[^] of the COFF header for the IMAGE_FILE_DEBUG_STRIPPED flag. Here is an example:

BOOL IsDebugImage(LPTSTR szPath)
{
	BOOL bRet = FALSE;
	HANDLE hFile = CreateFile(szPath,GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
	if(NULL != hFile)
	{
		LARGE_INTEGER bigInt;
		if(TRUE == GetFileSizeEx(hFile, &bigInt))
		{
			HANDLE hFileMap = CreateFileMapping(hFile,NULL,PAGE_READWRITE,bigInt.HighPart,bigInt.LowPart + 0x2000 ,NULL);
			if(NULL != hFileMap)
			{
				LPVOID hMap = MapViewOfFile(hFileMap,FILE_MAP_READ,0,0,0);
				if(NULL != hMap)
				{
					HMODULE hModule = (HMODULE)hMap;
					IMAGE_DOS_HEADER * pDosHeader = (IMAGE_DOS_HEADER *)hModule;
					IMAGE_FILE_HEADER * pFileHeader = (IMAGE_FILE_HEADER *)(((LPBYTE)hModule) + pDosHeader->e_lfanew + sizeof(IMAGE_NT_SIGNATURE));	
					
					bRet =  !(pFileHeader->Characteristics &IMAGE_FILE_DEBUG_STRIPPED);
					
					UnmapViewOfFile(hFileMap);
				}
				CloseHandle(hFileMap);
			}
		}
		CloseHandle(hFile);
	}
	return bRet;
}


Best Wishes,
-David Delaune
QuestionRe: Find out Build Configuration from exe Pin
David Crow17-Nov-09 3:43
David Crow17-Nov-09 3:43 

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.