Results 1 to 6 of 6

Thread: [2008] Keep all components on same thread

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2003
    Location
    Manchester, CT
    Posts
    317

    [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..."

  2. #2
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    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.
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2003
    Location
    Manchester, CT
    Posts
    317

    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..."

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2003
    Location
    Manchester, CT
    Posts
    317

    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..."

  5. #5
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    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?
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2003
    Location
    Manchester, CT
    Posts
    317

    Re: [2008] Keep all components on same thread

    Quote 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
  •  



Click Here to Expand Forum to Full Width