EXCEPTION: Object reference not set to an instance of an obj
4 posts
• Page 1 of 1
EXCEPTION: Object reference not set to an instance of an obj
If you define the variable 'xaml' with the following in a )CLEAR WS:
And then if you execute the following:
You will get the following error:
but if you type again in the session rootObj.Show it will work.
Question: Why it did not work the first time ?
Thanks in advance,
Pierre Gilbert
- Code: Select all
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
Title="MainWindow"
Height="350"
Width="525">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="167*"/>
<RowDefinition Height="153*"/>
</Grid.RowDefinitions>
<syncfusion:SfMaskedEdit HorizontalAlignment="Left" Margin="32,69,0,68" Text="SfMaskedEdit" Width="100"/>
<syncfusion:DoubleTextBox HorizontalAlignment="Left" Margin="32,66,0,0" Grid.Row="1" Value="0" Width="100"/>
</Grid>
</Window>
And then if you execute the following:
- Code: Select all
⎕USING←'' 'System.IO' 'System.Xml,system.xml.dll'
⎕USING,←'System.Windows,WPF/PresentationFramework.dll' 'System.Windows.Markup'
⎕USING,←⊂'Syncfusion.Windows.Controls.Input,Syncfusion/4.5/Syncfusion.SfInput.WPF.dll'
⎕USING,←⊂',Syncfusion/4.5/Syncfusion.SfShared.Wpf.dll'
⎕USING,←⊂'Syncfusion.Windows.Shared,Syncfusion/4.5/Syncfusion.Shared.WPF.dll'
rootObj←XamlReader.Load ⎕NEW XmlTextReader(⎕NEW StringReader(⊂xaml))
rootObj.Show
You will get the following error:
- Code: Select all
rootObj.Show
EXCEPTION: Object reference not set to an instance of an object.
rootObj.Show
∧
but if you type again in the session rootObj.Show it will work.
Question: Why it did not work the first time ?
Thanks in advance,
Pierre Gilbert
-
PGilbert - Posts: 440
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
Re: EXCEPTION: Object reference not set to an instance of an
Hi Pierre,
I can reproduce this odd behaviour and I've logged it as 12732.
We will investigate.
Regards,
Vince
I can reproduce this odd behaviour and I've logged it as 12732.
We will investigate.
Regards,
Vince
- Vince|Dyalog
- Posts: 433
- Joined: Wed Oct 01, 2008 9:39 am
Re: EXCEPTION: Object reference not set to an instance of an
Thanks Vince, looking more into it I realized that the SfMaskedEdit is not working at all and is probably the culprit giving us this problem.
-
PGilbert - Posts: 440
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
Re: EXCEPTION: Object reference not set to an instance of an
Following a discussion with Morten I have tried the following and now it is working:
Looks like some of the Syncfusion controls are expecting to run under an 'Application' object instead of the methods .Show or .ShowDialog
I cannot add some .Resources to the 'Application' object but that will be the subject of another thread.
Thanks Morten
- Code: Select all
⎕USING←'' 'System.IO' 'System.Xml,system.xml.dll'
⎕USING,←'System.Windows,WPF/PresentationFramework.dll' 'System.Windows.Markup'
⎕USING,←⊂'Syncfusion.Windows.Controls.Input,Syncfusion/4.5/Syncfusion.SfInput.WPF.dll'
⎕USING,←⊂',Syncfusion/4.5/Syncfusion.SfShared.Wpf.dll'
⎕USING,←⊂'Syncfusion.Windows.Shared,Syncfusion/4.5/Syncfusion.Shared.WPF.dll'
rootObj←XamlReader.Load ⎕NEW XmlTextReader(⎕NEW StringReader(⊂xaml))
app←⎕NEW Application
{}app.Run rootObj
Looks like some of the Syncfusion controls are expecting to run under an 'Application' object instead of the methods .Show or .ShowDialog
I cannot add some .Resources to the 'Application' object but that will be the subject of another thread.
Thanks Morten
-
PGilbert - Posts: 440
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group