﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Unsafe Native Methods Error</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 14:38:02 GMT</lastBuildDate><ttl>20</ttl><item><title>Unsafe Native Methods Error</title><link>http://forum.strataframe.net/FindPost18351.aspx</link><description>An odd error showed up today...a user had left an SF application open overnight.&amp;nbsp; When he came in this morning, this error was waiting to greet him:&lt;/P&gt;&lt;P&gt;Message: External component has thrown an exception.&lt;BR&gt;&lt;BR&gt;Source: System.Windows.Forms&lt;BR&gt;&lt;BR&gt;Inner Exception: &lt;BR&gt;&lt;BR&gt;Stack Trace: at System.Windows.Forms.UnsafeNativeMethods.ThemingScopeDeactivateActCtx(Int32 dwFlags, IntPtr lpCookie)&lt;BR&gt;at System.Windows.Forms.UnsafeNativeMethods.ThemingScope.Deactivate(IntPtr userCookie)&lt;BR&gt;at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)&lt;BR&gt;at System.Windows.Forms.Application.Run(Form mainForm)&lt;BR&gt;at MicroFour.StrataFrame.Application.StrataFrameApplication.RunApplication() &lt;/P&gt;&lt;P&gt;This seems like one of those generic, could-be-caused-by-a-million-things type error; but, I thought I would throw it out there to see if anyone else has run into this.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR&gt;Bill</description><pubDate>Wed, 06 Aug 2008 10:18:26 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Unsafe Native Methods Error</title><link>http://forum.strataframe.net/FindPost18354.aspx</link><description>Thanks, Trent!&amp;nbsp; I suspected a non-SF related cause, too.&amp;nbsp; No doubt about that.&amp;nbsp; We are using RBS, but not setting a session timeout (*ponders* - maybe I should, though).&amp;nbsp; I'll dig further if I can get more error data collected from other users.&amp;nbsp; This was one user on one workstation...so, not too&amp;nbsp;much to worry about.&amp;nbsp; He is back working after a restart of the app.&amp;nbsp; I am just trying to appease my endless curiosity about the cause of&amp;nbsp;weird errors.&lt;/P&gt;&lt;P&gt;Take care!&lt;BR&gt;Bill</description><pubDate>Wed, 06 Aug 2008 10:18:26 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Unsafe Native Methods Error</title><link>http://forum.strataframe.net/FindPost18353.aspx</link><description>I had another thought that could be causing a problem.&amp;nbsp; If you are using Role-Based Security and are allowing session timeouts, there is some API logic there that closes, hides, and talks to open windows using some API logic.&amp;nbsp; One thing you might do is either turn off the session timeout for this user and see if the problem persists or turn it off altogether...but that might be a place to look.&amp;nbsp; Ultimately this would still be an OS issue, but you would at least know the catalyst and would be able to work from there.</description><pubDate>Wed, 06 Aug 2008 10:06:19 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Unsafe Native Methods Error</title><link>http://forum.strataframe.net/FindPost18352.aspx</link><description>This looks to be machine and OS related (environmental).&amp;nbsp; The themes that it is referring to are the Windows Themes (not SF) and you are right that this could come from a million different things.&amp;nbsp; So there is no way that I could give you any type of straight answer here...sorry :ermm:</description><pubDate>Wed, 06 Aug 2008 10:01:22 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>