Autor Beitrag
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Do 11.10.07 09:05 
Moin Forum,

für die Ansteuerung einer neu gekauften Active-X Komponente muß ich folgenden C-Code in Delphi 5 umsetzen:
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
System.Reflection.FieldInfo f = 
         typeof(AxHost).GetField("licenseKey"
         System.Reflection.BindingFlags.NonPublic | 
         System.Reflection.BindingFlags.Instance); 
  f.SetValue(myControl, "gnvlslnjskvlmlgnnimh");


Aber Reflection ist unter system nicht bekannt. Kann mir jemand bei der Lösung dieses Problems helfen?

Gruß jjturbo

Moderiert von user profile iconChristian S.: Delphi- durch C#-Tags ersetzt
Moderiert von user profile iconChristian S.: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Do 11.10.2007 um 12:29

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Do 11.10.07 10:12 
das sieht mir irgendwie nach .NET aus, wenn dem so ist, wirds mit Delphi 5 schwierig bis unmöglich...

_________________
Bravery calls my name in the sound of the wind in the night...
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Do 11.10.07 11:47 
Das Beispiel ist mir als C-Code geschickt worden, leider kann ich kein C und weiß nicht, ob das stimmt.

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 11.10.07 11:54 
Das ist kein C-, sondern ein C#-Code. Beweisfürhung:

(a) Die Namespaces zeigen, dass es sich um .NET handelt
(b) C (ohne Zeichen dahinter) gibt's nicht für .NET, C++/CLI (also das für .NET) hätte mehr hässliche Pfeile (->) und Doppel-Doppelpunkte (::) drin
--> es ist C#

Diese Zeile zu übersetzen dürfte also nicht zum Ziel führen. Du wirst Dir also ansehen müssen, wie man ActiveX-Controls in Delphi verwendet und selber einen entsprechenden Sourcecode erarbeiten. Ich denke aber, dass Du über die Suchfunktion des Forums da einiges zu finden wirst.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Do 11.10.07 12:23 
Sorry, aber ich stehe irgendwie voll auf der Leitung... :oops:

Ich habe diese Lizenzdatei (*.lic) bekommen, die ich nicht mit der Maschine weitergeben darf. Die Lizenz-Informationen aus dieser Datei muß ich also irgendwie in meine Exe mit reinbekommen.

Ich habe noch keinen Ansatz, wo soll ich starten, wonach soll ich suchen? Alles was ich finde läuft immer wieder auf IE oder Firefox hinaus.
Die Delphi-Hilfe bringt mich nicht weiter, auch hier im Forum konnte ich noch nichts passendes finden. :?

Kann mir jemand mal ein wenig "Starthilfe" geben?

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 11.10.07 12:28 
Wie Du die .lic-Datei in Dein Programm einbindest, ist ein anderes Problem, daher bitte dafür einen neuen Thread aufmachen.

Was das Problem angeht, ein ActiveX-Dingens zu verwenden, sollte die Suche aber einiges ergeben: Suche in: Delphi-Forum, Delphi-Library "ACTIVEX"

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Do 11.10.07 12:30 
Ok, ich werde einen Thread eröffnen.
Die Verwendung der Komponente ist niicht das Problem, das geht alles.

Danke erst mal

Gruß jjturbo

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...