Getting intermittent AccessViolationExceptions when accessing stores from Outlook.Stores object

We have a very strange situation in which we get random AccessViolationExceptions when trying to access stores (in particular our own) via the Outlook.Stores.
Here's a code snippet of how we're calling this (currently done in our Outlook.ExplorerEvents_ActivateEventHandler handler, and only the first time is is called)
Outlook.NameSpace ns = ThisAddIn.OutlookApplication.GetNamespace("MAPI");
Outlook.Stores stores = ns.Stores;
Outlook.Store store = null;
int nStoreCount = stores.Count;
for (int i = 1; i < nStoreCount; i++)
store = stores[i];
String name = store.DisplayName;
store = null;
When we get to the point of accessing a store via index, we will sometimes get the AccessViolationException, but only sometimes and only (as far as I can tell, since the order isn't always the same from run to run) our message store.
We originally had this bit of code in our ThisAddin_Startup sequence, but it would actually crash Outlook completely when the exception occurred, so I moved it out of there and it at least now doesn't bring down the whole application.
MFCMAPI has no trouble opening the message store ever.
I have seen some references in my research to problems with .net 4.0 and earlier with regards to SynchronizationContext being null, and we are using 4.0 and getting null SynchronizationContext.current values. But we get that when the exception doesn't happen,
too, so I don't know if that's a red herring. However, this code is a back-port from a newer version of our software that was coded against .Net 4.5, and we don't see the issue there at all. As this is going into a patch, build with VS2010, we can't change
the target platform.
I have tried moving the call to worker threads, and I even saw one suggestion of trying to do it in our Outlook.ExplorerEvents_SelectionChangeEventHandler code, but nothing seems to work.
I should note that after the exception occurs, and the Outlook Explorer window opens and populates, if the user manually clicks our message store node, the MSProviderInit->IMSProvider::Logon sequence fires, and fires without the MDB_NO_DIALOG flag being
sent in. During Outlook's start-up, we get that sequence of calls several times, but always with the MDB_NO_DIALOG set, so we return MAPI_E_LOGON_FAILED and don't execute the code which creates our IMsgStore object. So the user's manual operation causes our
IMsgStore to get created and everything is fine. The reason the above code is added is to try to simulate the user's manual action and sort of 'tickle' the store creation process.
When the AccessViolationException does not occur, we get the full MSProviderInit->IMSProvider::Logon, etc sequence. When it does except, we don't even get our MSProviderInit entry point called. It's almost as if our dll gets loaded and then Outlook loses
it.
Any thoughts on this?

Hi Kevin Delgado,
>>if somebody knows what these other flags mean/are defined as in the context of the IMSProvider::Logon call, that would be great<<
Did you mean that the value of ulFlags? If yes, you can refer to the document below:
ulFlags                               
[in] A bitmask of flags that controls how the logon is performed. The following flags can be set:
MAPI_DEFERRED_ERRORS                   
The call is allowed to succeed even if the underlying object is not available to the calling implementation. If the object is not available, a subsequent call to the object might raise an error.
MAPI_UNICODE                   
The passed-in strings are in Unicode format. If MAPI_UNICODE is not set, the strings are in ANSI format.
MDB_NO_DIALOG                   
Prevents the display of logon dialog boxes. If this flag is set, the error value MAPI_E_LOGON_FAILED is returned if the logon is unsuccessful. If this flag is not set, the message store provider can prompt the user to correct a name or password, to insert
a disk, or to perform other actions that are necessary to establish connection to the store.
MDB_NO_MAIL                   
The message store should not be used for sending or receiving mail. The flag signals MAPI not to notify the MAPI spooler that this message store is being opened. If this flag is set and the message store is tightly coupled with a transport provider,
the provider does not need to call the IMAPISupport::SpoolerNotify method.
MDB_TEMPORARY                   
Logs on the store so that information can be retrieved programmatically from the profile section, without use of dialog boxes. This flag instructs MAPI that the store is not to be added to the message store table and that the store cannot be made permanent.
If this flag is set, message store providers do not need to call the IMAPISupport::ModifyProfile method.
MDB_WRITE                   
Requests read/write permission.
Also you can get more detail about IMSProvider::Logon function from link below:
https://msdn.microsoft.com/en-us/library/office/cc842201.aspx
Hope it is hlepful.
Regards & Fei
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • I have an internet connection but keep getting error 306 when accessing I tunes store

    I keep getting error 306 when accessing I Tunes store but I have an internet connection.  What do I do to repair?

    Perhaps try the iTunes Store loads partially or returns "Error 306" or "Error 10054" section in the Specific Conditions and Alert Messages: (Mac OS X / Windows) section of the following document:
    iTunes: Advanced iTunes Store troubleshooting

  • I keep getting script errors when accessing Amazon Seller merchant pages. I get the following A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script

    I keep getting script errors when accessing Amazon Seller merchant pages. I get the following A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: chrome://spautofill/content/spOverlay.js:150, I also get js210 as well. I have cleared all cookies and history and unistalled Firefaox and reinstalled. Been thru my AVS and set the site as trusted in every possible place. Still get the problem. Do not get it with IE on same PC.
    == URL of affected sites ==
    https://sellercentral.amazon.co.uk

    Same problem but with a different vendor site:
    https://www.webvitamins.com/myfavorites.aspx
    Not only does the page hang, but the other tabs also hang.
    I contacted the vendor and their reply was "we were told that this looks like a script that is used by "Sticky Password", third-party software that must have been installed on your browser. However, our website did not install it and does not have anything to do with it." As far as I can tell, "Sticky Password" is not installed on my Firefox.
    Same problem as above occurs, but with IE 8.0.6001.18702. Therefore, it is not unique to Firefox.
    CAUSE DETERMINED: Have determined that this problem only occurs when Kaspersky Password Manager is installed. In Firefox, if the "Password Manager Autofill Engine" add-on is disabled, the problem goes away.

  • TS1702 I cannot get Numbers to update on my iPad.  Have deleted and reinstalled it and still get old information when I drag from my Excel program.  Any ideas on what could be going wrong would be most welcome.

    I cannot get Numbers to update on my iPad.  Have deleted and reinstalled it and still get old information when I drag from my Excel program.  Any ideas on what could be going wrong would be most welcome.

    Bryce,
    Did you try disabling ActiveX Filtering?
    You have more details in the following link:
    http://helpx.adobe.com/flash-player/kb/flash-player-games-video-or.html#main_2__Disable_Ac tiveX_Filtering__if_you_are_using_Internet_Explorer_9__
    Thanks,
    Sunil

  • POWL accessing data from multiple tables/objects

    Hello,
    I have a query on the POWL applications.
    If the powl application has to access data from multiple tables/objects, then the solution would be creating a data structure of those tables/objects and referring to that structure in GET_OBJECT_DEF methods.
    Is there any other soln? or I am right here?
    The queries which are saved for a particular user are transportable? if not, how can they be made transportable?
    Thanks & regards,
    Ravish

    you are right, you can do in get_objects method.
    POWL_QUERIES are transportab;e, you can save them in POWL_QUERY transaction.
    Best regards,
    Rohit
    http://wiki.sdn.sap.com/wiki/display/WDABAP/POWL

  • When access BW from Crystal I get: run-time error '-2147417848(80010108)'

    Installed Crystal and the SAP int Kit in the correct order. I can access R/3 but get an error when trying to access BW:
    run-time error '-2147417848(80010108)'
    Then Crystal crashes and shuts down.

    Yep, I have the same... The only one solution for me for now is open report, then log in to BW using toolbar icon from SAP integration kit bar. Only after that you can work with this report without crash.

  • ITunes freezes when accessing store

    okay, this is driving me crazy...
    I can sign into the store, but cannot access anything further without iTunes getting the SBOD.
    when connecting to the store, the progress bar gets all the way and then nothing.
    The throubleshooting steps I've done are:
    Trashed preferences
    Trashed cache files from ~/Library/Caches, /Library/Caches and /System/Library/Caches
    Tried a different user account...even the root user account.
    Uninstalled and reinstalled iTunes
    Turned off IPv6
    Anyone have any other suggestions. didn't start happening until I installed Snow Leopard, yet SL is installed on my home computer and works fine.
    Thanks!

    I have the same problem (specifically when trying to download music) it is realllly grinding my gears.

  • ITunes 12.1 still frequently crashes when accessing store

    When I updated to iTunes 12.0.1 from iTunes 11.4, iTunes started frequently crashing on launch or if it would launch, when accessing the store.  This continues with iTunes 12.1.0.71.  It's crashing less often, but still does.  When it doesn't crash, I frequently get messages about network connections being reset.  I can sometimes get to the store, sometimes not.  Trying to update Genius or iTunes Match always fails though.  If I try to run the network diagnostics, it also crashes.
    The above problems only happen when I'm in my office.  If I'm at home or if I VPN to my home, iTunes works fine.  11.4 works fine at my office so iTunes isn't blocked by my corporate firewall, but for whatever reason 12 and up has problems.
    Crash that occurs on startup, trying access iTunes account or iTunes store:
    Faulting application name: iTunes.exe, version: 12.1.0.71, time stamp: 0x54c76235
    Faulting module name: JavaScriptCore.dll, version: 7600.1017.6000.1, time stamp: 0x54b5da5f
    Exception code: 0xc0000005
    Fault offset: 0x00000000001d2121
    Faulting process id: 0x24f0
    Faulting application start time: 0x01d03f02b94631f8
    Faulting application path: C:\Program Files\iTunes\iTunes.exe
    Faulting module path: C:\Program Files\Common Files\Apple\Apple Application Support\JavaScriptCore.dll
    Report Id: 0a51eba0-aaf6-11e4-8be2-f01faf3e6c79
    Crash that occurs when running network diagnostics:
    Faulting application name: iTunes.exe, version: 12.1.0.71, time stamp: 0x54c76235
    Faulting module name: objc.dll, version: 1.528.0.126, time stamp: 0x54940801
    Exception code: 0xc0000005
    Fault offset: 0x0000000000020d92
    Faulting process id: 0x1e2c
    Faulting application start time: 0x01d03efc48783f70
    Faulting application path: C:\Program Files\iTunes\iTunes.exe
    Faulting module path: C:\Program Files\Common Files\Apple\Apple Application Support\objc.dll
    Report Id: 9025c036-aaef-11e4-8be2-f01faf3e6c79

    Hello Morac,
    Thanks for using the Apple Support Communities. I understand that you are experiencing issues with iTunes for Windows unexpectedly quitting. Most of these issues can be resolve by using the following article - I’d give the steps a go even though you have isolated the issue pretty well:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues - Apple Support
    http://support.apple.com/en-us/HT203206
    Thanks,
    Matt M.

  • Content title/filename issues when contributing content from Outlook

    Hi,
    We have a critical issue with content title/file name when contributing content from within MS Outlook (2003) using the Desktop Integration Suite (11g) component.
    Either by copy-paste, or by drag-n-droping of an email item to a Contribution Folder in CS, the filename and content title are displayed as coded characters, instead of the email subject.
    e.g
    If an email item with subject "Oracle Magazine - July/August 2010" is being copied to CS contribution folders, its title should be "Oracle Magazine - July/August 2010" and file name something like "Oracle Magazine - July/August 2010.msg". Instead it gets a name that looks like this "0881FC3B-F733-46D3-869F-AB73F352D25F.msg" and title "0881FC3B-F733-46D3-869F-AB73F352D25F".
    Is there a solution for this, any configuration we are missing here so that we get a readable title and/or filename.
    thanks in advance

    Hi Srinath,
    We are using UCM 10gR3 (10.1.3.5.1). We tried both DIS 10gR3 (build 8.xxx) and 11g (build 9.xxx) with no result.
    And I am not able to find something in the documentation that could lead to a solution.

  • Canon MX860 get error 300 when printing wirelessly from MacBook Pro

    I've been printing wirelessly for several years and most recently after an upgrade to OS X 10.10.1 Yosemite it was printing fine until this morning. Something changed and I get error 300 when I try to print. If I connect my MacBook to the Canon MX860 printer using the USB cord it prints fine so I'm assuming it's some sort of wireless connection issue. I powered down and up both the printer and the Macbook and still get the error. I tried the "Reset Printer System" from the System Preferences and now I can't add the printer back in. I tried using the CD that came with the printer to reinstall the wireless connection and the set-up program says it's incompatible with my operating system and refuses to run. Any assistance to help me print wirelessly again would be very much appreciated. Thank you.

    After further investigation, we believe this is due to an intermittent  modem problem and is not the fault of the printer or MacBook.

  • How to get top downloaded or accessed content from ucm in webcenter

    Hi,
    How to get the top ucm accessed contents or downloads from ucm using ridc?
    Is it possible to retrieve content tracker details using ridc?
    Thanks,
    Chandrasekar M

    Like anything else Content Tracker functionality is provided in a form of services, but it might require a bit search to find which services are to be called and how.
    However, Content Tracker stores data in the database tables - (also to be available for External Report Generator), so why not to take data directly from the database? Alternatively, you could configure the system to send reports for you and take it from there.
    What exactly is your use case?

  • Getting rep-3002 when calling report from form on web

    i am getting rep-3002 when i call report from a form on web environment. Report is in character mode. It is coming proper if i change it to bitmap. but my requirement is of character mode. pl. give some solution.

    Hello,
    If you are running in WinNT/2000 environment, the NT/2000 user which runs the Report Server service must have a printer defined. In the control panel, look at the properties for the Report Server to see what user it runs as. Log in as that user and make sure a default printer is defined.
    Regards,
    The Oracle Reports Team --skw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Urgent: Getting FRM-41211 when calling reports from forms for first time.

    Hi,
    We are running into the FRM-41211 error, when the users try to call a report from a form. The report is called from a form in SYNCHRONOUS mode. This is the only report that is being called. No other report is
    running at that time when the users get this error. This is happening only the first time when they try to call the report from the form. After getting this error, when they click on OK, and when they try to call this
    report again, the report works fine.
    Any ideas?? It's urgent...
    Thanks
    Vamshi.
    null

    Maybe try to use "run_report_product"?

  • Duplicate emails on BB when I send from Outlook

    I've got a client with a bunch of BBs, they use BIS and Exchange.  Whenever they send from Outlook, they get dupe emails on their phones.  I found a supposed solution, which was to go into BIS and recreate the accounts with OWA instead of IMAP, but no matter what URL I type in, it tells me it's invalid.  I also saw a possible solution that involved getting Exchange no to assign a new UID to the emails, but I'm not finding anything in Exchange to change that.  Any help would be very welcome.
    Thanks,
    Ben

    Hey Benny111,
    Welcome to the BlackBerry Support Community Forums.
    You're absolutely correct that you will need to integrate those IMAP accounts to POP3 or OWA to resolve this issue.
    Here is a link to a knowledge base article that will provide you more information:
    http://www.blackberry.com/btsc/KB13528 and look at cause #5.
    -ViciousFerret
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Like! for those who have helped you.
    Click  Accept as Solution for posts that have solved your issue(s)!

  • First tab not getting "TabPanelTabSelected" class when tabs created from dataset

    Greetings all. I've got a tabbedpanel widget whose tabs are
    created with a spry repeat region. works great, except none of the
    tabs get the "TabPanelTabSelected" class on initial load. I tried
    setting the defaultPanel in the constructor, but to no avail.
    here's the div that creates the tabs:
    <div class="statustabs_TabbedPanels SpryHiddenRegion"
    id="statustabs" spry:region="dsRequestCounts">
    <ul class="statustabs_TabbedPanelsTabGroup"
    spry:repeatchildren="dsRequestCounts">
    <li
    class="statustabs_TabbedPanelTab"
    spry:hover="statustabs_TabbedPanelTabHover"
    spry:select="statustabs_TabbedPanelTabSelected"
    tabindex="{dsRequestCounts::@StatusID}"
    onclick="updateRequests({dsRequestCounts::ds_RowID})"
    >{dsRequestCounts::@StatusName} (<span
    id="statustabcount_{dsRequestCounts::ds_RowID}">{dsRequestCounts::@RequestCount}</span>)< /li>
    </ul>
    </div>
    and here's the constructor, which is done after the tab divs
    are created:
    <script type="text/javascript">
    var statustabs = new Spry.Widget.TabbedPanels("statustabs",
    tabHoverClass:"statustabs_TabbedPanelTabHover",
    tabSelectedClass:"statustabs_TabbedPanelTabSelected",
    tabFocusedClass:"statustabs_TabbedPanelTabFocused",
    panelVisibleClass:"statustabs_TabbedPanelContentVisible"
    </script>
    So, the question is: how can i get that first tab, on load,
    to take on the appropriate class so that it's styled appropriately?
    thanks so much.
    Marc

    Thanks a lot Kin. I now have it working, mostly. I changed
    the contentgroup div so that it repeated over the RequestCounts to
    create the table. However, when I did that, obviously it drew the
    table each time through the loop. So I changed the table's spry:if
    to also look at the current status names for equality. only then
    does it actually draw the table for the status that's been clicked.
    the final version appears below.
    Now, I do have two problems though.
    1) I can no longer use the spry:loading state. If I have
    this: <div spry:state="loading">loading...</div> right
    under the "TabbedPanelscontentGroup" div, I get an error that
    tpIndex is not defined. So...do you know how i can get this
    functionality back?
    2) One thing I needed to implement was "persistent" tab on
    data refresh. I added a loadInterval on the RequestCounts dataset,
    and thus everytime that interval was up the tab went back to the
    first one. So in the updateRequests() function, i set a variable
    named 'selectedTab' to the clicked rowid. Then, in the
    tabObserver.onPostUPdate function, i have the dsRequestCounts
    current row being set to that variable.
    The only problem with this is that the "requests" dataset
    then gets loaded twice when the interval causes the data to reload:
    once for the first row, and then once for my 'persisted' row. This
    makes sense, but i just don't know how to fix it. i'm pasting the
    code into this post...maybe someone can see some way to get around
    this?
    Basically, the behavior I want is this:
    a) on initial page load, load the requestCounts dataset and
    use the first row of that dataset to load the requests dataset
    (this works)
    b) when a user clicks a tab, load the requests dataset with
    the rowid of the clicked tab (this works)
    c) when the loadInterval causes the RequestCounts dataset to
    be refreshed, use the 'selectedTab' variable as the CurrentRow of
    the RequestCounts data such that the Requests dataset is loaded
    with the correct row and the selected tab is correct
    So the only rpoblem i have is with c, and the only problem
    there is that essentially what happens is the requests dataset is
    loaded twice.
    Thanks to any and all for advice getting the "loading" state
    working and the refresh behavior correct!
    --------------- here's the current code -----------------
    <!--- ---><cfset request.cfcore = "/argus/dope/">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml"
    xmlns:spry="
    http://ns.adobe.com/spry">
    <HEAD>
    <TITLE>Spry widgets Samples One</TITLE>
    <link href="/argus/dope/style/style.css" rel="stylesheet"
    type="text/css" />
    <link href="/argus/dope/style/widgets.css"
    rel="stylesheet" type="text/css" />
    <SCRIPT
    SRC="/argus/spry/includes/xpath.js"></SCRIPT>
    <SCRIPT
    SRC="/argus/spry/includes/SpryData.js"></SCRIPT>
    <SCRIPT
    SRC="/argus/spry/includes/SpryXML.js"></SCRIPT>
    <SCRIPT
    SRC="/argus/spry/widgets/tabbedpanels/SpryTabbedPanels.js"></SCRIPT>
    </HEAD>
    <body>
    <cfoutput>
    <script type="text/javascript">
    var selectedTab=0;
    var loaded = 0;
    var statustabs = new Object;
    //datasets for the tabbed panel of requests.
    dsRequestCounts = new
    Spry.Data.XMLDataSet("#request.cfcore#ajax/act/act_RequestCountsXML.cfm?StatusesFromLast= 100&ServerGroupID=14",
    "statuses/status",{useCache:false,loadInterval:20000});
    dsRequests = new
    Spry.Data.XMLDataSet("#request.cfcore#ajax/act/act_RequestsXML.cfm?StatusesFromLast=100&S erverGroupID=14&StatusID={dsRequestCounts::@StatusID}",
    "requests/request",{useCache:false});
    //for the tabbed panels
    tabObserver = new Object;
    tabObserver.onPostUpdate = function(notifier,data){
    dsRequestCounts.setCurrentRow(selectedTab);
    //alert("onpostupdate: " +
    dsRequestCounts.getCurrentRowNumber());
    statustabs = new Spry.Widget.TabbedPanels("statustabs",
    {defaultTab:dsRequestCounts.getCurrentRowNumber(),
    tabHoverClass:"statustabs_TabbedPanelTabHover",
    tabSelectedClass:"statustabs_TabbedPanelTabSelected",
    tabFocusedClass:"statustabs_TabbedPanelTabFocused",
    panelVisibleClass:"statustabs_TabbedPanelContentVisible"
    Spry.Data.Region.addObserver("statustabs",tabObserver);
    function updateRequests(rowid){
    dsRequestCounts.setCurrentRow(rowid);
    selectedTab=rowid;
    //alert("updaterequests: " +
    dsRequestCounts.getCurrentRowNumber());
    //statustabs.showPanel(rowid);
    </script>
    </cfoutput>
    <!--- tab div --->
    <div id="statustabs" class="statustabs_TabbedPanels
    SpryHiddenRegion" spry:region="dsRequests dsRequestCounts">
    <ul class="statustabs_TabbedPanelsTabGroup">
    <li spry:repeat="dsRequestCounts"
    class="statustabs_TabbedPanelTab"
    tabindex="0"
    onclick="updateRequests({dsRequestCounts::ds_RowID})"
    >{dsRequestCounts::@StatusName} (<span
    id="statustabcount_{dsRequestCounts::ds_RowID}">{dsRequestCounts::@RequestCount}</span>)< /li>
    </ul>
    <!--- tab content group div --->
    <div class="statustabs_TabbedPanelsContentGroup">
    <div spry:state="loading">loading...</div>
    <div class="statustabs_TabbedPanelContent"
    spry:state="ready" spry:repeat="dsRequestCounts">
    <table class="requeststable" width="100%"
    spry:if="{dsRequests::ds_RowCount}!=0 &&
    '{dsRequestCounts::@StatusName}'=='{dsRequests::@StatusName}'">
    <tr>
    <th
    onclick="dsRequests.sort('@RequestID','toggle')">ID</th>
    </tr>
    <tr spry:repeat="dsRequests"
    spry:even="requeststable_even" spry:odd="requeststable_odd">
    <td>{dsRequests::@RequestID}</td>
    </tr>
    </table>
    <div spry:if="{dsRequests::ds_RowCount}==0">
    Move along...nothing to see here
    </div>
    </div>
    </div>
    </div>
    </body>
    </html>

Maybe you are looking for