<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ellis Web Development &#187; windows forms</title>
	<atom:link href="http://ellisweb.net/category/code/windows-forms/feed/" rel="self" type="application/rss+xml" />
	<link>http://ellisweb.net</link>
	<description>Thoughts &#38; Articles on ASP.net, C#, Software Development and Technology by Yaakov Ellis</description>
	<lastBuildDate>Mon, 07 May 2012 07:45:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Memory Profiler Eating Up My Memory</title>
		<link>http://ellisweb.net/2008/08/memory-profiler-eating-up-my-memory/</link>
		<comments>http://ellisweb.net/2008/08/memory-profiler-eating-up-my-memory/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 19:01:54 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[windows forms]]></category>
		<category><![CDATA[dottrace]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[jet-brains]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[profiler]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[task-manager]]></category>

		<guid isPermaLink="false">http://ellisweb.net/?p=370</guid>
		<description><![CDATA[I have a Windows Forms app that has a very long and complicated initialization process. As the release is approaching, today was my day to try and shoft things around in the init, get it loading faster. So on recommendation from a few sources, I downloaded a profiler &#8211; Jet … <a href="http://ellisweb.net/2008/08/memory-profiler-eating-up-my-memory/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>I have a Windows Forms app that has a very long and complicated initialization process. As the release is approaching, today was my day to try and shoft things around in the init, get it loading faster. So on recommendation from a few sources, I downloaded a profiler &#8211; Jet Brains <a href="http://www.jetbrains.com/profiler/">dotTrace</a>. Install and first profile went well. However, as I started to make more changes and run more profiles, I noticed that there were no improvements in initialization time. If anything, things were getting worse. Task Manager helped pinpoint the culprit:</p>
<p><a href="http://ellisweb.net/wp-content/uploads/2008/08/dottrace.jpg" rel="lightbox[370]" title="dotTrace in the Task Manager"><img class="aligncenter size-medium wp-image-371" title="dotTrace in the Task Manager" src="http://ellisweb.net/wp-content/uploads/2008/08/dottrace-300x272.jpg" alt="" width="300" height="272" /></a></p>
<p>If the numbers are too small, that is 1,241,596 KB. Yikes. Compare that with the second and third-place contestants, FireFox 3 at 174,584 KB, Visual Studio 2005 at 144,940 KB.</p>
<p>This is what happened after I closed the profiler (see if you can guess when that happened):</p>
<p><a href="http://ellisweb.net/wp-content/uploads/2008/08/dottrace-pagefile.jpg" rel="lightbox[370]" title="Memory drops after dotTrace is closed"><img class="aligncenter size-medium wp-image-372" title="Memory drops after dotTrace is closed" src="http://ellisweb.net/wp-content/uploads/2008/08/dottrace-pagefile-300x272.jpg" alt="" width="300" height="272" /></a></p>
<p>And I thought that Firefox 2 was using <a href="http://ellisweb.net/2007/04/firefox-the-memory-hog/">a lot of memory</a>. I know that these programs are complicated, but I find it hard to comprehend how a program is supposed to help you track the memory usage of the applications that you are debugging when it ends up gobbling down over 1.2GB of RAM all by itself and making the computer basically unusable.</p>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2008/08/memory-profiler-eating-up-my-memory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detecting Application Idle State in Windows Forms</title>
		<link>http://ellisweb.net/2008/02/detecting-application-idle-state-in-windows-forms/</link>
		<comments>http://ellisweb.net/2008/02/detecting-application-idle-state-in-windows-forms/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 11:44:21 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[windows forms]]></category>
		<category><![CDATA[application idle]]></category>
		<category><![CDATA[idle]]></category>

		<guid isPermaLink="false">http://ellisweb.net/2008/02/detecting-application-idle-state-in-windows-forms/</guid>
		<description><![CDATA[On a recent project, I had the need to detect whether or not the application is idle, and if so, for how long has the idle state persisted. Idle in my case is defined as no mouse movement or keyboard activity when any of the forms of the application are … <a href="http://ellisweb.net/2008/02/detecting-application-idle-state-in-windows-forms/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>On a recent project, I had the need to detect whether or not the application is idle, and if so, for how long has the idle state persisted. Idle in my case is defined as no mouse movement or keyboard activity when any of the forms of the application are in focus. If a different program is in focus, I define this as being an application-idle state (for my app), regardless of whether or not there is input activity from keyboard or mouse.</p>
<p>On researching the subject, I found several approaches. The <a href="http://www.thescripts.com/forum/thread256888.html">main approach</a> I have seen is to use the static <a href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.application.idle.aspx">Application.Idle</a> event. This event fires whenever &#8220;application finishes processing and is about to enter the idle state&#8221; &#8211; In other words, whenever the application&#8217;s message queue is empty. The problem with this approach is that this event fires a lot, so much that it becomes impractical for tracking idle state the way that I need it (it doesn&#8217;t help that any Timer operating to track how long the idle state persists would set off Application.Idle, further complicating the situation).</p>
<p>The other approach that I have seen is to set up some Windows hooks to detect mouse and keyboard activity. I have zero experience operating with the Windows API, so thankfully, I found a post by Johan Danforth that gives some working code for doing exactly what I needed: <a href="http://weblogs.asp.net/jdanforth/archive/2006/06/21/454219.aspx">Detecting Idle Time with Mouse and Keyboard Hooks</a>. I integrated the code with my application and tested it out and it worked great.</p>
<p>There was one problem however: this code detects idle time for all applications. In other words, if your application is open but not in focus and you use your mouse or keyboard, the code changes your application status from Idle to Active. For my purposes (see definition if <em>idle</em> above) this is not good enough. So I inspected different properties of the System,Windows.Forms.Form class to see what could tell me whether or not a given form is active. The first candidates were Focused, TopLevel, TopMost and Visible, but none of these did the job. The property that ended up telling me exactly what I needed to know is <a href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.containsfocus.aspx">ContainsFocus</a>. This is a property of the Control class (from which Form inherits) and it &#8220;Gets a value indicating whether the control, or one of its child controls, currently has the input focus&#8221;. (Focused is not good enough, since it only returns true when the form itself has focus, but returns false when a child control contained within the form has focus).</p>
<p>I also needed to detect whether any of the secondary forms of my application had focus (since I could have more than one window open at a time, only one of which could have focus). Here is the code that I used:</p>
<pre name="code" class="c#">private bool DoesApplicationHaveFocus() {
  bool hasFocus = false;
  if (ContainsFocus) {
    hasFocus = true;
  } else {
    FormCollection forms = Application.OpenForms;
    foreach (Form f in forms) {
      if (f != null &#038;&#038; f.ContainsFocus) {
        hasFocus = true;
        break;
      }
    }
  }
  return hasFocus;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2008/02/detecting-application-idle-state-in-windows-forms/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WYSIWYG Editing of HTML in a Windows Forms Control</title>
		<link>http://ellisweb.net/2007/03/wysiwyg-editing-of-html-in-a-windows-forms-control/</link>
		<comments>http://ellisweb.net/2007/03/wysiwyg-editing-of-html-in-a-windows-forms-control/#comments</comments>
		<pubDate>Mon, 19 Mar 2007 12:52:57 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[windows forms]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[rtf]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://ellisweb.net/2007/03/wysiwyg-editing-of-html-in-a-windows-forms-control/</guid>
		<description><![CDATA[In a WinForms project that I am working on right now, I have text stored in HTML format in the database. I need a way for novice users to be able to edit this text using a WYSIWYG interface. The most obvious choice for this in the Windows.Forms control library … <a href="http://ellisweb.net/2007/03/wysiwyg-editing-of-html-in-a-windows-forms-control/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>In a WinForms project that I am working on right now, I have text stored in HTML format in the database. I need a way for novice users to be able to edit this text using a <a href="http://en.wikipedia.org/wiki/WYSIWYG">WYSIWYG</a> interface.</p>
<p>The most obvious choice for this in the Windows.Forms control library that is part of the .Net 2.0/3.0 framework is the <a href="http://msdn2.microsoft.com/en-us/library/3tdc88y7(VS.80).aspx">RichTextBox</a> control. This control gives you a textbox that has functionality similar to the WordPad application found in the Windows OS. It can display formatted pretty well. Aside from the fact that you have to handle all formatting of text in code, RichTextBox it has one major shortcomings: It can only input/output plain text or RTF encoded text. If I wanted to use a RichTextBox control to edit HTML, I would need some way to translate from the source HTML (stored in the DB) to RTF (to be displayed in the RichTextBox) and then back to HTML (to be stored again in the DB). Although I found some components from <a href="http://www.sautinsoft.com/components.php">Sautin Software</a> that seem to do the job, they cost money that I would rather not spend, and add a layer of complexity to my code library that I would rather avoid.</p>
<p>I found a couple of controls that extend the RichTextBox in order to allow input of HTML: <a href="http://www.codeproject.com/cs/miscctrl/htmlrichtextbox.asp">An extended RichTextBox to save and load &#8220;HTML lite&#8221; files</a> by <a href="http://www.codeproject.com/script/Articles/list_articles.asp?userid=3359">Oscar Londoño</a> (Code Project &#8211; For .Net 1.1/VS 2003) and                                                                                                                                              									<a id="_ctl3_samplesBody__ctl4_myCategoryList__ctl6_Linkman2" title="Linkman1" name="Linkman1" href="http://www.windowsforms.net/TrackViews.aspx?ID=186&amp;Type=Samples&amp;Redir=%2fSamples%2fdownload.aspx%3fPageId%3d1%26ItemId%3d186%26tabindex%3d4" target="_self">RichTextBox that Displays XHTML</a> by Eric Voreis. Both of these controls extend the RichTextBox control in the Windows.Forms library so that it can translate on the fly between RTF and HTML code (so you can input HTML code, see it displayed in the RTB and export HTML code). However, both are old and only support a small subset of HTML tags (although this can be extended in the source, it required knowledge of how RTF works). Also, since they use a RichTextBox control for editing and display, the display is similar but not identical to what you would get using a WebBrowser.</p>
<p>The next method that I found for providing this type of error is <a href="http://windowsforms.net/articles/htmleditor.aspx">HTML Editor</a> by Carl Nolan (Microsoft Consulting Services). This control (written in 2003 for .Net 1.1) modifies a WebBrowser control to allow inline editing and display of HTML. It is professionally written, provides support for many HTML tags and does just about everything that I need (and is free). The one problem is that it is pre-.Net 2.0. It uses a WebBrowser control from before this control was included as part of the Windows.Forms library in .Net 2.0 and thus has to reference Win32 calls and perform other types of acrobatics in order to get the control to function properly. This matters to me because it decreases portability of the control (using Mono, for instance), and makes it harder for me to customize and edit.</p>
<p><a title="WebBrowser-based HTML Editor in action" href="http://ellisweb.net/wp-content/uploads/2007/03/html.jpg" rel="lightbox[176]"><img src="http://ellisweb.net/wp-content/uploads/2007/03/html.jpg" alt="WebBrowser-based HTML Editor in action" width="374" height="211" /></a></p>
<p>The control that I am using in the end employs the same general idea used in HTML Editor, but takes advantage of new features (like the native WebBrowser class) provided by the .Net 2.0/3.0 framework and and Visual Studio 2005. <a href="http://www.codeproject.com/KB/edit/editor_in_windows_forms.aspx">A Windows Forms based text editor with HTML output</a> by <a href="http://www.codeproject.com/Members/kevin-delafield">Kevin DeLafield</a> uses a <a href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx">WebBrowser</a> control with modified functionality to allow WYSIWYG display and editing of HTML text. It provides all of the functionality that I am looking for and allows for easy modifications and customizations in Visual Studio 2005. I recommend that anyone in need of similar functionality take a look at this control.</p>
<p><img src="file:///C:/DOCUME%7E1/Yaakov/LOCALS%7E1/Temp/moz-screenshot.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2007/03/wysiwyg-editing-of-html-in-a-windows-forms-control/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Global Application Error Handling in Windows Forms Applications</title>
		<link>http://ellisweb.net/2007/03/global-application-error-handling-in-windows-forms-applications/</link>
		<comments>http://ellisweb.net/2007/03/global-application-error-handling-in-windows-forms-applications/#comments</comments>
		<pubDate>Fri, 02 Mar 2007 11:30:47 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[windows forms]]></category>
		<category><![CDATA[exceptions]]></category>

		<guid isPermaLink="false">http://ellisweb.net/2007/03/global-application-error-handling-in-windows-forms-applications/</guid>
		<description><![CDATA[In my current project, I would like to log all Windows Forms errors, including those that are not caught explicitly. Lacking a built-in method (like Application_Error in the Global.asax file of an ASP.net application), I needed another way to easily catch all errors. After a bit of searching, I found … <a href="http://ellisweb.net/2007/03/global-application-error-handling-in-windows-forms-applications/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>In my current project, I would like to log all Windows Forms errors, including those that are not caught explicitly.  Lacking a built-in method (like Application_Error in the Global.asax file of an ASP.net application), I needed another way to easily catch all errors. After a bit of searching, I found a solution by Craig Andera: <a href="http://www.pluralsight.com/blogs/craig/archive/2004/06/13/1455.aspx">WinForms Catch-All Exception Handling</a>. Here is the short version:</p>
<p>In the main entry point for your application (found by default in the Progrsm.cs file, Main() method), add a listener for the Application.ThreadException event.</p>
<pre class="c#" name="code">[STAThread]
static void Main() {
  Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
  Application.Run(new Form1());
}

private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) {
  // Handle Exception
}</pre>
<p>This should allow you to catch all Exceptions in your application that were not caught at the source.</p>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2007/03/global-application-error-handling-in-windows-forms-applications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cannot Access a Disposed Object</title>
		<link>http://ellisweb.net/2007/01/cannot-access-a-disposed-object/</link>
		<comments>http://ellisweb.net/2007/01/cannot-access-a-disposed-object/#comments</comments>
		<pubDate>Sun, 28 Jan 2007 16:52:45 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[windows forms]]></category>
		<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://ellisweb.net/2007/01/cannot-access-a-disposed-object/</guid>
		<description><![CDATA[In a Windows Forms application that I am working on, I had the following scenario: while the main form (Main.cs) is loading, I prompt the user to prove their credentials. If they are unable to do so, the form is closed (using this.close) and application execution is halted. The problem … <a href="http://ellisweb.net/2007/01/cannot-access-a-disposed-object/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>In a Windows Forms application that I am working on, I had the following scenario: while the main form (Main.cs) is loading, I prompt the user to prove their credentials. If they are unable to do so, the form is closed (using <em>this.close</em>) and application execution is halted.</p>
<p>The problem is, when I first tried this, I an exception was thrown in <em>Program.cs</em> on the following line:</p>
<pre name="code" class="c#:nocontrols">Application.Run(new Main());</pre>
<p>The exception was of type <em>System.ObjectDisposedException</em>, and the accompanying message was &#8220;Cannot access a disposed object&#8221;.</p>
<p>What happened? According to the official documentation, the method System.Windows.Forms.Application.Run(Form) has the following purpose: &#8220;Begins running a standard application message loop on the current thread, and makes the specified form visible.&#8221; When this line of code is called, it first instantiates a new instance of the given Windows.Form implementation (in my case, Main.cs) and after it is instantiated, sets the Form.Visible parameter to true, thereby showing the form. In my case, during the instantiation of the form, the Close() method on the form was called, which disposes the Forms object. So when Program.cs attempts to set Main.Visible = true, Main is already disposed and the above error is thrown.</p>
<p>What is the workaround? I can think of two ways off the top of my head (the first one is the one that I ultimately used). Can you think of any others?</p>
<ol>
<li>Substitute the line in Program.cs with the following. Here the Main class is instantiated first, and only if it is still in existence and not disposed will Application.Run be called. Thus, if Main is closed during instantiation, Application.Run will never be called and the application will close on its own.</li>
</ol>
<pre class="c#" name="code">Main main = new Main();
if (main != null &amp;&amp; !main.IsDisposed) {
  Application.Run(main);
}</pre>
<ol start=2>
<li>Do not call the user authentication code during the instantiation of the main Form of the application. Instead, call it in some event (like Activate) that is tied directly to the creation of the Form, but is not part of the initial instantiation code. In this case the class will instantiate, Application.Run will execute, and only after will the user authentication (and possible subsequent disposal of the form and exit from the application) take place.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2007/01/cannot-access-a-disposed-object/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>In Search of an Embedded DB for a Windows Forms Application</title>
		<link>http://ellisweb.net/2007/01/in-search-of-an-embedded-db-for-a-windows-forms-application/</link>
		<comments>http://ellisweb.net/2007/01/in-search-of-an-embedded-db-for-a-windows-forms-application/#comments</comments>
		<pubDate>Thu, 18 Jan 2007 08:49:54 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[windows forms]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[sql server express]]></category>
		<category><![CDATA[sqlce]]></category>
		<category><![CDATA[vistadb]]></category>

		<guid isPermaLink="false">http://ellisweb.net/2007/01/in-search-of-an-embedded-db-for-a-windows-forms-application/</guid>
		<description><![CDATA[So I am in the middle of building a pretty substantial Windows Forms application in .Net 2.0/C#, which will rely very heavily on database integration. Currently development is proceeding using Sql Server Express 2005 for the database server. It is a very robust product that supports anything that you can … <a href="http://ellisweb.net/2007/01/in-search-of-an-embedded-db-for-a-windows-forms-application/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>So I am in the middle of building a pretty substantial Windows Forms application in .Net 2.0/C#, which will rely very heavily on database integration. Currently development is proceeding using <a href="http://msdn.microsoft.com/vstudio/express/sql/">Sql Server Express 2005</a> for the database server. It is a very robust product that supports anything that you can do on the full edition of SQL Server, and is freely distributable. Stored procedures, triggers, the works.</p>
<p>However, when making the first internal release intended to be installed by other people, I ran into some problems, specifically related to the way that SQL Express works. As it is really the same thing as the full version of SQL Server (with limits put on DB size and other licensing issues), it requires a big download (around 35mb), large db file footprint (around 20mb) separate installation, and runs as a service on the client machine. Though the install can be packaged as part of your overall distribution and set to install &#8220;silently&#8221;, it is still an issue that requires ongoing support and trouble-shooting. Additionally, you can sometimes run into problems with the SQL Express service, permissions, problems attaching the database to the server, etc. It is a robust solution, but the potential problems involved in installing SQL Express on thousands of client machines and getting it to run flawlessly all the time is enough to give me pause.<br />
<span id="more-167"></span><br />
One alternative is the newly release <a href="http://www.microsoft.com/sql/editions/compact/default.mspx">SQL Server Compact Edition</a> (3.1). It is a repackaged version of the old SQL Server Mobile (and renamed version of the pre-release SQL Server Everywhere). It has a very small DB footprint (less than a MB), and (the key feature) it does not require a separately-installed DB Server. Instead, you distribute the SQLce runtime dlls with your application and they are launched into a separate process as needed. No worrying about large DB Server installs, security issues, separate services, etc.</p>
<p>Of course, SQLce does have its downsides. For all that you gain, you sacrifice view, stored procedures, foreign keys, triggers, transactions, etc. In other words, you have a nice, easy-to-use, portable and easily distributable DB engine for use in .Net applications, that gives you tables as your one and only database feature. Though this is workable and it may be possible to transition from SQL Express to SQLce, a lot of functionality and maintainability is lost in the process.</p>
<p>In search of a (non-Microsoft) alternative for an embedded DB candidate for .Net applications, I just came across <a href="http://www.vistadb.net/vistadb3.asp">VistaDB 3.0</a>. This seems to have everything that I am looking for. Basically, all of the database processing <a href="http://www.vistadb.net/v3_features.asp">features</a> that SQL Express has to offer (other than stored procedures), including views, foreign keys, constaints, ADO.net data provider, integration with Visual Studio and much more. It claims to be T-SQL compliant, supporting .Net data types and Unicode and offers its own database management program and a utility for migrating over your existing Sql Server databases. And it is an embedded databse with a small footprint, requiring no installation on the client end and running in its own process at runtime.</p>
<p>The only downside that I can see is that I have never heard of them before. It looks like this product has been around for at least a couple of years, and the new 3.0 release is a big one for them. I have not seen any real reviews of it (other than a <a href="http://www.larkware.com/NewReviews/vistadb30.aspx">preview on Larkware</a>, and lots of blogs that copied their PR material in response to an <a href="http://www.vistadb.net/BlogOffer.asp">offer of a free license</a> for publicity). Has anyone used this product in a .Net 2.0 Windows Forms application that is being widely distributed? Any problems? Recommendations?</p>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2007/01/in-search-of-an-embedded-db-for-a-windows-forms-application/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2005 Add-Ins and Tools That I Use</title>
		<link>http://ellisweb.net/2006/12/visual-studio-2005-add-ins-and-tools-that-i-use/</link>
		<comments>http://ellisweb.net/2006/12/visual-studio-2005-add-ins-and-tools-that-i-use/#comments</comments>
		<pubDate>Tue, 19 Dec 2006 10:13:56 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[windows forms]]></category>
		<category><![CDATA[advice]]></category>
		<category><![CDATA[code rush]]></category>
		<category><![CDATA[codesmith]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[reviews]]></category>
		<category><![CDATA[slickedit]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[visual assist x]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://ellisweb.net/2006/12/visual-studio-2005-add-ins-and-tools-that-i-use/</guid>
		<description><![CDATA[I am right now in the middle (about 20% and 18K lines of code through) a pretty substantial Windows Forms project using Visual Studio 2005 (C#). Here are some of the add-ins that I have been using (ranked in order of essential to useful): CodeSmith &#8211; Number one in Code … <a href="http://ellisweb.net/2006/12/visual-studio-2005-add-ins-and-tools-that-i-use/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>I am right now in the middle (about 20% and 18K lines of code through) a pretty substantial Windows Forms project using Visual Studio 2005 (C#). Here are some of the add-ins that I have been using (ranked in order of essential to useful):<br />
<span id="more-165"></span></p>
<ol>
<li><a href="http://www.codesmithtools.com/">CodeSmith</a> &#8211; Number one in Code Generation. I have spent less than a week of total time setting up my templates, and over the last three months alone have generated 386,403 lines of C# and TSQL code using this tool. I cannot see how I could work without it. Well-worth the investment.</li>
<li><a href="http://www.wholetomato.com/">Visual Assist X</a> ($149) &#8211; (My review <a href="http://ellisweb.net/2006/05/visual_assist_x/">here</a>). I have been using this for about 2 years now. It works very well with both VS 2003 and 2005. The main features that really save me time are the <em>much</em> improved intellisense over the standard offering from MS, which includes basically any variable name that I could use based on the context that I am in (including private variables that were just created, properties available from inherited objects, etc). It also acts &#8220;intelligently&#8221; &#8211; if I type in something like <em>myObject.Controls.Add(&#8230;);</em> and then go to another line, when I start typing it will offer me this sequence as an option to autopopulate through intellisense. Very useful. Also allows you to use acronyms or type in the leading capital letters from Pascal/Camel case to find a function or property name. Additionally, VAssist X offers handy features for finding functions, and more (including a small but useful one which works as follows &#8211; when you type &#8220;functionName(&#8220;, the closing &#8220;)&#8221; will automatically appear. If you type &#8220;)&#8221; now, as I often do just out of habit, it will not insert an additional &#8220;)&#8221; character &#8211; rather, it will advance beyond the closing parentheses that was automatically added</li>
<li>Krypton Toolkit (free) and Navigator ($50) from <a href="http://www.componentfactory.com/">Component Factory</a> &#8211; Although I had been reading Phil&#8217;s <a href="http://www.componentfactory.com/blog.php">blog</a> for some time before I started getting into Windows Forms, now that I am doing some WF work, I am finding this collection of components to be indispensible in extending the controls that are provided by MS in VS 2005 (and in the Navigator control providing several pieces of functionality in my current app that we would have had to invest weeks or months in to produce form scratch or come up with some alternative), and allowing me to give a universal, comprehensive look-and-feel to my application that would have been very difficult or impossible otherwise.</li>
<li><a href="http://vgdotnet.com/">VG Dot Net</a> &#8211; Have a need for Vector Graphics in your Windows Forms or ASP.net application? Want to be able to manipulate the different components of the VG objects and images directly in your code (no COM please!)? Look no further.</li>
<li><a href="http://www.slickedit.com/content/view/441">Free SlickEdit Gadgets</a> &#8211; Some useful add-ins, including an easy-to-use Line of Code counter, Data Object analyzer (tells you what data items are inserted into the clipboard when different data object are copied in &#8211; an essential tool if you want to do anything more complicated than straight text copy/pasting from the clipboard, and a File Explorer add-in that basically gives you a Windows Explorer window in your code-view (Found via <a href="http://vidmar.net/weblog/archive/2006/11/08/3335.aspx">vidmar</a>)</li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=CD7C6E48-E41B-48E3-881E-A0E6E97F9534&#038;displaylang=en">MS Visual Studio 2005 IDE Enhancements</a> (free) &#8211; This package with the uninspired name offered by Microsoft includes a useful code outliner (very useful in complement with some of the Visual Assist X offerings, IDE event viewer, Diff Utility and improvements to the Find engine.</li>
<li><a href="http://www.devexpress.com/Products/NET/IDETools/CodeRush/">Code Rush with Rafactor! PRO</a> ($249) &#8211; I tried it for a month and found that it was interfering with my workflow more than helping it (though this is almost certainly because I am used to the way that Visual Assist X works). However, <a href="http://www.devexpress.com/Products/NET/IDETools/CodeRush/">some people</a> find it to be very helpful. To each his own.</li>
<li>Although I  do not have anything installed from here right now, I would be remiss if I did not mention the ever-growing collection of Visual Studio Add-ins at the <a href="http://www.codeproject.com/csharp/#VS%2ENET+Addins">Code Project</a>. As always with items from CP, use at your own risk&#8230;though you may find some gems here as well</li>
</ol>
<p>Am I missing anything?</p>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2006/12/visual-studio-2005-add-ins-and-tools-that-i-use/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Transitioning from Web Apps to Desktop Development</title>
		<link>http://ellisweb.net/2006/05/transitioning-from-web-apps-to-desktop-development/</link>
		<comments>http://ellisweb.net/2006/05/transitioning-from-web-apps-to-desktop-development/#comments</comments>
		<pubDate>Wed, 24 May 2006 09:33:25 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[windows forms]]></category>

		<guid isPermaLink="false">http://www.ellisweb.net/2006/05/transitioning-from-web-apps-to-desktop-development/</guid>
		<description><![CDATA[For the past 2+ years I have been working with different aspects of Web Application design, primarily using ASP.net 1.1 and SQL Server 2000. I have been involved in different parts of the process: Documentation, User Interface Design, System Architecture, Coding, Testing, QA, Release. Worked on a few internal products … <a href="http://ellisweb.net/2006/05/transitioning-from-web-apps-to-desktop-development/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>For the past 2+ years I have been working with different aspects of Web Application design, primarily using ASP.net 1.1 and SQL Server 2000. I have been involved in different parts of the process: Documentation, User Interface Design, System Architecture, Coding, Testing, QA, Release. Worked on a few internal products for my old company (ranging from 1-10,000+ users).</p>
<p>Now for the first time I will be working in Desktop development. My old company wants to upgrade their old desktop software to bring it up to date (it was written in VB6 about 10 years ago). The good part about it is that the program is basically going to be a desktop version of the web application we released earlier this year (that is the 10,000+ user webapp that I spoke about before). Using the .Net Framework 2.0 with C#. Similar spec, look &#038; feel, user experience. Of all the people on the team, I probably have the most domain knowledge relating to the intricacies of the web application, user experience, and the way that the Desktop will work.</p>
<p>However, in some other aspects this is going to be a pretty complex program. Here are some of the messier requirements:</p>
<ul>
<li>Synchronization of information (for authorized users) between the web application and the desktop application</li>
<li>Support different user modes (with different levels of functionality for different types of users, as well as different sections of the program)</li>
<li>Use a Vector Graphing tool to provide custom on-the-spot graphics for use throughout the program. (This has to work perfectly, as one of the graphs in question is the main feature of the program)</li>
<li>Support exports to image formats, RTF, PDF</li>
<li>Allow different types of imports and exports, covering different generations of formats, making sure that the data stays secure and is mapped over properly from old formats to new (and vice versa)</li>
<li>Kind of complex UI: 4-5 main panes, each with its own specific functionality, all of which must interact together</li>
<li>User authentication, for both online and offline users</li>
</ul>
<p>So, its going to be fun.</p>
<p>I am right now in the middle of writing the scope and functional specification documents (yup, I am doing that as well). Over the next 6-12 months (projected duration of the project, as of now) I hope to provide updates on how things are going, specifically focusing on the transition from developing ASP.net web apps to Windows Forms apps in C#.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/Web-Development" rel="tag">Web-Development</a>, <a href="http://technorati.com/tag/ASP.net" rel="tag"> ASP.net</a>, <a href="http://technorati.com/tag/C%23" rel="tag"> C#</a>, <a href="http://technorati.com/tag/.Net-Framework" rel="tag"> .Net-Framework</a>, <a href="http://technorati.com/tag/Desktop-Development" rel="tag"> Desktop-Development</a>, <a href="http://technorati.com/tag/Programming" rel="tag"> Programming</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2006/05/transitioning-from-web-apps-to-desktop-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Server Failed to Load Application</title>
		<link>http://ellisweb.net/2006/05/the-server-failed-to-load-application/</link>
		<comments>http://ellisweb.net/2006/05/the-server-failed-to-load-application/#comments</comments>
		<pubDate>Thu, 18 May 2006 09:26:17 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[windows forms]]></category>
		<category><![CDATA[crystal reports]]></category>
		<category><![CDATA[dtc]]></category>
		<category><![CDATA[event viewer]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.ellisweb.net/2006/05/the-server-failed-to-load-application/</guid>
		<description><![CDATA[Due to some bad problems with my main machine, I have been in the process of bringing my backup laptop (Inspiron 5150, 768mb RAM, almost three years old, recently reformatted) up to speed for my development needs. This included installing Crystal Advanced Developer 10 (required for one of the ASP.net … <a href="http://ellisweb.net/2006/05/the-server-failed-to-load-application/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>Due to some bad problems with my main machine, I have been in the process of bringing my backup laptop (Inspiron 5150, 768mb RAM, almost three years old, recently reformatted) up to speed for my development needs. This included installing Crystal Advanced Developer 10 (required for one of the ASP.net webapps that I am doing maintenance on).</p>
<p>So I installed it, as I have done on a number of computers in the past. I then went and tried to run browse the webapp in question (using http://localhost/appName) and received an HTTP 500 error (IE7 politely told me that this indicated a server error, and that the website might be under maintenance).</p>
<p>I tried loading a totally different webapp that had nothing to do with Crystal. Same error. Reboot, same error. Not good.</p>
<p>So I looked in the System Event Viewer, and saw a bunch of the following warnings:</p>
<blockquote><p>The server failed to load application &#8216;/LM/W3SVC/1/Root/appName&#8217;. The error was &#8216;General access denied error&#8217;</p></blockquote>
<p>OK. What is that supposed to mean? And why was it killing all of my webapps?</p>
<p>After a little bit of <a href="http://www.google.com/search?q=%22The+server+failed+to+load+application+%27%2FLM%2FW3SVC%2F1%2FRoot%2F%22">Googling</a>, I found a page by Brett Hill in IIS Insider (March 2005), with one of the subsections titled: <a href="http://www.microsoft.com/technet/community/columns/insider/iisi0305.mspx#EZC">Resolving the Error: The server failed to load application&#8230;</a></p>
<blockquote><p>The most likely cause of this problem is that the DTC coordinator service has not started. If it has started, then look in the Event Viewer for a message regarding a failed logon for the IWAM_<em>servername</em> account.</p></blockquote>
<p>So I went into Services, and the <em>Distributed Transaction Coordinator</em> service was running. I stopped the service and restarted it, and <em>voila</em>, all of my sites would run again. Hopefully this situation will continue after my next reboot. If it does, the above article has some more advice on ways around this.</p>
<p>I have installed this program a number of times already on other machines without experiencing this error. Anyone know what may have caused it.</p>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2006/05/the-server-failed-to-load-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

