Click here to Skip to main content
16,006,432 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to Use SetFocus() ? Pin
Ravi Bhavnani30-Aug-05 8:52
professionalRavi Bhavnani30-Aug-05 8:52 
GeneralRe: How to Use SetFocus() ? Pin
Amarelia30-Aug-05 22:29
Amarelia30-Aug-05 22:29 
GeneralRe: How to Use SetFocus() ? Pin
Ravi Bhavnani31-Aug-05 1:40
professionalRavi Bhavnani31-Aug-05 1:40 
QuestionOver-riding ToolTip Text in an CSliderCtrl Pin
sharpanil30-Aug-05 7:39
sharpanil30-Aug-05 7:39 
Questionerror using #pragma pack(...) Pin
wookie18230-Aug-05 6:53
wookie18230-Aug-05 6:53 
AnswerRe: error using #pragma pack(...) Pin
Rick York30-Aug-05 14:21
mveRick York30-Aug-05 14:21 
AnswerRe: error using #pragma pack(...) Pin
Jose Lamas Rios30-Aug-05 18:22
Jose Lamas Rios30-Aug-05 18:22 
QuestionRegistering controls using code Pin
Tom Wright30-Aug-05 6:39
Tom Wright30-Aug-05 6:39 
I'm having a problem whne I try and register a control that is missing a component. It returns an exception error. It there an exception catch for the GetProcAddress?

Here's my code:
<br />
	HINSTANCE dllhandle = NULL;<br />
	HRESULT	(WINAPI *lpfDllRegisterServer)();<br />
	LPSTR pszFileExt = NULL;<br />
	HRESULT hr = S_OK;<br />
<br />
	pszFileExt = strrchr(pszFile, '.');<br />
	if(pszFileExt)<br />
	{<br />
		pszFileExt++;<br />
		if(stricmp(pszFileExt, "DLL") == 0 || stricmp(pszFileExt, "OCX") == 0)<br />
		{<br />
			dllhandle = LoadLibrary(pszFile);<br />
			if(dllhandle)<br />
			{<br />
				lpfDllRegisterServer = (HRESULT(WINAPI*)())GetProcAddress(dllhandle, "DllRegisterServer");<br />
				if(lpfDllRegisterServer)<br />
				{<br />
					hr = lpfDllRegisterServer();<br />
					if(hr != S_OK)<br />
					{<br />
						CString strMsg("The following component failed to register.\n");<br />
						strMsg += pszFile;<br />
						AfxMessageBox(strMsg, MB_ICONEXCLAMATION);<br />
						FreeLibrary(dllhandle);<br />
						return FALSE;<br />
					}<br />
					lpfDllRegisterServer = NULL;<br />
<br />
				}<br />
				FreeLibrary(dllhandle);<br />
				dllhandle = NULL;<br />
			}<br />
		}<br />
		else if(stricmp(pszFileExt, "EXE") == 0)<br />
		{<br />
			char szCmdLine[MAX_PATH+1];<br />
			sprintf(szCmdLine, "%s /RegServer", pszFile);<br />
<br />
			STARTUPINFO startUpInfo = { sizeof(STARTUPINFO),NULL,"",NULL,0,0,0,0,0,0,0,STARTF_USESHOWWINDOW,SW_HIDE,0,NULL,0,0,0};  <br />
			PROCESS_INFORMATION ProcInfo;<br />
<br />
			CreateProcess(NULL, szCmdLine, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, <br />
				NULL,&startUpInfo, &ProcInfo);<br />
		}<br />
	}<br />

Thanks

Tom Wright
tawright915@yahoo.com
QuestionSendInput Problem Pin
Mohammad A Gdeisat30-Aug-05 6:18
Mohammad A Gdeisat30-Aug-05 6:18 
AnswerRe: SendInput Problem Pin
Rage30-Aug-05 7:05
professionalRage30-Aug-05 7:05 
GeneralRe: SendInput Problem Pin
Mohammad A Gdeisat30-Aug-05 7:51
Mohammad A Gdeisat30-Aug-05 7:51 
AnswerRe: SendInput Problem Pin
Jose Lamas Rios30-Aug-05 8:54
Jose Lamas Rios30-Aug-05 8:54 
GeneralRe: SendInput Problem Pin
Mohammad A Gdeisat30-Aug-05 10:22
Mohammad A Gdeisat30-Aug-05 10:22 
GeneralRe: SendInput Problem Pin
Jose Lamas Rios30-Aug-05 18:13
Jose Lamas Rios30-Aug-05 18:13 
QuestionProblem with Chris Mounder grid and KB893803v2 windows uppgrade. Pin
morefalt30-Aug-05 5:29
morefalt30-Aug-05 5:29 
QuestionI created an add-in for Visual C++ 6, please give me some comments and suggestions ^_^ Pin
ahzhuo30-Aug-05 5:04
ahzhuo30-Aug-05 5:04 
AnswerRe: I created an add-in for Visual C++ 6, please give me some comments and suggestions ^_^ Pin
toxcct30-Aug-05 5:06
toxcct30-Aug-05 5:06 
GeneralRe: I created an add-in for Visual C++ 6, please give me some comments and suggestions ^_^ Pin
ahzhuo30-Aug-05 5:13
ahzhuo30-Aug-05 5:13 
GeneralRe: I created an add-in for Visual C++ 6, please give me some comments and suggestions ^_^ Pin
toxcct30-Aug-05 5:14
toxcct30-Aug-05 5:14 
GeneralRe: I created an add-in for Visual C++ 6, please give me some comments and suggestions ^_^ Pin
toxcct30-Aug-05 5:16
toxcct30-Aug-05 5:16 
GeneralRe: I created an add-in for Visual C++ 6, please give me some comments and suggestions ^_^ Pin
Eytukan30-Aug-05 5:26
Eytukan30-Aug-05 5:26 
GeneralRe: I created an add-in for Visual C++ 6, please give me some comments and suggestions ^_^ Pin
ahzhuo30-Aug-05 5:30
ahzhuo30-Aug-05 5:30 
GeneralRe: I created an add-in for Visual C++ 6, please give me some comments and suggestions ^_^ Pin
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX30-Aug-05 6:08
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX30-Aug-05 6:08 
AnswerRe: I created an add-in for Visual C++ 6, please give me some comments and suggestions ^_^ Pin
John M. Drescher30-Aug-05 17:44
John M. Drescher30-Aug-05 17:44 
QuestionSearch Database Pin
Typheous30-Aug-05 4:34
Typheous30-Aug-05 4:34 

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.