0

みなさん、こんにちは。AppMancer AMDownload を使用してデータを PHP スクリプトに投稿しようとしています。ここに私のコードを示します。

#include <MAUtil/Moblet.h>
#include <conprint.h>
#include <AMDownload/DownloadManager.h>

using namespace AMDownload;
using namespace MAUtil;

/**
* A Moblet is a high-level class that defines the
* behaviour of a MoSync program.
*/
class MyMoblet : public Moblet, private DownloadRequestListener
{
public:
/**
 * Initialize the application in the constructor.
 */
MyMoblet()
{
    printf("Press zero or back to exit\n");
}

/**
 * Called when a key is pressed.
 */
void keyPressEvent(int keyCode, int nativeCode)
{
    if (MAK_BACK == keyCode || MAK_0 == keyCode)
    {
        // Call close to exit the application.
        close();
    }

    // Print the key character.
    printf("You typed: %c\n", keyCode);
    String password = "p45sw0rd";
    DownloadRequest* req =  DownloadManager::createRequest(this);
    req->setUrl("https://acrscore.usa.cc/accounts/test/upload.php");
    req->setHttpMethod(HTTP_POST);
    req->addPostData("name", "hy");
    DownloadManager::enqueue(req);
}

 void downloadFinished(DownloadRequest* request){}

/**
 * Called when a key is released.
 */
void keyReleaseEvent(int keyCode, int nativeCode)
{
}

/**
 * Called when the screen is touched.
 */
void pointerPressEvent(MAPoint2d point)
{
    // Print the x and y coordinate.
    printf("You touched: %i %i\n", point.x, point.y);
}

private:

};

/**
 * Entry point of the program. The MAMain function
 * needs to be declared as extern "C".
 */
extern "C" int MAMain()
{
Moblet::run(new MyMoblet());
return 0;
}

これはコンソール出力です

[28] Emulator connected.
[28] PrintConsole: 
[28] Press zero or back to exit
[28] 
[28] PrintConsole: 
[28] You typed: 4
[28] MoSync Panic 40055. "Attempted to use a resource, but no resources exist." The     panic occurred in the syscall maGetDataSize.
[28] IP:0xefda: crtlib.s:1
[28] IP:0x2b0: C:/MoSync/workspace/uu/main.cpp:20
[28] IP:0x2058e: c:/slave/buildScripts/temp_Nnqh/source/libs/MAUtil/Moblet.cpp:89
[28] IP:0x1a704: c:/slave/buildScripts/temp_Nnqh/source/libs/MAUtil/ListenerSet.h:60
[28] IP:0x13f: C:/MoSync/workspace/uu/main.cpp:13
[28] IP:0x1c7: C:/MoSync/workspace/uu/main.cpp:41
[28] IP:0x696a0: C:/MoSync/AppMancer/AMDownload/DownloadManager.cpp:81
[28] IP:0x6952a: C:/MoSync/AppMancer/AMDownload/DownloadManager.cpp:195
[28] IP:0x67ce0: C:/MoSync/AppMancer/AMDownload/HttpDownloader.cpp:68
[28] IP:0x67a75: C:/MoSync/AppMancer/AMDownload/HttpDownloader.cpp:269
[28] Exit @ IP 0x67a73  SP 0x3ffe9c
[28] IP:0x67a73: C:/MoSync/AppMancer/AMDownload/HttpDownloader.cpp:269

私は私が得ていることを理解していません

MoSync Panic 40055. "Attempted to use a resource, but no resources exist." The panic occurred in the syscall maGetDataSize.

投稿データ req->addPostData("name", "hy"); を設定しました。

誰かがこれで私を助けてくれますか?

4

1 に答える 1

1

MoSync3.0.1のAMDownloadの最初のリリースにバグがあります-申し訳ありません。http://appmancer.com/download/AMDownload.zipからダウンロードするための正しいバージョンがあります。2つのファイルをMoSync/lib/pipeフォルダーに抽出します。

于 2012-05-17T11:46:50.733 に答える