﻿<?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?)  » Error in the SF Login Form Template</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 11 Sep 2026 11:08:53 GMT</lastBuildDate><ttl>20</ttl><item><title>Error in the SF Login Form Template</title><link>http://forum.strataframe.net/FindPost9528.aspx</link><description>After to add&amp;nbsp;SF Login Form&amp;nbsp;in the my project (C#), the constructor is not being invoked. I included the code below to decide the problem.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; LoginForm1()&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;InitializeComponent();&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Fri, 15 Jun 2007 09:40:50 GMT</pubDate><dc:creator>Rogerio Mauri</dc:creator></item><item><title>RE: Error in the SF Login Form Template</title><link>http://forum.strataframe.net/FindPost9615.aspx</link><description>We'll look into this to see if we can replicate the behavior.&amp;nbsp; Thanks. :)</description><pubDate>Fri, 15 Jun 2007 09:40:50 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Error in the SF Login Form Template</title><link>http://forum.strataframe.net/FindPost9608.aspx</link><description>Hi Trent.&lt;/P&gt;&lt;P&gt;Rogerio is saying that he gets a NullReferenceException only when he uses the C# Login Form template, whereas if he does the same with the VB.NET version, it works fine. Would you have any guess?</description><pubDate>Thu, 14 Jun 2007 21:35:54 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Error in the SF Login Form Template</title><link>http://forum.strataframe.net/FindPost9605.aspx</link><description>Ivan... Uma correção no texto&lt;/P&gt;&lt;P&gt;"... e para VB.NET, não." &lt;/P&gt;&lt;P&gt;Trent...&lt;/P&gt;&lt;P&gt;We are in understanding. Ivan will be able later registering a summary of the dialogue.:)</description><pubDate>Thu, 14 Jun 2007 20:03:27 GMT</pubDate><dc:creator>Rogerio Mauri</dc:creator></item><item><title>RE: Error in the SF Login Form Template</title><link>http://forum.strataframe.net/FindPost9604.aspx</link><description>Olá Ivan...&lt;/P&gt;&lt;P&gt;Sim... Segui o passo-a-passo.&lt;/P&gt;&lt;P&gt;O problema pode estar na sintaxe. Você está utilizando VB.NET e eu estou utilizando C#.&lt;/P&gt;&lt;P&gt;O erro pode estar acontecendo quando o templante gera para C# e&amp;nbsp;para VB.NET.</description><pubDate>Thu, 14 Jun 2007 19:59:13 GMT</pubDate><dc:creator>Rogerio Mauri</dc:creator></item><item><title>RE: Error in the SF Login Form Template</title><link>http://forum.strataframe.net/FindPost9573.aspx</link><description>Considering my Portuguese is a little rusty :D, let me know if I can help :)</description><pubDate>Thu, 14 Jun 2007 09:16:54 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Error in the SF Login Form Template</title><link>http://forum.strataframe.net/FindPost9562.aspx</link><description>Você chegou a seguir os passos do Help? Em "Adding Security to an Application" tem um passo-a-passo, inclusive mencionando o uso de criar seu "login form", tem um link em "create a login form" .&lt;/P&gt;&lt;P&gt;Só para você dar uma olhada, aqui vai o login form de uma aplicação minha.&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/5e572436-30f7-4b51-aa0d-52e6.png"&gt;&lt;/P&gt;&lt;P&gt;Você pode reparar que é um login form customizado. Eu não criei nada em código para isto. Simplesmente criei um novo Login Form baseado no template que vem com o SF e traduzi algumas strings no código deste form.&lt;/P&gt;&lt;P&gt;Então, fui no AppMain.vb (no meu caso, no seu, Program.cs, como o Ben te falou) e fiz a mudança necessária no nome do form para login.&lt;/P&gt;&lt;P&gt;Se ainda não te ajudar aí, vai falando, que a gente faz funcionar juntos.&lt;/P&gt;&lt;FONT size=1&gt;&lt;P&gt;&lt;/FONT&gt;&amp;nbsp;</description><pubDate>Wed, 13 Jun 2007 22:43:31 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Error in the SF Login Form Template</title><link>http://forum.strataframe.net/FindPost9556.aspx</link><description>Ivan... Boa Noite...&lt;P&gt;Sim. O erro continua. O que&amp;nbsp;notei é que o SF Login Form customizado não faz uma chamada explícita ao método de&amp;nbsp;inicialização dos componentes do &lt;EM&gt;form&lt;/EM&gt; (&lt;STRONG&gt;InitializeComponent()&lt;/STRONG&gt;). Consequentemente quando as propriedades dos&amp;nbsp;objetos são inicializadas (&lt;STRONG&gt;set&lt;/STRONG&gt;) ocorre&amp;nbsp;o erro NullReferenceException. O erro ocorre aqui:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color=#0000ff&gt;bool&lt;/FONT&gt; &lt;FONT color=#2b91af&gt;ILoginForm&lt;/FONT&gt;.AllowAppExit&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get &lt;/EM&gt;&lt;/FONT&gt;&lt;EM&gt;{ &lt;FONT color=#0000ff&gt;return&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;this&lt;/FONT&gt;.cmdExit.Visible; }&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&lt;/EM&gt;&lt;/FONT&gt;&lt;EM&gt;{ &lt;FONT style="BACKGROUND-COLOR: #ffff11"&gt;&lt;FONT color=#0000ff&gt;this&lt;/FONT&gt;.&lt;FONT color=#dd1111&gt;&lt;STRONG&gt;cmdExit.&lt;/STRONG&gt;&lt;FONT color=#5555bb&gt;Visible&lt;/FONT&gt;&lt;/FONT&gt; = &lt;FONT color=#0000ff&gt;value&lt;/FONT&gt;;&lt;/FONT&gt; }&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Se no Form Login você incluir o método construtor da classe com a chamada ao InitializeComponent o erro não ocorre mais:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;partial&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;FormLogin&lt;/FONT&gt;&lt;FONT size=2&gt; : &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ILoginForm&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff11" color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff11"&gt; FormLogin()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff11"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff11"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff11"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Obrigado pelo suporte em português. Deixo com você a tradução para nossos amigos dos EUA.&lt;/P&gt;&lt;P&gt;OBS: Estou com a versão&amp;nbsp;de avaliação do SF (1.6.0), baixada do site.&lt;/P&gt;&lt;P&gt;Abraços...&lt;/P&gt;&lt;P&gt;Rogério Mauri (Licitec Software - Brazil)&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Wed, 13 Jun 2007 21:18:36 GMT</pubDate><dc:creator>Rogerio Mauri</dc:creator></item><item><title>RE: Error in the SF Login Form Template</title><link>http://forum.strataframe.net/FindPost9549.aspx</link><description>Hi Rogerio.&lt;/P&gt;&lt;P&gt;When you say the "error continues", do you mean you get an error message? If so, you could&amp;nbsp;copy it and post here.</description><pubDate>Wed, 13 Jun 2007 17:10:19 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Error in the SF Login Form Template</title><link>http://forum.strataframe.net/FindPost9544.aspx</link><description>Ben.. Tks for your reply, but the error continues, therefore I already had followed the recommendation with template of the application with the security module.&lt;/P&gt;&lt;P&gt;&lt;FONT size=1&gt;&lt;EM&gt;&lt;FONT color=#0000ff&gt;private&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;static&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;void&lt;/FONT&gt; ShowLoginAndInitMainForm(&lt;FONT color=#2b91af&gt;ShowLoginAndInitFormEventArgs&lt;/FONT&gt; e)&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=1&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#008000&gt;&lt;FONT size=1&gt;&lt;EM&gt;//-- Set the login form to your custom login form (optional)&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT size=1&gt;&lt;EM&gt;&lt;FONT color=#2b91af&gt;Login&lt;/FONT&gt;.LoginFormType = &lt;FONT color=#0000ff&gt;typeof&lt;/FONT&gt;(&lt;FONT color=#2b91af&gt;FormLogin&lt;/FONT&gt;);&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#008000&gt;&lt;FONT size=1&gt;&lt;EM&gt;//-- Show the login form and authenticate the user&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT size=1&gt;&lt;EM&gt;e.ShowMainForm = &lt;FONT color=#2b91af&gt;Login&lt;/FONT&gt;.ShowLoginAndAuthUser(&lt;FONT color=#0000ff&gt;true&lt;/FONT&gt;);&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=1&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/FONT&gt;</description><pubDate>Wed, 13 Jun 2007 11:12:12 GMT</pubDate><dc:creator>Rogerio Mauri</dc:creator></item><item><title>RE: Error in the SF Login Form Template</title><link>http://forum.strataframe.net/FindPost9533.aspx</link><description>If you want to show a custom login form, you will need to set the form type within the ShowLoginAndInitMainForm() method in the Program.cs file like this:&lt;/P&gt;&lt;FONT color=#0000ff size=1&gt;&lt;P&gt;private&lt;/FONT&gt;&lt;FONT color=#000000 size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;static&lt;/FONT&gt;&lt;FONT color=#000000 size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;void&lt;/FONT&gt;&lt;FONT color=#000000 size=1&gt; ShowLoginAndInitMainForm(&lt;/FONT&gt;&lt;FONT color=#2b91af size=1&gt;ShowLoginAndInitFormEventArgs&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT color=#000000&gt; e)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=1&gt;//-- Set the login form to your custom login form (optional)&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=1&gt;Login&lt;/FONT&gt;&lt;FONT size=1&gt;.LoginFormType = &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;typeof&lt;/FONT&gt;&lt;FONT size=1&gt;(MyLoginForm);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=1&gt;//-- Show the login form and authenticate the user&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;P&gt;e.ShowMainForm = &lt;/FONT&gt;&lt;FONT color=#2b91af size=1&gt;Login&lt;/FONT&gt;&lt;FONT size=1&gt;.ShowLoginAndAuthUser(&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;true&lt;/FONT&gt;&lt;FONT size=1&gt;);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Wed, 13 Jun 2007 08:41:14 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>