Click here to Skip to main content
15,899,313 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: icon on button not displayed in XP. Pin
Richard MacCutchan8-Feb-13 1:21
mveRichard MacCutchan8-Feb-13 1:21 
JokeRe: icon on button not displayed in XP. Pin
David Crow8-Feb-13 2:38
David Crow8-Feb-13 2:38 
JokeRe: icon on button not displayed in XP. Pin
Richard MacCutchan8-Feb-13 5:16
mveRichard MacCutchan8-Feb-13 5:16 
GeneralRe: icon on button not displayed in XP. Pin
VCProgrammer8-Feb-13 20:33
VCProgrammer8-Feb-13 20:33 
GeneralRe: icon on button not displayed in XP. Pin
Richard MacCutchan8-Feb-13 22:42
mveRichard MacCutchan8-Feb-13 22:42 
GeneralRe: icon on button not displayed in XP. Pin
VCProgrammer9-Feb-13 1:00
VCProgrammer9-Feb-13 1:00 
GeneralRe: icon on button not displayed in XP. Pin
Richard MacCutchan9-Feb-13 1:08
mveRichard MacCutchan9-Feb-13 1:08 
GeneralRe: icon on button not displayed in XP. Pin
VCProgrammer9-Feb-13 1:20
VCProgrammer9-Feb-13 1:20 
GeneralRe: icon on button not displayed in XP. Pin
Richard MacCutchan9-Feb-13 1:30
mveRichard MacCutchan9-Feb-13 1:30 
GeneralRe: icon on button not displayed in XP. Pin
VCProgrammer9-Feb-13 1:36
VCProgrammer9-Feb-13 1:36 
GeneralRe: icon on button not displayed in XP. Pin
Richard MacCutchan9-Feb-13 2:05
mveRichard MacCutchan9-Feb-13 2:05 
GeneralRe: icon on button not displayed in XP. Pin
VCProgrammer10-Feb-13 20:31
VCProgrammer10-Feb-13 20:31 
GeneralRe: icon on button not displayed in XP. Pin
Richard MacCutchan11-Feb-13 0:35
mveRichard MacCutchan11-Feb-13 0:35 
GeneralRe: icon on button not displayed in XP. Pin
VCProgrammer11-Feb-13 20:29
VCProgrammer11-Feb-13 20:29 
GeneralRe: icon on button not displayed in XP. Pin
Richard MacCutchan11-Feb-13 22:13
mveRichard MacCutchan11-Feb-13 22:13 
GeneralRe: icon on button not displayed in XP. Pin
Richard MacCutchan12-Feb-13 9:37
mveRichard MacCutchan12-Feb-13 9:37 
GeneralRe: icon on button not displayed in XP. Pin
VCProgrammer12-Feb-13 19:59
VCProgrammer12-Feb-13 19:59 
QuestionShellExecute Problem Pin
LFK_Michael4-Feb-13 22:56
LFK_Michael4-Feb-13 22:56 
AnswerRe: ShellExecute Problem Pin
Richard MacCutchan5-Feb-13 0:00
mveRichard MacCutchan5-Feb-13 0:00 
GeneralRe: ShellExecute Problem Pin
LFK_Michael5-Feb-13 0:16
LFK_Michael5-Feb-13 0:16 
C++
void StartEXE (String^ path)
{
TCHAR prog[] = TEXT("C:\\...\\...."); // Programpath

string p ;
MarshalString(path, p);
std::string str= p;
TCHAR *param=new TCHAR[str.size()+1];
param[str.size()]=0;

const TCHAR open[] = TEXT("runas")
ShellExecute( NULL, open, prog, param, NULL, SW_SHOWNORMAL );
}

void MarshalString ( String ^ s, string& os )
        {
        using namespace Runtime::InteropServices;
        const char* chars =
        (const char*)(Marshal::StringToHGlobalAnsi(s)).ToPointer();
        os = chars;
        Marshal::FreeHGlobal(IntPtr((void*)chars));
        }


This is the code i use. I call StartEXE with a String like C:\\test.txt , the programmpath is fix in the code.
The Programm i want to open opens but it don´t open the path.
This happens only by one Programm, if i want to open another programm this code works.
Any Ideas?
GeneralRe: ShellExecute Problem Pin
Richard MacCutchan5-Feb-13 0:26
mveRichard MacCutchan5-Feb-13 0:26 
SuggestionRe: ShellExecute Problem Pin
David Crow5-Feb-13 2:17
David Crow5-Feb-13 2:17 
AnswerRe: ShellExecute Problem Pin
Marius Bancila5-Feb-13 1:05
professionalMarius Bancila5-Feb-13 1:05 
GeneralRe: ShellExecute Problem Pin
LFK_Michael5-Feb-13 3:15
LFK_Michael5-Feb-13 3:15 
GeneralRe: ShellExecute Problem Pin
Marius Bancila5-Feb-13 9:28
professionalMarius Bancila5-Feb-13 9:28 

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.