Click here to Skip to main content
15,908,673 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: _com_dispatch_method undefied Pin
Peter Molnar12-Nov-03 13:24
Peter Molnar12-Nov-03 13:24 
GeneralRe: _com_dispatch_method undefied Pin
Rene De La Garza12-Nov-03 13:30
Rene De La Garza12-Nov-03 13:30 
GeneralRe: _com_dispatch_method undefied Pin
Peter Molnar12-Nov-03 13:37
Peter Molnar12-Nov-03 13:37 
GeneralRe: _com_dispatch_method undefied Pin
Rene De La Garza12-Nov-03 13:39
Rene De La Garza12-Nov-03 13:39 
GeneralRe: _com_dispatch_method undefied Pin
Peter Molnar12-Nov-03 13:41
Peter Molnar12-Nov-03 13:41 
GeneralRe: _com_dispatch_method undefied Pin
Rene De La Garza12-Nov-03 13:43
Rene De La Garza12-Nov-03 13:43 
GeneralRe: _com_dispatch_method undefied Pin
Rene De La Garza17-Nov-03 10:09
Rene De La Garza17-Nov-03 10:09 
GeneralMore environment var madness Pin
Jim Crafton12-Nov-03 5:45
Jim Crafton12-Nov-03 5:45 
OK so this is kind annoying:

I have a an environment varialbe that I want added to the Users env vars, and tehn appended to the Users Path.

So I modify the HKEY_CURRENT_USER\Environment and add a value called FOO, that equals "c:\tmp\crap".

I then modify the path value and add "%FOO%" to the beginning of the string.

I close regedit.

Now I run a small program that does the following:
DWORD res = 0;
DWORD res2 = SendMessageTimeout( HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG, 5000, &res );

if ( !res2 ) {
  char tmp[256];
  sprintf( tmp, "SendMessageTimeout error: %d", GetLastError() );
  MessageBox( NULL, tmp, "Error", MB_OK );
}
else {
  char tmp[256];
  sprintf( tmp, "SendMessageTimeout res: %d", res );
  MessageBox( NULL, tmp, "SendMessageTimeout lpdwResult", MB_OK );
}


I open the System properties adn sure enough a new env var has been added (FOO=C:\tmp\crap), and path now has the %FOO% value, expanded to "c:\tmp\crap".
I open a command prompt and type path:
Alas it does NOT see the expanded FOO value, and instead only prints out %FOO% (plus the rest of the path).

I had thought the problem might be with the installer, which performs these same steps. So I tried the above manually with regedit and running the little refresher program manually.

Obviously I am doing something stupid but I cannot find out what, nor has googling for this proved enlightening, other than to provide countless examples of the above code that *should* work.


The ultimate point of course, is to have some executable (a command line program) that would be located in the directory pointed to by FOO, and then be able to run it from the command line. This, so far, has not worked without rebooting.



¡El diablo está en mis pantalones! ¡Mire, mire!

Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!

SELECT * FROM User WHERE Clue > 0
0 rows returned

GeneralRe: More environment var madness Pin
David Crow12-Nov-03 7:05
David Crow12-Nov-03 7:05 
GeneralRe: More environment var madness Pin
Jim Crafton12-Nov-03 7:41
Jim Crafton12-Nov-03 7:41 
GeneralRe: More environment var madness Pin
David Crow12-Nov-03 8:38
David Crow12-Nov-03 8:38 
GeneralRe: More environment var madness Pin
Jim Crafton12-Nov-03 16:55
Jim Crafton12-Nov-03 16:55 
Generalprompt edit box Pin
niklo12-Nov-03 5:20
niklo12-Nov-03 5:20 
GeneralRe: prompt edit box Pin
valikac12-Nov-03 5:54
valikac12-Nov-03 5:54 
GeneralRe: prompt edit box Pin
niklo12-Nov-03 5:57
niklo12-Nov-03 5:57 
GeneralIDE Problem? VS 2002 .Net Pin
sweep12312-Nov-03 5:09
sweep12312-Nov-03 5:09 
GeneralRe: IDE Problem? VS 2002 .Net Pin
Antti Keskinen12-Nov-03 5:18
Antti Keskinen12-Nov-03 5:18 
GeneralRe: IDE Problem? VS 2002 .Net Pin
sweep12312-Nov-03 5:34
sweep12312-Nov-03 5:34 
GeneralTear-off menus Pin
owhite12-Nov-03 5:06
owhite12-Nov-03 5:06 
GeneralRe: Tear-off menus Pin
Maximilien12-Nov-03 5:54
Maximilien12-Nov-03 5:54 
GeneralSorting out duplicate drives... Pin
dandy7212-Nov-03 4:41
dandy7212-Nov-03 4:41 
GeneralRe: Sorting out duplicate drives... Pin
David Crow12-Nov-03 4:48
David Crow12-Nov-03 4:48 
GeneralRe: Sorting out duplicate drives... Pin
dandy7213-Nov-03 2:38
dandy7213-Nov-03 2:38 
GeneralRe: Sorting out duplicate drives... Pin
Terry O'Nolley12-Nov-03 10:22
Terry O'Nolley12-Nov-03 10:22 
GeneralUDP Client Pin
NewHSKid12-Nov-03 4:19
NewHSKid12-Nov-03 4: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.