Click here to Skip to main content
15,902,447 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionError handling Pin
saisp6-May-07 20:16
saisp6-May-07 20:16 
AnswerRe: Error handling Pin
Hans Dietrich6-May-07 20:28
mentorHans Dietrich6-May-07 20:28 
GeneralRe: Error handling Pin
Rajesh R Subramanian6-May-07 20:33
professionalRajesh R Subramanian6-May-07 20:33 
GeneralRe: Error handling Pin
Hans Dietrich6-May-07 20:43
mentorHans Dietrich6-May-07 20:43 
GeneralRe: Error handling Pin
saisp6-May-07 20:34
saisp6-May-07 20:34 
GeneralRe: Error handling Pin
Hans Dietrich6-May-07 20:42
mentorHans Dietrich6-May-07 20:42 
AnswerRe: Error handling Pin
Rajesh R Subramanian6-May-07 20:32
professionalRajesh R Subramanian6-May-07 20:32 
Questiongetting process handle to a known process name Pin
nimatek6-May-07 19:55
nimatek6-May-07 19:55 
weird thing happening. code sniplet:
<br />
HANDLE WR_Process;<br />
<br />
	HANDLE hProcessSnap;<br />
	HANDLE hProcess;<br />
	PROCESSENTRY32 pe32;<br />
	<br />
	hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );<br />
	if( hProcessSnap == INVALID_HANDLE_VALUE )<br />
	{<br />
		MessageBox("hProcessSnap == INVALID_HANDLE_VALUE", "Error", MB_OK);<br />
		exit(0);<br />
	}<br />
<br />
	pe32.dwSize = sizeof( PROCESSENTRY32 );<br />
<br />
	if(!Process32First(hProcessSnap, &pe32))<br />
	{<br />
		MessageBox("Process32First returned false", "Error", MB_OK);<br />
		exit(0);<br />
	}<br />
<br />
	do<br />
	{<br />
		hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pe32.th32ProcessID);<br />
		<br />
		if(pe32.szExeFile == "firefox.exe") // <--- THIS IS NEVER CALLED, eventhough it should because firefox.exe is one of the process names i get if i display each of the process names with a message box for example<br />
		{<br />
			CloseHandle(hProcess);<br />
<br />
			WR_Process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);<br />
				<br />
			if(WR_Process == NULL)<br />
				MessageBox("Couldn't open firefox process", "Error", MB_OK);<br />
			else<br />
				MessageBox("firefox process found!", "OMFG!", MB_OK);<br />
<br />
			break;<br />
		}<br />
<br />
		CloseHandle(hProcess);<br />
	}<br />
	while(Process32Next(hProcessSnap, &pe32));<br />
<br />
	CloseHandle( hProcessSnap );<br />


anyone know what's wrong? :/
AnswerRe: getting process handle to a known process name Pin
prasad_som6-May-07 20:20
prasad_som6-May-07 20:20 
GeneralRe: getting process handle to a known process name Pin
nimatek6-May-07 20:23
nimatek6-May-07 20:23 
Questionhow to use a dynamical linked library in C++ program in Linux Pin
cy163@hotmail.com6-May-07 19:27
cy163@hotmail.com6-May-07 19:27 
AnswerRe: how to use a dynamical linked library in C++ program in Linux Pin
Michael Dunn6-May-07 20:19
sitebuilderMichael Dunn6-May-07 20:19 
AnswerRe: how to use a dynamical linked library in C++ program in Linux Pin
Hans Dietrich6-May-07 20:46
mentorHans Dietrich6-May-07 20:46 
AnswerRe: how to use a dynamical linked library in C++ program in Linux Pin
Moak7-May-07 0:00
Moak7-May-07 0:00 
Questionconnection problem Pin
p_6-May-07 19:24
p_6-May-07 19:24 
AnswerRe: connection problem [modified] Pin
_AnsHUMAN_ 6-May-07 19:31
_AnsHUMAN_ 6-May-07 19:31 
GeneralRe: connection problem Pin
prasad_som6-May-07 19:51
prasad_som6-May-07 19:51 
AnswerRe: connection problem Pin
prasad_som6-May-07 19:49
prasad_som6-May-07 19:49 
QuestionHow to convert from 'int' to 'unsigned short *' Pin
siddharthsan6-May-07 19:00
siddharthsan6-May-07 19:00 
AnswerRe: How to convert from 'int' to 'unsigned short *' Pin
_AnsHUMAN_ 6-May-07 19:13
_AnsHUMAN_ 6-May-07 19:13 
GeneralRe: How to convert from 'int' to 'unsigned short *' Pin
siddharthsan6-May-07 20:15
siddharthsan6-May-07 20:15 
QuestionRe: How to convert from 'int' to 'unsigned short *' Pin
Rajesh R Subramanian6-May-07 19:49
professionalRajesh R Subramanian6-May-07 19:49 
AnswerRe: How to convert from 'int' to 'unsigned short *' Pin
siddharthsan6-May-07 20:16
siddharthsan6-May-07 20:16 
Questionhow to get thread ID/Process ID of a running exe Pin
ram.Jaddu6-May-07 18:23
ram.Jaddu6-May-07 18:23 
AnswerRe: how to get thread ID/Process ID of a running exe Pin
nimatek6-May-07 20:19
nimatek6-May-07 20:19 

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.