|
-
Jul 17th, 2008, 11:57 AM
#1
Thread Starter
Hyperactive Member
[2008] Keep all components on same thread
Hello,
I am working on an application that uses several external references that all work together. I have a feeling that they are all launching on different threads preventing them from working together and communicating with each other. How can I either, make sure that they all initilize on the same thread or (even better) make sure they initilize on the same thread as my application, so that they can all communicate freely between each other and my application without causing cross thread exceptions (and other thread related problems)
Thanks!
~Ogmius
"I dont even see the code anymore... I just see Blonde, Brunette, Redhead..."
-
Jul 17th, 2008, 12:28 PM
#2
Re: [2008] Keep all components on same thread
I'm not sure you can do that. It's easy to create new objects from a single place from your code (and therefore on the same thread), but I don't think you can prevent one of the instantiated components from, say, creating a new working thread and doing its work there.
-
Jul 17th, 2008, 12:34 PM
#3
Thread Starter
Hyperactive Member
Re: [2008] Keep all components on same thread
is there a way to ensure that they can communicate freely between each other and with my application without doing cross threading?
"I dont even see the code anymore... I just see Blonde, Brunette, Redhead..."
-
Jul 17th, 2008, 12:36 PM
#4
Thread Starter
Hyperactive Member
Re: [2008] Keep all components on same thread
These are all COM objects btw not .net references
This application worked perfectly in VB6, now I am trying to port it to .net, but it seems that whenever the com object returns data back to my project, it gets lost somehow. I truly think this is a threading issue, I wish I could figure out how to fix this
"I dont even see the code anymore... I just see Blonde, Brunette, Redhead..."
-
Jul 17th, 2008, 12:40 PM
#5
Re: [2008] Keep all components on same thread
If it worked using VB6, it should work under .Net. Unfortunately without knowing what the components do it may be difficult to find an answer here. Still, you can give it a go. I think you'll need to post some working VB6 code (including any code that initializes and uses the COM component) along with the relevant .Net code.
Two quick questions though:
1. Can you contact the component provider for support?
2. Did you verify that the VB6 version works in the same PC that the VB.Net version doesn't?
-
Jul 17th, 2008, 01:41 PM
#6
Thread Starter
Hyperactive Member
Re: [2008] Keep all components on same thread
 Originally Posted by ntg
If it worked using VB6, it should work under .Net. Unfortunately without knowing what the components do it may be difficult to find an answer here. Still, you can give it a go. I think you'll need to post some working VB6 code (including any code that initializes and uses the COM component) along with the relevant .Net code.
Two quick questions though:
1. Can you contact the component provider for support?
2. Did you verify that the VB6 version works in the same PC that the VB.Net version doesn't?
1. Unfortunately I cannot, the way I am going about using their COM objects is not exactly "Supported"
2. Yes, the vb6 application works perfectly fine 100% on this box As a matter of fact the code is identical except for some extremely minor changes to make it conform to .net (i.e. label.text instead of label.caption nothing that changes how the COM objects load)
"I dont even see the code anymore... I just see Blonde, Brunette, Redhead..."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|