Click here to Skip to main content
15,885,998 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: ShellExecute Problem Pin
LFK_Michael5-Feb-13 12:03
LFK_Michael5-Feb-13 12:03 
AnswerRe: ShellExecute Problem Pin
Albert Holguin5-Feb-13 14:35
professionalAlbert Holguin5-Feb-13 14:35 
Questionhow to get private key from a file (not from a keystore) to sign data ? Pin
IICTECH4-Feb-13 19:12
IICTECH4-Feb-13 19:12 
AnswerRe: how to get private key from a file (not from a keystore) to sign data ? Pin
Richard MacCutchan4-Feb-13 22:20
mveRichard MacCutchan4-Feb-13 22:20 
GeneralRe: how to get private key from a file (not from a keystore) to sign data ? Pin
IICTECH4-Feb-13 23:44
IICTECH4-Feb-13 23:44 
GeneralRe: how to get private key from a file (not from a keystore) to sign data ? Pin
Richard MacCutchan4-Feb-13 23:58
mveRichard MacCutchan4-Feb-13 23:58 
GeneralRe: how to get private key from a file (not from a keystore) to sign data ? Pin
Graham Breach5-Feb-13 3:57
Graham Breach5-Feb-13 3:57 
QuestionPop up window from a dialog based application Pin
Member 80516113-Feb-13 23:46
Member 80516113-Feb-13 23:46 
AnswerRe: Pop up window from a dialog based application Pin
Richard MacCutchan4-Feb-13 0:21
mveRichard MacCutchan4-Feb-13 0:21 
GeneralRe: Pop up window from a dialog based application Pin
Member 80516114-Feb-13 0:55
Member 80516114-Feb-13 0:55 
GeneralRe: Pop up window from a dialog based application Pin
Richard MacCutchan4-Feb-13 2:34
mveRichard MacCutchan4-Feb-13 2:34 
GeneralRe: Pop up window from a dialog based application Pin
Member 80516114-Feb-13 19:19
Member 80516114-Feb-13 19: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.