What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 60883 |  Welcome, Guest!   Register  Login
 Home > Forums > Silverlight > Attempted to read or write protected memory. This is often an indication th ...
Vuyiswamb

Attempted to read or write protected memory. This is often an indication that other memory is corrup

Replies: 1 | Posted by: Vuyiswamb on 6/3/2011 | Category: Silverlight Forums | Views: 2904 | Status: [Member] [MVP] [Administrator] | Points: 10  


Good Day All

i have an application that i use to test my example. i am creating a Cookie in Silverlight and access the Cookie in asp.net. In my example application works fine. The code for creating a Cookie is like this


private void SetCookies(string name, string value)
{
// Call the SetCookie(name,value) JavaScript method
string code = string.Format("document.getElementById('myIFrame').contentWindow.SetCookie('{0}','{1}')", name, value);
HtmlPage.Window.Eval(code);
}


and in my Page load of the Silverlight Page i have this

  

HtmlElement iframe = (HtmlElement)radHtmlPlaceholder1.HtmlPresenter.Children[0];
// Set an ID to the IFrame so that can be used later when calling the javascript
iframe.SetAttribute("id", "myIFrame");


I am using it this way because i want to access a Cookie or a Value from Silverlight in asp.net. The Element "RadhtmlplaceHolder1" is a telerik control that is being used as described here http://blogs.telerik.com/kirilstanoev/posts/11-05-10/reading_writing_cookies_with_htmlplaceholder_for_silverlight.aspx
i will not go to the aspx page where the Cookie is being accessed, but the problem comes when setting it in this line


HtmlPage.Window.Eval(code);



Attempted to read or write protected memory. This is often an indication that other memory is corrupt


Please note that this is on a SilverlightChild Window


Thanks

Thank you for posting at Dotnetfunda
[Administrator]


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Vuyiswamb
Vuyiswamb  
Posted on: 6/5/2011 1:36:07 PM
Level: NotApplicable | Status: [Member] [MVP] [Administrator] | Points: 25

Resolved

This was just a Security problem. i resolved it like this

1)Right click my computer and select properties

2)Select the "Advanced System Settings"

3)Select "Settings" in the Perfomance category

4) Select "Data Execution Prevention" tab

5) select "Turn on DEP for all programs and services except except those i select"

and click ok , the problem went away


Thank you for posting at Dotnetfunda
[Administrator]

Vuyiswamb, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/23/2013 8:50:22 AM