Click here to Skip to main content
15,909,091 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CodePage! Pin
David Crow10-Feb-04 4:30
David Crow10-Feb-04 4:30 
GeneralRe: CodePage! Pin
George Clarence10-Feb-04 21:12
George Clarence10-Feb-04 21:12 
GeneralRe: CodePage! Pin
David Crow11-Feb-04 2:43
David Crow11-Feb-04 2:43 
GeneralRe: CodePage! Pin
George Clarence10-Feb-04 21:23
George Clarence10-Feb-04 21:23 
GeneralRe: CodePage! Pin
David Crow11-Feb-04 2:40
David Crow11-Feb-04 2:40 
GeneralOwner drawn edit control Pin
thorek10-Feb-04 2:17
thorek10-Feb-04 2:17 
GeneralForcing redrawing of property pages... Pin
Bob The Builder (BtB)10-Feb-04 2:12
Bob The Builder (BtB)10-Feb-04 2:12 
Generalproblem with ShellExecute and environment variables Pin
feline_dracoform10-Feb-04 0:20
feline_dracoform10-Feb-04 0:20 
i am learning windows programming using Visual Studio .NET and i am having a problem with ShellExecute.

i have written a small tabbed window that shows shortcuts using Qt 3.2 (from Trolltech). the program is simply a convenient way of showing a selection of shortcuts for me to click on.

when i get a click, i run:

ShellExecute(NULL, "open", pszShortcut, NULL, NULL, SW_SHOWNORMAL);

where pszShortcut is a NULL terminated char * holding the full file name of a shortcut.

when i use this program to run Visual Studio:

pszShortcut = "D:\Documents and Settings\colin.MICROTEST.CO.UK\Tab Launchpad\Applications\Visual Studio .NET 2003.lnk"

VS loads fine, but i cannot compile due to the error:

Project : warning PRJ0018 : The following environment variables were not found:
$(QTDIR)
qt-mt - up-to-date.


QTDIR is defined as a user variable in control panel -> system, and is simply the string "c:\qt\live". if i run Visual Studio from the start menu, or by running my shortcut via windows explorer everything works.

i have also tried:

char *pszTest = getenv("QTDIR");<br />
qDebug("about to run, qtdir = {%s}", pszTest ? pszTest : "NULL");<br />
ShellExecute(NULL, "open", pszShortcut, NULL, NULL, SW_SHOWNORMAL);<br />


and the QTDIR environment variable is correctly returned.

it is as if the ShellExecute call is stripping some of the environment variables Sigh | :sigh:

i am starting to feel very out of my depth, so any help would be greatly appreciated. i am getting the same problem at work (winXP pro, VS .NET 2003) and at home (winXP pro, VS .NET, the one before 2003) so it isn't a machine specific problem, and i haven't been able to find any hints in the help or via google.
GeneralRe: problem with ShellExecute and environment variables Pin
Luuk Weltevreden10-Feb-04 0:39
Luuk Weltevreden10-Feb-04 0:39 
GeneralRe: problem with ShellExecute and environment variables Pin
feline_dracoform10-Feb-04 0:50
feline_dracoform10-Feb-04 0:50 
GeneralRe: problem with ShellExecute and environment variables Pin
Luuk Weltevreden10-Feb-04 1:23
Luuk Weltevreden10-Feb-04 1:23 
GeneralRe: problem with ShellExecute and environment variables Pin
feline_dracoform11-Feb-04 0:51
feline_dracoform11-Feb-04 0:51 
GeneralRe: problem with ShellExecute and environment variables Pin
Luuk Weltevreden11-Feb-04 6:14
Luuk Weltevreden11-Feb-04 6:14 
QuestionWindows listbox has a resource error? Pin
Luuk Weltevreden10-Feb-04 0:11
Luuk Weltevreden10-Feb-04 0:11 
AnswerRe: Windows listbox has a resource error? Pin
Anonymous10-Feb-04 8:13
Anonymous10-Feb-04 8:13 
GeneralRe: Windows listbox has a resource error? Pin
Luuk Weltevreden10-Feb-04 8:35
Luuk Weltevreden10-Feb-04 8:35 
GeneralMFC drawing confusion Pin
Madhur Baheti9-Feb-04 23:40
Madhur Baheti9-Feb-04 23:40 
GeneralRe: MFC drawing confusion Pin
CodeBrain10-Feb-04 0:44
CodeBrain10-Feb-04 0:44 
GeneralRe: MFC drawing confusion Pin
Mike Dimmick10-Feb-04 1:01
Mike Dimmick10-Feb-04 1:01 
GeneralRegarding Screen changes Pin
santosh k9-Feb-04 23:17
santosh k9-Feb-04 23:17 
GeneralRe: Regarding Screen changes Pin
Luuk Weltevreden10-Feb-04 0:34
Luuk Weltevreden10-Feb-04 0:34 
GeneralRe: Regarding Screen changes Pin
Luuk Weltevreden10-Feb-04 3:52
Luuk Weltevreden10-Feb-04 3:52 
GeneralRegarding Screen changes Pin
santosh k9-Feb-04 23:12
santosh k9-Feb-04 23:12 
GeneralSmall Problem. Pin
Prakash Nadar9-Feb-04 22:26
Prakash Nadar9-Feb-04 22:26 
GeneralRe: Small Problem. Pin
10-Feb-04 1:43
suss10-Feb-04 1:43 

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.