Click here to Skip to main content
15,917,568 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalprinting image directly Pin
mark1827-Feb-05 14:43
mark1827-Feb-05 14:43 
GeneralRe: printing image directly Pin
basementman8-Feb-05 6:36
basementman8-Feb-05 6:36 
GeneralUsing ShellExecute() to execute program -- how to return quickly Pin
shultas7-Feb-05 14:18
shultas7-Feb-05 14:18 
GeneralRe: Using ShellExecute() to execute program -- how to return quickly Pin
Yulianto.7-Feb-05 14:51
Yulianto.7-Feb-05 14:51 
GeneralRe: Using ShellExecute() to execute program -- how to return quickly Pin
ThatsAlok7-Feb-05 18:33
ThatsAlok7-Feb-05 18:33 
GeneralOpening HTA with WebBrowser control Pin
Rheisman7-Feb-05 13:40
Rheisman7-Feb-05 13:40 
GeneralAlpha blending in TreeView Bitmaps Pin
r3dqu33n7-Feb-05 12:01
r3dqu33n7-Feb-05 12:01 
GeneralString problem in HKLM\MS\Windows\CurrentVersion\Run Pin
LukeV7-Feb-05 11:52
LukeV7-Feb-05 11:52 
Hi,

I have a weird problem where if I set a value in HKLM\MS\Windows\CurrentVersion\Run in my code, my app won't be launched. But if I double click on MyApp key, select the value, do a cut-paste of the same string, reboot the computer then it will work!

HKLM\MS\Windows\CurrentVersion\Run

Key: MyApp,
Type: String,
Value: "C:\Program Files\MyApp\MyApp.exe" (quotes are included in the string since there's a space in there).

Here's my code:

<code>TCHAR szPath[MAX_PATH+1];
TCHAR szFullPath[MAX_PATH+1];

UTLGetAppPath( szPath, sizeof( szPath ) ); //returns the path
_tcscat( szPath, NTS_ISMGR_EXE ); //adds the executable

memset( szFullPath, 0, sizeof( szFullPath ) );

_tcscpy( szFullPath, "\"" );
_tcscat( szFullPath, szPath );
_tcscat( szFullPath, "\"\0" );

//Add to run
lRes = RegSetValueEx( hKey, NTS_REG_STARTUP_NAME, 0, REG_SZ, 
			(BYTE*)szFullPath, sizeof( szFullPath ) );</code>


What is wrong???

Thanks! Smile | :)
GeneralRe: String problem in HKLM\MS\Windows\CurrentVersion\Run Pin
Michael Dunn7-Feb-05 11:55
sitebuilderMichael Dunn7-Feb-05 11:55 
GeneralRe: String problem in HKLM\MS\Windows\CurrentVersion\Run Pin
LukeV7-Feb-05 12:01
LukeV7-Feb-05 12:01 
GeneralRe: String problem in HKLM\MS\Windows\CurrentVersion\Run Pin
LukeV7-Feb-05 13:14
LukeV7-Feb-05 13:14 
GeneralRe: String problem in HKLM\MS\Windows\CurrentVersion\Run Pin
LukeV7-Feb-05 13:36
LukeV7-Feb-05 13:36 
GeneralRe: String problem in HKLM\MS\Windows\CurrentVersion\Run Pin
Michael Dunn7-Feb-05 14:47
sitebuilderMichael Dunn7-Feb-05 14:47 
GeneralRe: String problem in HKLM\MS\Windows\CurrentVersion\Run Pin
Peter Weyzen7-Feb-05 13:35
Peter Weyzen7-Feb-05 13:35 
GeneralRe: String problem in HKLM\MS\Windows\CurrentVersion\Run Pin
LukeV7-Feb-05 13:38
LukeV7-Feb-05 13:38 
GeneralHaving trouble sending this Pin
Tom Wright7-Feb-05 11:33
Tom Wright7-Feb-05 11:33 
GeneralRe: Having trouble sending this Pin
Peter Weyzen7-Feb-05 13:37
Peter Weyzen7-Feb-05 13:37 
GeneralRe: Having trouble sending this Pin
Tom Wright10-Feb-05 5:15
Tom Wright10-Feb-05 5:15 
GeneralGdipluseffects.h new functions in GDI+ 1.1. Pin
Anne Jan Beeks7-Feb-05 11:05
Anne Jan Beeks7-Feb-05 11:05 
GeneralUINT nFlags Pin
Anonymous7-Feb-05 10:19
Anonymous7-Feb-05 10:19 
GeneralRe: UINT nFlags Pin
Chris Losinger7-Feb-05 10:44
professionalChris Losinger7-Feb-05 10:44 
GeneralRe: UINT nFlags Pin
Neville Franks7-Feb-05 10:50
Neville Franks7-Feb-05 10:50 
GeneralRe: UINT nFlags Pin
namaskaaram7-Feb-05 19:21
namaskaaram7-Feb-05 19:21 
GeneralUsing Libaries Pin
TheCult7-Feb-05 9:45
TheCult7-Feb-05 9:45 
QuestionHow to find the size of free store Pin
Budric B.7-Feb-05 9:02
Budric B.7-Feb-05 9: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.