Windows Vista Forums

Change in rc1, code no longer working

  1. #1


    Griff Guest

    Change in rc1, code no longer working

    I found another bit of simple code that worked in Beta 2 but not in rc1


    c#

    public partial class Window1 : System.Windows.Window
    {
    public Window1()
    {
    InitializeComponent();
    Image im = new Image();
    String filePath = @"c:\Program Files\Icons\sketch.JPG";
    im.Source = (ImageSource)((new
    ImageSourceConverter()).ConvertFromString(filePath));
    MyGrid.Children.Add(im);
    }
    }



    Whereas before this worked OK, it now causes Win32 Exception, but not when
    the code above actually runs. It is specifically when the Image (or
    something containing it) is first made visible and it gets rendered.

    Any suggestions anyone ?



    --
    Griff
    (trying to make an industrial UI with XAML/WPF/c#)

      My System SpecsSystem Spec

  2. #2


    Douglas Stockwell Guest

    Re: Change in rc1, code no longer working

    I can't seem to reproduce that. It doesn't raise an exception for me.

    - Doug

    "Griff" <Griff@discussions.microsoft.com> wrote in message
    news:13262D20-D5C4-4233-BDE8-4A8D0B2060A7@microsoft.com...
    >I found another bit of simple code that worked in Beta 2 but not in rc1
    >
    >
    > c#
    >
    > public partial class Window1 : System.Windows.Window
    > {
    > public Window1()
    > {
    > InitializeComponent();
    > Image im = new Image();
    > String filePath = @"c:\Program Files\Icons\sketch.JPG";
    > im.Source = (ImageSource)((new
    > ImageSourceConverter()).ConvertFromString(filePath));
    > MyGrid.Children.Add(im);
    > }
    > }
    >
    > Whereas before this worked OK, it now causes Win32 Exception, but not when
    > the code above actually runs. It is specifically when the Image (or
    > something containing it) is first made visible and it gets rendered.
    >
    > Any suggestions anyone ?
    >
    >
    >
    > --
    > Griff
    > (trying to make an industrial UI with XAML/WPF/c#)



      My System SpecsSystem Spec

  3. #3


    Griff Guest

    Re: Change in rc1, code no longer working

    I guess your installation must be different to mine then.

    Maybe mine's not "clean"...

    Are there any known issues with installing rc1 after previous versions ? I
    did a control panels uninstall of all the WinFX components from Beta 2, then
    installed 3.0 from scratch.

    When I drill right down with debugger I end up with a write to unauthorised
    memory somewhere in a DLL called something like WindowsCodecs.

    Any suggestions as to where to look ?


    --
    Griff
    (trying to make an industrial UI with XAML/WPF/c#)


    "Douglas Stockwell" wrote:

    > I can't seem to reproduce that. It doesn't raise an exception for me.
    >
    > - Doug
    >
    > "Griff" <Griff@discussions.microsoft.com> wrote in message
    > news:13262D20-D5C4-4233-BDE8-4A8D0B2060A7@microsoft.com...
    > >I found another bit of simple code that worked in Beta 2 but not in rc1
    > >
    > >
    > > c#
    > >
    > > public partial class Window1 : System.Windows.Window
    > > {
    > > public Window1()
    > > {
    > > InitializeComponent();
    > > Image im = new Image();
    > > String filePath = @"c:\Program Files\Icons\sketch.JPG";
    > > im.Source = (ImageSource)((new
    > > ImageSourceConverter()).ConvertFromString(filePath));
    > > MyGrid.Children.Add(im);
    > > }
    > > }
    > >
    > > Whereas before this worked OK, it now causes Win32 Exception, but not when
    > > the code above actually runs. It is specifically when the Image (or
    > > something containing it) is first made visible and it gets rendered.
    > >
    > > Any suggestions anyone ?
    > >
    > >
    > >
    > > --
    > > Griff
    > > (trying to make an industrial UI with XAML/WPF/c#)

    >


      My System SpecsSystem Spec

  4. #4


    Griff Guest

    Re: Change in rc1, code no longer working

    Thanks to Doug's hint that it was my installation at fault, I found and fixed
    the problem.

    My WIC (Windows Imaging Component) files and somehow ended up as the wrong
    version with all the CTP's I'd had installed.

    Found Robert A. Wlodarczyk's Blog (MSFT) with the fix outlined.
    http://blogs.msdn.com/rwlodarc/archi...25/607131.aspx

    (It refers to beta 2 but the same fix works for 3.0 rc1).

    All working again.


    --
    Griff
    (trying to make an industrial UI with XAML/WPF/c#)


    "Griff" wrote:

    > I guess your installation must be different to mine then.
    >
    > Maybe mine's not "clean"...
    >
    > Are there any known issues with installing rc1 after previous versions ? I
    > did a control panels uninstall of all the WinFX components from Beta 2, then
    > installed 3.0 from scratch.
    >
    > When I drill right down with debugger I end up with a write to unauthorised
    > memory somewhere in a DLL called something like WindowsCodecs.
    >
    > Any suggestions as to where to look ?
    >
    >
    > --
    > Griff
    > (trying to make an industrial UI with XAML/WPF/c#)
    >
    >
    > "Douglas Stockwell" wrote:
    >
    > > I can't seem to reproduce that. It doesn't raise an exception for me.
    > >
    > > - Doug
    > >
    > > "Griff" <Griff@discussions.microsoft.com> wrote in message
    > > news:13262D20-D5C4-4233-BDE8-4A8D0B2060A7@microsoft.com...
    > > >I found another bit of simple code that worked in Beta 2 but not in rc1
    > > >
    > > >
    > > > c#
    > > >
    > > > public partial class Window1 : System.Windows.Window
    > > > {
    > > > public Window1()
    > > > {
    > > > InitializeComponent();
    > > > Image im = new Image();
    > > > String filePath = @"c:\Program Files\Icons\sketch.JPG";
    > > > im.Source = (ImageSource)((new
    > > > ImageSourceConverter()).ConvertFromString(filePath));
    > > > MyGrid.Children.Add(im);
    > > > }
    > > > }
    > > >
    > > > Whereas before this worked OK, it now causes Win32 Exception, but not when
    > > > the code above actually runs. It is specifically when the Image (or
    > > > something containing it) is first made visible and it gets rendered.
    > > >
    > > > Any suggestions anyone ?
    > > >
    > > >
    > > >
    > > > --
    > > > Griff
    > > > (trying to make an industrial UI with XAML/WPF/c#)

    > >


      My System SpecsSystem Spec

Change in rc1, code no longer working

Similar Threads
Thread Thread Starter Forum Replies Last Post
Power Management no longer allowing me to change display brightnes Shiroinohi Vista performance & maintenance 18 12 May 2008
USB no longer working mrinventions General Discussion 0 01 Mar 2008
DVD drive no longer working Shaw Vista hardware & devices 2 05 Jul 2007
wmp and wmc no longer working snewton62 Vista music pictures video 4 04 May 2007
USB no longer working darthsabre Vista hardware & devices 1 09 Mar 2007