Click here to Skip to main content
15,915,336 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: trace program for symantic Pin
sofia_11125-May-08 9:56
sofia_11125-May-08 9:56 
GeneralRe: trace program for symantic Pin
sofia_11125-May-08 10:03
sofia_11125-May-08 10:03 
GeneralRe: trace program for symantic Pin
sofia_11124-May-08 11:37
sofia_11124-May-08 11:37 
QuestionCHeckListBox + Edit Box ! Pin
Joseph Marzbani24-May-08 4:10
Joseph Marzbani24-May-08 4:10 
AnswerRe: CHeckListBox + Edit Box ! [modified] Pin
Rajkumar R24-May-08 5:17
Rajkumar R24-May-08 5:17 
GeneralRe: CHeckListBox + Edit Box ! Pin
Joseph Marzbani25-May-08 3:27
Joseph Marzbani25-May-08 3:27 
AnswerRe: CHeckListBox + Edit Box ! Pin
Hamid_RT24-May-08 5:18
Hamid_RT24-May-08 5:18 
QuestionRemote thread~dll Help me!Please!!! Pin
wzcprince24-May-08 3:35
wzcprince24-May-08 3:35 
Help me,please!!!
//?Part1:
BOOL DlgMain::InstallDLL()
{
	LPTHREAD_START_ROUTINE lpRemoteThreadStartAddress
		=(LPTHREAD_START_ROUTINE)::GetProcAddress(m_hDllInstance_Kernel32,"LoadLibraryW");

	LPVOID pRemoteFunctionParam=
		::VirtualAllocEx(m_hProcess,NULL,MAX_PATH,MEM_COMMIT,PAGE_READWRITE);
	if (!pRemoteFunctionParam)
		return FALSE;
	if (!::WriteProcessMemory(m_hProcess,pRemoteFunctionParam,m_aChar_DllFullPath,MAX_PATH, NULL))
		return FALSE;
	HANDLE hThread=::CreateRemoteThread
		(m_hProcess,0,0,
		lpRemoteThreadStartAddress,
		pRemoteFunctionParam,
		0, 0);
	if (!hThread)
		return FALSE;
	::WaitForSingleObject(hThread,INFINITE);
	::GetExitCodeThread(hThread,(LPDWORD)&m_hModule_Dll);
	::CloseHandle(hThread);
	::VirtualFreeEx(m_hProcess, pRemoteFunctionParam,MAX_PATH,MEM_RELEASE);
	return TRUE;
}

//Part2:
BOOL DlgMain::UninstallDLL()
{
	LPTHREAD_START_ROUTINE lpRemoteThreadStartAddress
		=(LPTHREAD_START_ROUTINE)::GetProcAddress(m_hDllInstance_Kernel32,"FreeLibrary");
	
HANDLE hThread=CreateRemoteThread
		(m_hProcess,0,0,
		lpRemoteThreadStartAddress,
		(PVOID)m_hModule_Dll,
		0, 0);

	if (!hThread)
		return FALSE;

	::WaitForSingleObject(hThread,INFINITE);

	CloseHandle(hThread);
	return TRUE;
}

NOTE:LoadLibraryW in part1 not LoadLibraryA.Unicode is used!
Question:
Although part1 can work properly,part2 cannot!!
There is no exception when part2 run,but the function ExitInstance() that should be called in the dll won't no be called!!
Why?
Thanks for your help!! Smile | :)
AnswerRe: Remote thread~dll Help me!Please!!! Pin
ThatsAlok25-May-08 23:07
ThatsAlok25-May-08 23:07 
QuestionMIDI callback Pin
rp_suman24-May-08 3:01
rp_suman24-May-08 3:01 
AnswerRe: MIDI callback Pin
rp_suman26-May-08 18:29
rp_suman26-May-08 18:29 
QuestionHow can make Uneditable Combobox? Pin
Le@rner24-May-08 2:35
Le@rner24-May-08 2:35 
AnswerRe: How can make Uneditable Combobox? Pin
CPallini24-May-08 2:40
mveCPallini24-May-08 2:40 
GeneralRe: How can make Uneditable Combobox? Pin
Jijo.Raj24-May-08 2:45
Jijo.Raj24-May-08 2:45 
GeneralRe: How can make Uneditable Combobox? Pin
Le@rner24-May-08 2:51
Le@rner24-May-08 2:51 
GeneralRe: How can make Uneditable Combobox? Pin
Jijo.Raj24-May-08 2:59
Jijo.Raj24-May-08 2:59 
JokeRe: How can make Uneditable Combobox? Pin
Nelek24-May-08 3:12
protectorNelek24-May-08 3:12 
GeneralRe: How can make Uneditable Combobox? Pin
Jijo.Raj24-May-08 6:16
Jijo.Raj24-May-08 6:16 
JokeRe: How can make Uneditable Combobox? Pin
Hamid_RT24-May-08 6:42
Hamid_RT24-May-08 6:42 
GeneralRe: How can make Uneditable Combobox? Pin
Nelek24-May-08 8:07
protectorNelek24-May-08 8:07 
GeneralRe: How can make Uneditable Combobox? Pin
Hamid_RT24-May-08 9:36
Hamid_RT24-May-08 9:36 
JokeRe: How can make Uneditable Combobox? Pin
Hamid_RT24-May-08 6:39
Hamid_RT24-May-08 6:39 
GeneralRe: How can make Uneditable Combobox? Pin
Jijo.Raj24-May-08 7:39
Jijo.Raj24-May-08 7:39 
AnswerRe: How can make Uneditable Combobox? Pin
Jijo.Raj24-May-08 2:42
Jijo.Raj24-May-08 2:42 
GeneralRe: How can make Uneditable Combobox? Pin
Le@rner24-May-08 2:49
Le@rner24-May-08 2:49 

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.