English 中文(简体)
Permission Denied in IE w/ iDispatch DISPATCH_PROPERTYGET
原标题:

I have an ActiveX control that I ve written using ATL, and am running into a somewhat serious and confusing problem. When iDispatch::Invoke is called with DISPATCH_PROPERTYPUT/METHOD everything is fine. When I return a value to the IE javascript, after a method call of a VT_BSTR with a valid BSTR, it works fine.

But when I try:

var stringValue = Object.stringValue;

which calls iDispatch invoked with the DISPATCH_PROPERTYGET flag, and I set the return value to VT_BSTR with a valid BSTR (the exact same one i use with the method calls), I get a permission denied error box in IE.

When I return various other datatypes (longs, integers, bools, ...etc) to the IE javascript, it works fine (with the propertyGet() method). I only get permission denied when returning VT_BSTR.

Any ideas?

问题回答

In your comment above, you re casting c to a BSTR. What is c? If you re not actually calling SysAllocString() to create the BSTR, that could very well be the source of your problem.

Consider using CComBSTR or CComVARIANT to aide you in the process, and also please read Eric s complete guide to BSTR semantics.





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签