Hi Leute.
Ich habe ein Problem. Ich muss mit einem C++ Programm eine Umgebungsvariable setzen (Benutzervariable) und dann eine Verknüpfung erstellen, in der die Variable vorkommt.
Die Verknüpfung wäre dann: perl.exe "%Variable%\..."
Mein Programmcode sieht bislang so aus:
Nun gibt es aber schon früher Probleme.
"Zugriff auf TControl::Caption nicht möglich!" kommt bei der Compilierung.
Brauche dringend Hilfe und danke schon einmal im Voraus![Wink ;) ;)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f609.png)
Ich habe ein Problem. Ich muss mit einem C++ Programm eine Umgebungsvariable setzen (Benutzervariable) und dann eine Verknüpfung erstellen, in der die Variable vorkommt.
Die Verknüpfung wäre dann: perl.exe "%Variable%\..."
Mein Programmcode sieht bislang so aus:
Code:
#include <string>
#include <stdlib.h>
#include <vcl.h>
#pragma hdrstop
#include "SetEnv.h"
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if(Variable->Caption == "" || Variable->Caption == "Variable"){
Error->Caption = "No Variablename set!";
}
else if(Value->Caption == "" || Value->Caption == "Variable"){
Error->Caption = "No Variablevalue set!";
}
else{
SetEnvironmentVariable(Variable->Caption, Value->Caption);
}
}
Nun gibt es aber schon früher Probleme.
"Zugriff auf TControl::Caption nicht möglich!" kommt bei der Compilierung.
Brauche dringend Hilfe und danke schon einmal im Voraus
![Wink ;) ;)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f609.png)