Probleme mit Indy IdHTTP
-
Hallo Leute,
ich habe da ein Problem und weiss einfach nicht mehr weiter. Mein Ziel war es mit IdHTTP->Post zwei Texte an einer PHP Datei zu senden. Code geschrieben, Start, Fehler!!!!!!!!!!!!!!!!1TStringList *sl= new TStringList(); sl->Add("?"); sl->Add("File="+Edit1->Text); sl->Add("&"); sl->Add("Order="+Memo1->Lines->Text); IdHTTP1->Request->ContentType = "application/x-www-form-urlencoded"; Memo1->Text = IdHTTP1->Post("http://localhost/Text/Test2.php",sl); delete sl;
"[C++ Fehler] Unit1.cpp(26): E2285 Keine Übereinstimmung für 'TIdHTTP::Post(char *,TStringList *)' gefunden"
Dann habe ich im Forum gesucht und auch was gefunden(Indy - Post per TIdHTTP funktioniert nicht)
Versuch mit den Code von Jansen:
Fehler:
"[C++ Fehler] Unit1.cpp(26): E2285 Keine Übereinstimmung für 'TIdHTTP::Post(char *,TStringList *)' gefunden"Versuch mit den Code von Peter:
Fehler:
"[Linker Fehler] Unresolved external '__fastcall Idhttp::TIdHTTP::Post(System::AnsiString, const Classes::TStream *, const Classes::TStream *)' referenced from C:\PROGRAMME\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ"Dann habe ich meinen Code in Delphi7 geschrieben und siehe da es funktioniert perfekt. ?????????????????????
var sl : TStringlist; begin sl := TStringList.Create; sl.Add('?'); sl.Add('File='+Edit1.text); sl.Add('&'); sl.Add('Order='+Memo1.Lines.Text); Memo1.Text := idHttp1.Post('http://localhost/Text/Test2.php',sl); FreeAndNil(sl); end;
Kann mir jemand sagen was ich falsch mache? Ich weiss einfach nicht mehr weiter
Gruß
Lisa
-
Kennt jemand diesen Fehler?
Ist das ein Bug von Indy oder mache ich was falsch?
Ich verwende Indy_9.00.17Bitte helft mir!!!!!
Gruss Lisa
-
lisa001 schrieb:
Versuch mit den Code von Jansen:
Fehler:
"[C++ Fehler] Unit1.cpp(26): E2285 Keine Übereinstimmung für 'TIdHTTP::Post(char *,TStringList *)' gefunden"Sieh nochmal genau hin. In dem FAQ-Beitrag steht nichts von TStringList.
-
Hallo Jansen,
Ich habe gerade deinen Code kopiert und getestet
TStringStream *Params = new TStringStream(""); Params->WriteString("sys_return_url=ABCDEFGHIJKLM"); IdHTTP1->Request->ContentType = "application/x-www-form-urlencoded"; Memo1->Text = IdHTTP1->Post("http://localhost/index.php", Params); delete Params;
Fehlermeldung:
[C++ Fehler] Unit1.cpp(24): E2285 Keine Übereinstimmung für 'TIdHTTP::Post(char *,TStringStream *)' gefundenDann habe BCB5 installiert und mein Programm getestet, und siehe da es funktioniert!!!
TStringList *sl= new TStringList(); sl->Add("?"); sl->Add("File="+Edit1->Text); sl->Add("&"); sl->Add("Order="+Memo1->Lines->Text); IdHTTP1->Request->ContentType = "application/x-www-form-urlencoded"; Memo1->Text = IdHTTP1->Post("http://localhost/Text/Test2.php",sl); delete sl;
Was kann das sein?
Borland C++Builder5: Prog funktioniert
Borland C++Builder6: Prog funktioniert nicht //Fehler
Borland Delphi7: Prog funktioniertGruß und einen guten Morgen
Lisa
-
Hallo,
Kann mir jemand sagen warum das mit BCB5 klappt und mit BCB6 nicht?
Was mache ich falsch?
Wenn ich irgendwo einen Ansatz hätte, dann wäre mir schon geholfen.
Liegt es an der Indy Installation oder BCB6?Bitte helft mir!!!!!!!!!!!!!!!
Ich weiss echt nicht mehr weiter!
Gruss Lisa
-
Das dürfte an unterschiedlichen Indy-Versionen liegen.
Die FAQ-Beispiele sind wohl mit Indy 8.x entstanden, in Indy 9.x ist offenbar nur noch die Methode mit zwei Streams gültig.Das mit dem "unresolved external" liegt vermutlich daran, dass der Pfad zur Indy(6)-Installation im Include-Pfad und im Lib-Pfad in den Projektoptionen fehlt bzw. nicht an erster Stelle steht.
-
Hallo Lisa001,
also ich hab auch immer diese Probleme mit Indy 9.
Unter Projekt/Optionen/Packages steht in den String unter Laufzeit-Packages irgendwo ;indy; drin. Wenn du das entfernst, müßte es klappen.Pronto451
-
Hallo Leute,
das war mein Fehler. Ich hatte noch alte Indy dcu's in BCB, die ich beim löschen übersehen habe.
Nachdem ich die Indy Hilfe nochmal durchgelesen habe, habe ich mal nach den id*.dcu, id*.hpp Dateien gesucht, und siehe da, Dateien gefunden und das Problem war gelöst!!!!!!!
Indy Knowlege Base
*• Close the Borland C++ Builder IDE if it is open.• Temporarily copy IDPAS32.obj to a temporary directory. You do not want to delete that file because it is NOT part of the Indy package.
• Remove all Indy files including dclindy*.bpl, dclindy., dclindy.bpl, indy*.lib, id*.pas, id*.hpp, id*.obj, and id*.dcu. Take care that you only remove the old Indy files and not something else. Be sure that you also remove any indy*.bpl from your Windows\System32 directory.
• Restore IDPAS32.obj from the temporary directory you created earlier to the directory where it was originally located.
• Remove all old Indy Help files, indy.*, from the Help subdirectory and replace them with the new ones.
• Place the new version of Indy in a directory of your choice. When unzipping, please keep the \source directory for the archive intact because that is used by some build batch files.
• In the source directory, there are several batch files. Run the appropriate one for your version of Borland C++ Builder:
• FULLC4.BAT - Borland C++ Builder 4
• FULLC5.BAT - Borland C++ Builder 5
• FULLC6.BAT - Borland C++ Builder 6*
Jetzt funktioniert es, auch so wie ich es gepostet habe!
Danke für Eure Hilfe
Gruss Lisa