Click here to Skip to main content
15,887,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: activate control Pin
valikac8-Jun-03 13:26
valikac8-Jun-03 13:26 
GeneralRe: activate control Pin
aguest8-Jun-03 14:18
aguest8-Jun-03 14:18 
GeneralRe: activate control Pin
aguest8-Jun-03 14:19
aguest8-Jun-03 14:19 
GeneralRe: activate control Pin
Dominik Reichl8-Jun-03 22:00
Dominik Reichl8-Jun-03 22:00 
GeneralRe: activate control Pin
aguest9-Jun-03 5:28
aguest9-Jun-03 5:28 
GeneralRe: activate control Pin
Dominik Reichl9-Jun-03 6:47
Dominik Reichl9-Jun-03 6:47 
GeneralRe: activate control Pin
aguest9-Jun-03 9:12
aguest9-Jun-03 9:12 
QuestionError on AutoRun ???? Pin
_skidrow_vn_8-Jun-03 10:45
_skidrow_vn_8-Jun-03 10:45 
All required dll of MyApp

ADVAPI32.DLL
COMCTL32.DLL
COMDLG32.DLL
GDI32.DLL
KERNEL32.DLL
MSIMG32.DLL
MSVCRT.DLL
NTDLL.DLL
ODBC32.DLL
RPCRT4.DLL
SHELL32.DLL
SHLWAPI.DLL
USER32.DLL

I have a function to do work "Set AutoRun for My Application"
When MyApp run on WinXPpro => Okay => AutoRun on startup
but when it run on Win98SE => Windows show a ERROR MESSAGEBOX instead of MyApp Frown | :(


Error Picture OMG | :OMG: WTF | :WTF: Eek! | :eek:

BOOL SetAutoRun()<br />
{<br />
<br />
#define		REG_SUBKEY_AUTORUN	"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"<br />
#define		REG_VALUE_AUTORUN	"Notebook"<br />
<br />
	DWORD		dwDisposition;<br />
	HKEY		hkSub;<br />
<br />
	CHAR		szFullFileName[255];	<br />
	GetModuleFileName(NULL,szFullFileName,sizeof(szFullFileName));<br />
<br />
	RegCreateKeyEx(HKEY_LOCAL_MACHINE, <br />
			REG_SUBKEY_AUTORUN, <br />
			0, <br />
			STR_NULL, <br />
			0, <br />
			KEY_READ | KEY_WRITE, <br />
			NULL,<br />
			&hkSub, <br />
			&dwDisposition);<br />
<br />
	//if(dwDisposition==REG_CREATED_NEW_KEY)<br />
	//	MessageBox(hWnd,"The key did not exist and was created. ","",MB_OK);<br />
	//if(dwDisposition==REG_OPENED_EXISTING_KEY)<br />
	//	MessageBox(hWnd,"The key existed and was simply opened without being changed. ","",MB_OK);<br />
	// may be changed ...... if app overwrite it.......<br />
	// so that....... only write it when app run at first time<br />
	if(dwDisposition==REG_OPENED_EXISTING_KEY)<br />
	{	<br />
		if(RegSetValueEx(hkSub,REG_VALUE_AUTORUN, 0,REG_SZ,(LPBYTE)szFullFileName, strlen(szFullFileName)+1) != ERROR_SUCCESS)<br />
		{<br />
			RegCloseKey(hkSub);<br />
			return FALSE;<br />
		}<br />
		else<br />
		{<br />
			RegCloseKey(hkSub);<br />
			return TRUE;<br />
		}	<br />
	}<br />
<br />
	return FALSE;<br />
}


Could you help me to fix this bug?
thank you!
QuestionCan someone help me debug this? Pin
Anonymous8-Jun-03 10:40
Anonymous8-Jun-03 10:40 
AnswerRe: Can someone help me debug this? Pin
ZoogieZork8-Jun-03 11:19
ZoogieZork8-Jun-03 11:19 
GeneralRe: Can someone help me debug this? Pin
Anonymous8-Jun-03 11:47
Anonymous8-Jun-03 11:47 
GeneralRe: Can someone help me debug this? Pin
geo_m8-Jun-03 21:30
geo_m8-Jun-03 21:30 
GeneralXP Manifest Pin
Toni788-Jun-03 10:01
Toni788-Jun-03 10:01 
GeneralRe: XP Manifest Pin
Michael Dunn8-Jun-03 10:16
sitebuilderMichael Dunn8-Jun-03 10:16 
GeneralRe: XP Manifest Pin
Toni788-Jun-03 11:15
Toni788-Jun-03 11:15 
GeneralRe: XP Manifest Pin
Michael Dunn8-Jun-03 15:07
sitebuilderMichael Dunn8-Jun-03 15:07 
GeneralRe: XP Manifest Pin
Toni788-Jun-03 17:58
Toni788-Jun-03 17:58 
GeneralUsing Multiple Tables in an Access Database Pin
Anonymous8-Jun-03 5:03
Anonymous8-Jun-03 5:03 
GeneralRe: Using Multiple Tables in an Access Database Pin
Toni788-Jun-03 8:40
Toni788-Jun-03 8:40 
GeneralRe: Using Multiple Tables in an Access Database Pin
RichardGrimmer10-Jun-03 5:03
RichardGrimmer10-Jun-03 5:03 
GeneralDesktop Dancer Pin
dfsgdsfgdfg8-Jun-03 4:23
dfsgdsfgdfg8-Jun-03 4:23 
GeneralRe: Desktop Dancer Pin
Toni788-Jun-03 8:42
Toni788-Jun-03 8:42 
GeneralRe: Desktop Dancer Pin
ZoogieZork8-Jun-03 10:39
ZoogieZork8-Jun-03 10:39 
GeneralClipboard problem with CRichEdit Pin
Michael Pauli8-Jun-03 4:06
Michael Pauli8-Jun-03 4:06 
GeneralRe: Clipboard problem with CRichEdit Pin
Ryan Binns8-Jun-03 5:02
Ryan Binns8-Jun-03 5:02 

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.