500 points - An invisible thread in VB.Net!!

Posted on 2005-04-28
Last Modified: 2012-06-21
Ok, i've been working on this all day so someone please help me figure this out!

I have a program that needs to pull a load of info from Outlook, because everytime i access something like contacts or addresses the outlook security warning pops up. So, i look at a few microsoft articles and write myself a 'shared Addin' project.

This basically kicks of an event everytime Outlook starts, passing through the Application object, which in theory should be security warnings free...

The only problem is, that when i pass the application to my main program (another Class project) then it seems to go 'under' the Vb.Net debugger. i.e. none of the breakpoints catch the thread, but if i put a msgbox in the way of the thread, that will show!

I also tried to invoke the UI thread by calling the main application form which is shared in another project, and although it exists in the 'debugged' thread... it is empty in the thread that it's been passed to!

How can i get that application object to the currently running instance of my program?

Question by:Cloud9_User

    Author Comment

    Also.... shared variables (that in my understanding) were meant to be available in ANY instance of a Class are returning blank in the instance from Outlook! even if i've set them earlier in another instance.
    LVL 13

    Accepted Solution

    I don't know if it would be acceptable in your situation but for some in house apps I got around the Outlook Dialogs by using Context Magic's Click Yes Program.  It is a utility that sits in the system try and can be turned on and off programatically.  When turned on it watches for these 2 outlook dialogs and clicks yes no waiting as soon as the dialogs are shown they go away.  You do see 2 quick flashes of the dialogs but it isn't much of an interuption. they have examples on how to implement it and everything.  I think it works quite well.


    (I know this doesn't really answer your question just a means to an end.)

    As far as your actual question the debugger attaches to the main thread but I think you may have to manually attach it to subsequent threads, though I'm not sure about that.

    Author Comment

    Thanks for the reply...

    I think thats going to be the agreed method when i distribute the proggy....

    It doesn't answer the question but your the only one that took the time out to try... enjoy the points :)

    LVL 13

    Expert Comment

    Thanks for the points, I just wish I had a better answer for you.

    Author Comment

    Nah its ok... after two days i gave up on it

    I'll have to go back to that one once everything else is finished :)

    Thanks anyhow

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now