Click here to Skip to main content
15,891,033 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: binding one listview to two observablecollections Pin
Abhinav S29-Jan-12 19:03
Abhinav S29-Jan-12 19:03 
QuestionLoad/Save WPF application settings Pin
Praveen Raghuvanshi27-Jan-12 7:32
professionalPraveen Raghuvanshi27-Jan-12 7:32 
AnswerRe: Load/Save WPF application settings Pin
SledgeHammer0127-Jan-12 9:31
SledgeHammer0127-Jan-12 9:31 
GeneralRe: Load/Save WPF application settings Pin
Praveen Raghuvanshi30-Jan-12 6:26
professionalPraveen Raghuvanshi30-Jan-12 6:26 
GeneralRe: Load/Save WPF application settings Pin
SledgeHammer0130-Jan-12 7:00
SledgeHammer0130-Jan-12 7:00 
AnswerRe: Load/Save WPF application settings Pin
Abhinav S28-Jan-12 22:06
Abhinav S28-Jan-12 22:06 
GeneralRe: Load/Save WPF application settings Pin
Praveen Raghuvanshi30-Jan-12 6:27
professionalPraveen Raghuvanshi30-Jan-12 6:27 
QuestionCalling WPF window from VB6 Pin
BRShroyer26-Jan-12 8:52
BRShroyer26-Jan-12 8:52 
[EDITED: removed extra backslash from first example. It was copy/paste error]
I am trying to open a WPF window from VB6. I have a .NET 4.0 dll that has four WPF windows and several C# classes in it. Three of the WPF windows open without any errors. The fourth keeps giving me "Run-time error '-2146233087 (80131501)': Automation Error" when InitializeComponents() is called.

I believe it has something to do with what is in the XAML code. Here is an abridged version of what is in the windows that work:
HTML
<Window>
  <Grid>
    <CustomTextBox />
    <CustomTextBox />
    <Label />
    <Label />
  </Grid>
</Window>


The three windows using the above format have one method, ShowWindow(), exposed so I can display it from VB6 (no comments about I could have overridden the Show() or ShowDialog() methods please).

Here is the XAML for the window that is not working:
HTML
<Window>
  <Window.Resources>
    <XmlDataProvider x:Key="configdata"/>
    <XmlDataProvider x:Key="servodata"/>
  </Window.Resources>
  <Grid>
    <TabControl>
      <TabItem>
        <Grid>
        <ScrollViewer>
          <TabControl ItemsSource="{Binding Source={StaticResource configdata}, XPath=PROGRAM/CONFIG_PAGE}">
              <TabControl.ItemTemplate>
                <DataTemplate>
                  <TextBlock Text="{Binding XPath=@page_title}"/>
                </DataTemplate>
              </TabControl.ItemTemplate>
              <TabControl.ContentTemplate>
                <DataTemplate>
                  <toolkit:DataGrid ItemsSource="{Binding XPath=DATA}">
                    <toolkit:DataGrid.Columns>
                      <toolkit:DataGridTextColumn Binding="{Binding XPath=DESCRIPTION}"/>
                      <toolkit:DataGridTextColumn Binding="{Binding XPath=VALUE}"/>
                    </toolkit:DataGrid.Columns>
                  </toolkit:DataGrid>
                </DataTemplate>
              </TabControl.ContentTemplate>
            </TabControl>
          </ScrollViewer>
        </Grid>
      </TabItem>
      <TabItem>
        <Grid>
          <TabControl>
            <TabItem>
              <Grid>
                <toolkit:DataGrid ItemsSource="{Binding Source={StaticResource configdata}, XPath=IO/Inputs/Input}">
                  <toolkit:DataGrid.Columns>
                    <toolkit:DataGridTextColumn Binding="{Binding XPath=DESCRIPTION}"/>
                    <toolkit:DataGridTextColumn Binding="{Binding XPath=VALUE}"/>
                    <toolkit:DataGridTextColumn Binding="{Binding XPath=METRIC_VALUE}"/>
                  </toolkit:DataGrid.Columns>
                </toolkit:DataGrid>
              </Grid>
            </TabItem>
            <TabItem>
              <Grid>
                <toolkit:DataGrid ItemsSource="{Binding Source={StaticResource configdata}, XPath=IO/Outputs/Output}">
                  <toolkit:DataGrid.Columns>
                    <toolkit:DataGridTextColumn Binding="{Binding XPath=DESCRIPTION}"/>
                    <toolkit:DataGridTextColumn Binding="{Binding XPath=VALUE}"/>
                    <toolkit:DataGridTextColumn Binding="{Binding XPath=METRIC_VALUE}"/>
                  </toolkit:DataGrid.Columns>
                </toolkit:DataGrid>
              </Grid>
            </TabItem>
          </TabControl>
        </Grid>
      </TabItem>
      <TabItem>
    	<Grid>
          <toolkit:DataGrid ItemsSource="{Binding Source={StaticResource servodata}, XPath=DATA}">
            <toolkit:DataGrid.Columns>
              <toolkit:DataGridTextColumn Binding="{Binding XPath=DESCRIPTION}"/>
              <toolkit:DataGridTextColumn Binding="{Binding XPath=VALUE}"/>
              <toolkit:DataGridTextColumn Binding="{Binding XPath=METRIC_VALUE}"/>
            </toolkit:DataGrid.Columns>
          </toolkit:DataGrid>
        </Grid>
      </TabItem>
    </TabControl>
    <Button/>
    <Button />
  </Grid>
