使用浏览器控件的 PostUrlL API

发布于 2024-09-07 15:59:40 字数 2283 浏览 3 评论 0原文

我正在尝试使用浏览器控件POST一些多部分表单数据到我的服务器。

PostUrlL(); 一旦调用方法,KERN-EXEC 3 就会发生混乱。

这是与我在代码中使用的片段类似的片段。

// These LITerals are copied to pointer vars below
_LIT8(K_txt_Boundary, "0xABeR1122EEFFx0");
_LIT8(K_CT_MultipartFormData,"multipart/form-data");

HBufC *url = HBufC::NewL(URL_SIZE);
HBufC8 *contentType = HBufC::NewL(CONTENT_TYPE_SIZE);
HBufC8 *bufPostData = HBufC::NewL(POST_DATA_SIZE);
HBufC8 *boundary = HBufC::NewL(BOUNDARY_SIZE);

// Check allocation was successful 
// and copy required data to allocated space.

TAny *any = NULL;

TRAPD(error, iBrowser->PostUrlL(
                       *url, 
                       *contentType, 
                       *bufPostData, 
                       boundary, 
                       any)
             );

iBrowser,浏览器控件句柄创建如下: 我省略了错误检查,但我确实捕获了放置以下代码片段的函数调用。

iBrowserCapabilties = TBrCtlDefs::ECapabilityDisplayScrollBar 
                                | TBrCtlDefs::ECapabilityLoadHttpFw 
                                | TBrCtlDefs::ECapabilityGraphicalHistory 
                                | TBrCtlDefs::ECapabilityGraphicalPage 
                                | TBrCtlDefs::ECapabilityClientResolveEmbeddedURL 
                                | TBrCtlDefs::ECapabilityCursorNavigation
                                | TBrCtlDefs::ECapabilityClientNotifyURL;

iBrowserObserver = CBrowserObserver::NewL(this);

iBrowser = CreateBrowserControlL(   
                iAppView, 
                aRect,
                iBrowserCapabilties,
                TBrCtlDefs::ECommandIdBase, 
                NULL, // Soft keys
                iBrowserObserver, // Link Resolver
                NULL,
                NULL // Layout change 
        );

iBrowser->SetBrowserSettingL(TBrCtlDefs::ESettingsCookiesEnabled, ETrue);

我已经通过记录其内容来交叉检查是否有任何指针变量为 NULL,它们一切似乎都很好,除了故意的 any 指针。 (文档说它是保留供将来使用的,所以我相信 NULL 应该是一个合适的值)。

我还验证了 iBrowser 是浏览器控件的有效实例。 如上所述,我TRAP包含创建浏览器控件的代码的函数

调用PostUrlL(); 失败并出现恐慌 KERN-EXEC 3

欢迎任何指示、建议或替代方案。

谢谢。

I'm trying to POST some multipart form data to my server using a Browser Control.

The PostUrlL(); Method Panics with KERN-EXEC 3 as soon as it is invoked.

Here's a snippet similar to the one I'm using in my code.

// These LITerals are copied to pointer vars below
_LIT8(K_txt_Boundary, "0xABeR1122EEFFx0");
_LIT8(K_CT_MultipartFormData,"multipart/form-data");

HBufC *url = HBufC::NewL(URL_SIZE);
HBufC8 *contentType = HBufC::NewL(CONTENT_TYPE_SIZE);
HBufC8 *bufPostData = HBufC::NewL(POST_DATA_SIZE);
HBufC8 *boundary = HBufC::NewL(BOUNDARY_SIZE);

// Check allocation was successful 
// and copy required data to allocated space.

TAny *any = NULL;

TRAPD(error, iBrowser->PostUrlL(
                       *url, 
                       *contentType, 
                       *bufPostData, 
                       boundary, 
                       any)
             );

iBrowser, the browser control handle is created as follows:
I'm ommiting error checking, but I do TRAP the function call within which the following snippet is placed.

iBrowserCapabilties = TBrCtlDefs::ECapabilityDisplayScrollBar 
                                | TBrCtlDefs::ECapabilityLoadHttpFw 
                                | TBrCtlDefs::ECapabilityGraphicalHistory 
                                | TBrCtlDefs::ECapabilityGraphicalPage 
                                | TBrCtlDefs::ECapabilityClientResolveEmbeddedURL 
                                | TBrCtlDefs::ECapabilityCursorNavigation
                                | TBrCtlDefs::ECapabilityClientNotifyURL;

iBrowserObserver = CBrowserObserver::NewL(this);

iBrowser = CreateBrowserControlL(   
                iAppView, 
                aRect,
                iBrowserCapabilties,
                TBrCtlDefs::ECommandIdBase, 
                NULL, // Soft keys
                iBrowserObserver, // Link Resolver
                NULL,
                NULL // Layout change 
        );

iBrowser->SetBrowserSettingL(TBrCtlDefs::ESettingsCookiesEnabled, ETrue);

I've cross checked to see if any of the pointer vars are NULL by logging their contents, they all seem to be fine, except for the any pointer which is intentional. (The document says it's reserved for future use, so I believe NULL should be an appropriate value).

I've also verified that iBrowser is a valid instance of a browser control. As mentiond above, I'm TRAPing the function which contains the code to create the browser control

The call PostUrlL(); fails with panic KERN-EXEC 3.

Any pointers, suggestions or alternatives are welcomed.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我ぃ本無心為│何有愛 2024-09-14 15:59:40

从问题评论来看:

我正在诺基亚 E63 上进行测试。我还使用 Symbian^3 SDK。

E63 是 S60 第三版功能包 1 (S60 3.1) 设备。尽管人们非常关注平台版本之间的二进制兼容性,但您确实应该使用 S60 第三版 SDK,例如 3.0 或 3.1。

From the question comments:

I'm testing on Nokia E63. Also I'm using the Symbian^3 SDK.

E63 is a S60 3rd Edition Feature Pack 1 (S60 3.1) device. Though much attention has been given to binary compability between platform version, you should really be using a S60 3rd Edition SDK such as 3.0 or 3.1.

丢了幸福的猪 2024-09-14 15:59:40

您可以在此处验证 PostUrl 方法的输入参数 平台浏览器控制 API 文档 ???
并验证浏览器控件是否是该类的成员并已初始化。

could u verfiied the input parameter for PostUrl method here Platform Browser Control API documentation ???
and verify that u browser control is member on the class and initialized.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文