使用浏览器控件的 PostUrlL API
我正在尝试使用浏览器控件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 TRAP
ing 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从问题评论来看:
E63 是 S60 第三版功能包 1 (S60 3.1) 设备。尽管人们非常关注平台版本之间的二进制兼容性,但您确实应该使用 S60 第三版 SDK,例如 3.0 或 3.1。
From the question comments:
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.
您可以在此处验证 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.