アプリ版:「スタンプのみでお礼する」機能のリリースについて

BCB5で、TCppWebBrowser、RichEdit、Buttuonを貼り付けたフォームがあります。このRichEditの内容を、POSTメソッドでWebサーバ上のCGIへ渡して、結果をCppWebBrowserで表示したいのですが、以下のようなコードで試したところ、POSTデータが反映されません。

PostDataのVariant型の扱いなどがおかしいのでしょうか。ご存知の方、ご教授ください。



void __fastcall TLogoAppForm::Button1Click(TObject *Sender)
{
AnsiString strPost;
AnsiString strURL;

strURL = "http://192.168.0.1/searchdb/index.cgi";
strPost = RichEdit1->Lines->Text;
TVariant *PostData = new TVariant;

PostData->bstrVal = "mydata=hogehoge";

Web->Navigate(WideString(strURL),NULL,NULL,PostData);

A 回答 (1件)

Variantはそれ自体が型なので、char配列を間においてそのまま代入します。


NavigateではなくNavigate2を使用します。

char data[ 1024 ];

sprintf( data, "http://192.168.0.1/searchdb/index.cgi" );
Variant http;
http = data;
CppWebBrowser1->Navigate2(http);

では

参考URL:http://gamesnet.hoops.ne.jp/
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!