Attempt to read or write protected memory error - InfoPath Dev
in

InfoPath Dev

Attempt to read or write protected memory error

Last post 07-25-2007 11:14 AM by erinselena. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 07-24-2007 11:50 AM

    Attempt to read or write protected memory error

    Hello Everyone,

    I am having a very curious error within my infopath form that i am trying to nail down but haven't been able to. First off, i am using infopath 2007 (c#) and hosting my form inside the formControl in a windows application (also c#).

    I am getting the "Attempt to read or write protected memory" error on 2 specific lines in my code - one is where i simply try to insert a new node

    node.InsertAfter(node.OuterXml);

    and one is where i try to set a value using setValue()

    formControl1.XmlForm.MainDataSource.CreateNavigator( ).SelectSingleNode( "/my:MF/my:CRN", xmlnsm ).SetValue( currentRecordNumber.ToString( ) );

    "/my:MF/my:CRN", xmlnsm ).SetValue( currentRecordNumber.ToString( ) );

     These two things seem to be related in that if i can fix one line so that i don't get the protected memory error the other line throws an error and vice versa (not sure if this is important).

    This is the LAST thing that is impeding my project, once i get this sorted out the app will work perfectly. Any help would kindly be appreciated!

    Thanks,

    Erin

  • 07-24-2007 12:19 PM In reply to

    Re: Attempt to read or write protected memory error

    Hi Erin,

    Could you take screen shots of the two errors you're getting and also paste in the detailed information so we can analyze the error info more closely?

    Thanks, Shiraz

    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-24-2007 12:22 PM In reply to

    Re: Attempt to read or write protected memory error

    My guess is that you are hitting a bug in InfoPath itself - not necessarily something you're doing wrong. What would be really helpful is if you could create a simple reproduction of your issue. Could you please create a bare-bones winForms application with a super-simple form and some code that causes the crash?

    David Airapetyan / Software Services Architect
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-24-2007 12:47 PM In reply to

    Re: Attempt to read or write protected memory error

    There is also another piece of information that i forgot to add.

    We are using the software on a tablet PC and although the error sometimes does occur in my development environment on a very good computer these errors don't occur.

    I will try and get a replica going.

  • 07-24-2007 01:27 PM In reply to

    Re: Attempt to read or write protected memory error

    Here is another interesting thing that's occuring. So we've been able to put some new code in so that they errors aren't being thrown however now the infopath form FREEZES and doesn't respond, i can't do anything with it except sometimes switch views, and if i can switch the view and i switch it back the UI updates and i can see the changes i've made. Man this is really FRUSTRATING. The problem is, i can't get a replica working in a normal environment, it's only happening on the tablet PC.
  • 07-24-2007 01:36 PM In reply to

    Re: Attempt to read or write protected memory error

    Wow that is frustrating. Have you tried it on a different Tablet PC to see if it may just be specific to that machine's configuration?
    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-24-2007 01:53 PM In reply to

    Re: Attempt to read or write protected memory error

    This looks like a timing issue that only reproduces on slow machines. Since this is most likely a bug in InfoPath your best bet is to look for workarounds. One thing you could do is to add Thread.Sleep() calls around your code to see if this makes the problem reproduce on the dev machine (or maybe makes it go away). I believe InfoPath has special code for TabletPC so it could be an issue, too... can you disable ink entry in InfoPath and see if it changes anything?

    David Airapetyan / Software Services Architect
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-24-2007 01:55 PM In reply to

    Re: Attempt to read or write protected memory error

    Note: I believe you can install TabletPC SDK on a non-tablet machine which would enable some TabletPC features. Check it out here: http://www.microsoft.com/downloads/details.aspx?FamilyId=B46D4B83-A821-40BC-AA85-C9EE3D6E9699&displaylang=en

    Maybe this will help to reproduce the problem on the dev machine as well

    David Airapetyan / Software Services Architect
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-25-2007 05:47 AM In reply to

    Re: Attempt to read or write protected memory error

    Hello All,

    Thanks so much for your replys. I do have the tabletPC SDK on my dev machine and yes we've tried this on a few different tablets and it has occurred on all of them although to varying degrees. I agree that this is an infopath issue but how to go about fixing it I have NO IDEA, short of trying to get the source code from Microsoft which i'm sure isn't an easy task. Any ideas how to wake infopath up and force it to update?

  • 07-25-2007 08:15 AM In reply to

    Re: Attempt to read or write protected memory error

    Since I don't have a repro of this issue I cannot say much but my hunch is that once you get into that "locked" state there is no way back - you'll need to find out how not to get into it. For example, if inserting a row is failing, try to do it via ExecuteAction instead of going via the navigators. It will really have to be trial-and-error until it stops crashing, I am sorry I cannot provide more specific guidance.

    David Airapetyan / Software Services Architect
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-25-2007 11:14 AM In reply to

    Re: Attempt to read or write protected memory error

    Totally not a problem .. i understand that this is hard to diagnose without something in front of you.. we are working hard on some trial and error.. I will keep you all  posted on the outcome!
Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.