<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6195851387401894206</id><updated>2011-07-08T02:48:58.846+02:00</updated><category term='ConnectionStrings'/><category term='VB.NET'/><category term='websites'/><category term='API'/><title type='text'>Bonsai Mind</title><subtitle type='html'>Yet another Blog about Visual Basic, C#, Vala and everything else.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bonsaimind.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6195851387401894206/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bonsaimind.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Bobby</name><uri>http://www.blogger.com/profile/10412832420733396232</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6195851387401894206.post-316339214310260283</id><published>2009-10-01T20:11:00.000+02:00</published><updated>2010-04-10T21:30:40.493+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>Error: Success...</title><content type='html'>&lt;h3&gt;Introduction&lt;/h3&gt;&lt;br /&gt;Just some days we rolled out another small tool for our clients which was in testing for nearly six months. Since we are a small company (with not so many clients) we always install complete new tools by ourselves on the client machines...just in case. We tried it, it worked, perfect.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;It wasn't me!&lt;/h4&gt;&lt;br /&gt;It worked perfectly, until the client called us that it didn't work. But, we use the .NET Framework for our new programs and the client just sent us the stacktrace of the exception *cool*...I stared unbelieving at it:&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;&lt;blockquote&gt;System.ComponentModel.Win32Exception: The operation completed successfully&lt;br /&gt;&lt;br /&gt;   at System.Windows.Forms.Form.UpdateLayered()&lt;br /&gt;   at System.Windows.Forms.Form.OnHandleCreated(EventArgs e)&lt;br /&gt;   at System.Windows.Forms.Control.WmCreate(Message&amp; m)&lt;br /&gt;   at System.Windows.Forms.Control.WndProc(Message&amp; m)&lt;br /&gt;   at System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)&lt;br /&gt;   at System.Windows.Forms.ContainerControl.WndProc(Message&amp; m)&lt;br /&gt;   at System.Windows.Forms.Form.WmCreate(Message&amp; m)&lt;br /&gt;   at System.Windows.Forms.Form.WndProc(Message&amp; m)&lt;br /&gt;   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message&amp; m)&lt;br /&gt;   at System.Windows.Forms.ControlNativeWindow.WndProc(Message&amp; m)&lt;br /&gt;   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32&lt;br /&gt;msg, IntPtr wparam, IntPtr lparam)&lt;/blockquote&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;"Okay, what's that?" It took me over half an hour to figure out that this was waaaaaay before my own code, and another half hour to figure out what that is...&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Reflector is telling me...nothing...&lt;/h4&gt;&lt;br /&gt;If you break down the Stacktrace and follow it with Reflector you'll end up here:&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;&lt;blockquote&gt;Private Sub UpdateLayered()&lt;br /&gt;    If (((Me.formState.Item(Form.FormStateLayered) &lt;&gt; 0) AndAlso&lt;br /&gt;MyBase.IsHandleCreated) AndAlso (Me.TopLevel AndAlso&lt;br /&gt;OSFeature.Feature.IsPresent(OSFeature.LayeredWindows))) Then&lt;br /&gt;        Dim flag As Boolean&lt;br /&gt;        Dim transparencyKey As Color = Me.TransparencyKey&lt;br /&gt;        If transparencyKey.IsEmpty Then&lt;br /&gt;            flag = UnsafeNativeMethods.SetLayeredWindowAttributes(New&lt;br /&gt;HandleRef(Me, MyBase.Handle), 0, Me.OpacityAsByte, 2)&lt;br /&gt;        ElseIf (Me.OpacityAsByte = &amp;HFF) Then&lt;br /&gt;            flag = UnsafeNativeMethods.SetLayeredWindowAttributes(New&lt;br /&gt;HandleRef(Me, MyBase.Handle), ColorTranslator.ToWin32(transparencyKey),&lt;br /&gt;0, 1)&lt;br /&gt;        Else&lt;br /&gt;            flag = UnsafeNativeMethods.SetLayeredWindowAttributes(New&lt;br /&gt;HandleRef(Me, MyBase.Handle), ColorTranslator.ToWin32(transparencyKey),&lt;br /&gt;Me.OpacityAsByte, 3)&lt;br /&gt;        End If&lt;br /&gt;        If Not flag Then&lt;br /&gt;            Throw New Win32Exception&lt;br /&gt;        End If&lt;br /&gt;    End If&lt;br /&gt;End Sub&lt;/blockquote&gt;&lt;/div&gt;&lt;br /&gt;I'm not using the transparency key so he has to fail at setting the window attributes...what the? You ever saw the .NET Framework failing to create a window? Nope, me neither...&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Third-Party&lt;/h4&gt;&lt;br /&gt;The answer to this riddle popped to my mind that moment I thought about how the program was called...we have a main DOS-Application which we are slowly enhancing and replacing with .NET programs, some of our clients have figured out how to start this program in fullscreen...and I mean the command fullscreen option. &lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Conclusion&lt;/h3&gt;&lt;br /&gt;For some reason (which I most likely never understand) fails the framework to create the window out of this fullscreen mode, but is able to minimize the command prompt and show the stacktrace window...whatever...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6195851387401894206-316339214310260283?l=bonsaimind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bonsaimind.blogspot.com/feeds/316339214310260283/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6195851387401894206&amp;postID=316339214310260283' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6195851387401894206/posts/default/316339214310260283'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6195851387401894206/posts/default/316339214310260283'/><link rel='alternate' type='text/html' href='http://bonsaimind.blogspot.com/2009/10/error-success.html' title='Error: Success...'/><author><name>Bobby</name><uri>http://www.blogger.com/profile/10412832420733396232</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6195851387401894206.post-4854301018485928454</id><published>2009-06-07T21:33:00.000+02:00</published><updated>2010-04-10T21:30:31.651+02:00</updated><title type='text'>.NET on a Network Share</title><content type='html'>Some programs don't need to be installed, for some programs it's sufficient to start from a network share. Unfortunately, by default it's forbidden to start a .NET program from a network share...this behavior was changed with 3.5 SP1, but at least for 2.0 exists e pretty simple command to allow this behavior, which needs to be executed on the client machine.&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;%WINDIR%\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -m -ag 1.2 -url file://yourserver/* FullTrust&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6195851387401894206-4854301018485928454?l=bonsaimind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bonsaimind.blogspot.com/feeds/4854301018485928454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6195851387401894206&amp;postID=4854301018485928454' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6195851387401894206/posts/default/4854301018485928454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6195851387401894206/posts/default/4854301018485928454'/><link rel='alternate' type='text/html' href='http://bonsaimind.blogspot.com/2009/06/net-on-network-share.html' title='.NET on a Network Share'/><author><name>Bobby</name><uri>http://www.blogger.com/profile/10412832420733396232</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6195851387401894206.post-1949841427232825286</id><published>2008-08-11T20:14:00.000+02:00</published><updated>2010-04-10T21:30:17.672+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ConnectionStrings'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><category scheme='http://www.blogger.com/atom/ns#' term='websites'/><title type='text'>Sites you should know</title><content type='html'>There are two sites you should really know.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.pinvoke.net" target="_blank"&gt;PInvoke:&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;PInvoke is an Wiki-like site which is a (nearly) complete documentation of the Win32 API. If you think about working with the API (which is sometimes pretty handy), then your first look should go to this site.&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.connectionstrings.com" target="_blank"&gt;Connection Strings:&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;All kind of different Connection Strings to databases and files. Starts at common strings like MySQL and ends in less common data sources like an Excel file.&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6195851387401894206-1949841427232825286?l=bonsaimind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bonsaimind.blogspot.com/feeds/1949841427232825286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6195851387401894206&amp;postID=1949841427232825286' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6195851387401894206/posts/default/1949841427232825286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6195851387401894206/posts/default/1949841427232825286'/><link rel='alternate' type='text/html' href='http://bonsaimind.blogspot.com/2008/08/sites-you-should-know.html' title='Sites you should know'/><author><name>Bobby</name><uri>http://www.blogger.com/profile/10412832420733396232</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