</Window>


The Interface for this window has the same ShowWindow() method plus a boolean property exposed.

I have a tester app with this dll to show the windows and make sure they work before putting them on the VB6 machine. I have ran it on the VB6 machine and the big window works fine. It accesses the XML files it needs to, writes to them, reads from the registry. It all works fine.

I have been working on this for 3 days now and cannot figure out what is wrong. Originally none of the windows would work, but I figured out that my regasm command line was missing the /tlb option. Again, all the other windows work fine and this one works when opened with the tester executable, just not the VB6 executable.

Any help is appreciated.
Brad

Deja Moo - When you feel like you've heard the same bull before.


modified 27-Jan-12 14:43pm.

AnswerRe: Calling WPF window from VB6 Pin
Alisaunder27-Jan-12 7:59
Alisaunder27-Jan-12 7:59 
GeneralRe: Calling WPF window from VB6 Pin
BRShroyer27-Jan-12 8:42
BRShroyer27-Jan-12 8:42 
GeneralRe: Calling WPF window from VB6 Pin
SledgeHammer0127-Jan-12 9:26
SledgeHammer0127-Jan-12 9:26 
GeneralRe: Calling WPF window from VB6 Pin
BRShroyer29-Jan-12 16:46
BRShroyer29-Jan-12 16:46 
QuestionWhy explicit Style defined in a theme Which had been applied for one control aren't update when change the Theme ?. Pin
jecaestevez25-Jan-12 7:09
jecaestevez25-Jan-12 7:09 
QuestionCould not load type 'System.Windows.Controls.VirtualizingPanel' from assembly 'System.Windows, Version=2.0.5.0 Pin
NTheOne24-Jan-12 23:09
NTheOne24-Jan-12 23:09 
AnswerRe: Could not load type 'System.Windows.Controls.VirtualizingPanel' from assembly 'System.Windows, Version=2.0.5.0 Pin
Abhinav S25-Jan-12 0:42
Abhinav S25-Jan-12 0:42 
RantMVVM Blues... Pin
Tom Delany24-Jan-12 11:06
Tom Delany24-Jan-12 11:06 
GeneralRe: MVVM Blues... Pin
Wes Aday24-Jan-12 11:09
professionalWes Aday24-Jan-12 11:09 
GeneralRe: MVVM Blues... Pin
Pete O'Hanlon24-Jan-12 11:25
mvePete O'Hanlon24-Jan-12 11:25 
GeneralRe: MVVM Blues... Pin
Tom Delany25-Jan-12 3:31
Tom Delany25-Jan-12 3:31 
GeneralRe: MVVM Blues... Pin
Pete O'Hanlon25-Jan-12 3:46
mvePete O'Hanlon25-Jan-12 3:46 
GeneralRe: MVVM Blues... Pin
SledgeHammer0125-Jan-12 5:04
SledgeHammer0125-Jan-12 5:04 
GeneralRe: MVVM Blues... Pin
Pete O'Hanlon25-Jan-12 5:33
mvePete O'Hanlon25-Jan-12 5:33 
GeneralRe: MVVM Blues... Pin
SledgeHammer0125-Jan-12 8:05
SledgeHammer0125-Jan-12 8:05 
GeneralRe: MVVM Blues... Pin
Pete O'Hanlon25-Jan-12 8:15
mvePete O'Hanlon25-Jan-12 8:15 
GeneralRe: MVVM Blues... Pin
SledgeHammer0125-Jan-12 13:31
SledgeHammer0125-Jan-12 13:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.