Wrox Programmer Forums
|
BOOK: WPF Programmer's Reference: Windows Presentation Foundation with C# 2010 and .NET 4
This is the forum to discuss the Wrox book WPF Programmer's Reference: Windows Presentation Foundation with C# 2010 and .NET 4 by ; ISBN: 9780470477229
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: WPF Programmer's Reference: Windows Presentation Foundation with C# 2010 and .NET 4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 8th, 2010, 04:59 PM
Registered User
 
Join Date: Apr 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default STA COM with WPF

Hello,

Seems like i'm the first one to post... fine by me.

I'm getting my feet wet with the WPF forms and I got your book to help me through.

Of course i've run into some problems, so i'd like to see if anyone here can provide some insight.

I have some legacy code (dll) written in VB6 that i need to use in order to format data properly that will eventually be displayed in a grid on a WPF form.

The initial "viewable" portions (rows) of the grid are rendered (they are processed, i.e., much massaging going on for each column). Because the special processing of the data for the columns can take time, i want to use a separate background thread to continue rendering the data (not-currently visible), for use by the grid when the user scrolls down. I also need all the data available as quickly as possible in the event that use decides to do actions on that grid... such as sorting on a column, or moving the position of a column around in the grid (more for the former than the latter).

Now it seems i'm running into threading problems. I don't know if it is a problem because of the COM or not. I know the COM is STA, and the WPF forms are all STA, but is that what the problem is? Or is the fact that the grid resides on the first WPF form's thread, and i'm trying to use a 'new' connection on the second background thread to grab my data.

Or can you straighten me out on what is possible to hasten up the data processing of a grid, using threads? I might be totally off base...

I don't see that your book covers background threads, but I've seen them in use else where and trying them out.

Best Regards,
Thierry
 
Old April 14th, 2010, 11:31 AM
Registered User
 
Join Date: Apr 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hmmm now i see why no one posts here...
 
Old April 14th, 2010, 03:45 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default Hmm...

Well, it could be that there aren't many subscribers. It's a fairly new forum.

It could also be that no one who's listening has an answer. I know I don't and I haven't had any spare time to dig into it. I havn't used threads much in WPF yet.

You might try invoking back to the main thread. That's the sort of thing that might solve this kind of problem in Windows Forms, but in Windows Forms if it didn't like you it would just crash and at least you'd have some symptoms to start with.

What is it doing for you? Is it working slowly, dropping values, or crashing?

Sorry I don't have a better answer but when I have a chance (next week?) I'll try to take a closer look.

Rod
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)





Similar Threads
Thread Thread Starter Forum Replies Last Post
WCF/WPF ashish_26 ASP.NET 3.5 Professionals 0 August 6th, 2009 05:41 AM
wpf+c#(kind help) vinothkumar124 Windows Presentation Foundation 0 December 16th, 2008 08:06 AM
Formless class is MTA rather than STA, how do I ma mike1reynolds VB How-To 0 April 18th, 2008 03:17 PM
wpf/e in asp.net mitjac ASP.NET 2.0 Professional 0 March 28th, 2007 05:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.