Click here to Skip to main content
16,007,885 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Dynamic Tab pages and Streamwriter Pin
Icharus2-Sep-05 5:21
Icharus2-Sep-05 5:21 
GeneralRe: Dynamic Tab pages and Streamwriter Pin
Taen_Karth2-Sep-05 6:10
Taen_Karth2-Sep-05 6:10 
GeneralRe: Dynamic Tab pages and Streamwriter Pin
Icharus2-Sep-05 6:34
Icharus2-Sep-05 6:34 
QuestionShowDialog Bug Pin
Icharus31-Aug-05 12:22
Icharus31-Aug-05 12:22 
QuestionQuick Syntax Question Pin
daviiie31-Aug-05 10:15
daviiie31-Aug-05 10:15 
AnswerRe: Quick Syntax Question Pin
ToddHileHoffer31-Aug-05 10:34
ToddHileHoffer31-Aug-05 10:34 
AnswerRe: Quick Syntax Question Pin
Icharus31-Aug-05 12:55
Icharus31-Aug-05 12:55 
QuestionWindows Service and Outlook Pin
FeejayFred31-Aug-05 8:31
FeejayFred31-Aug-05 8:31 
I need some guidance regarding a Windows Service Application and MS-Outlook 2000 type library (msoutl9.olb)

My service app needs to scan an outlook inbox at regular intervals and process incoming email messages. My problem is that the application is unable to create the instance of the Outlook.ApplicationClass() object.

The app has the proper installers and has been installed to run on the local machind under the LocalSystem account.

The Outlook application and namespaces are declared at the beginning of the class definition:

Protected Friend olApp As Outlook.ApplicationClass<br />
Protected Friend olNS As Outlook.NameSpace


I attempt to start the Outlook instance in my service's OnStart() event:

    Protected Overrides Sub OnStart(ByVal args() As String)<br />
<br />
        'write entry that service has started<br />
        EventLog1.WriteEntry("KeyMailSvc Started")<br />
<br />
        Try<br />
<br />
            'start outlook app and open namespace<br />
            olApp = New Outlook.ApplicationClass()<br />
            olNS = olApp.GetNamespace("MAPI")<br />
            olNS.Logon("", "", False, True)<br />
<br />
            'start the timer<br />
            With Me.Timer1<br />
                .Interval = 30000<br />
                .Enabled = True<br />
            End With<br />
<br />
<br />
        Catch ex As System.Exception... (some error logging goes here)<br />
<br />


I do not get to the Catch. Attempts to start the service time out and I get a MS error message "The server {0006F03A-0000-0000-C000-000000000046} did not register with DCOM within the required timeout." in my System log.

If I compile the same code as a WinForms app and move the Outlook code to the Form_Load event, I have no problems. Can anyone shed some light on this for me?
GeneralRe: Windows Service and Outlook: An Update Pin
FeejayFred31-Aug-05 9:05
FeejayFred31-Aug-05 9:05 
QuestionPop Up Menu Pin
No-e31-Aug-05 8:21
No-e31-Aug-05 8:21 
AnswerRe: Pop Up Menu Pin
Mark0631-Aug-05 13:02
Mark0631-Aug-05 13:02 
GeneralRe: Pop Up Menu Pin
No-e1-Sep-05 2:25
No-e1-Sep-05 2:25 
QuestionNow what - distribute ActiveX control Pin
john john mackey31-Aug-05 8:09
john john mackey31-Aug-05 8:09 
QuestionDataSets vs Queries Pin
medicenpringles31-Aug-05 7:52
medicenpringles31-Aug-05 7:52 
AnswerRe: DataSets vs Queries Pin
Marcus J. Smith31-Aug-05 9:02
professionalMarcus J. Smith31-Aug-05 9:02 
QuestionInsert rows in a multi table dataset Pin
dptalt31-Aug-05 7:42
dptalt31-Aug-05 7:42 
AnswerRe: Insert rows in a multi table dataset Pin
Mark0631-Aug-05 13:04
Mark0631-Aug-05 13:04 
GeneralRe: Insert rows in a multi table dataset Pin
dptalt31-Aug-05 14:53
dptalt31-Aug-05 14:53 
QuestionVB.net Datagrid Pin
Simpiwe31-Aug-05 5:56
Simpiwe31-Aug-05 5:56 
Questionhow to shutdonw winXP Pin
marclenoir200531-Aug-05 4:49
marclenoir200531-Aug-05 4:49 
AnswerRe: how to shutdonw winXP Pin
°[Halo]°31-Aug-05 5:06
°[Halo]°31-Aug-05 5:06 
AnswerRe: how to shutdonw winXP Pin
Dave Kreskowiak31-Aug-05 5:44
mveDave Kreskowiak31-Aug-05 5:44 
Questiontwo scroll bars? Pin
monageasmear31-Aug-05 4:08
monageasmear31-Aug-05 4:08 
AnswerRe: two scroll bars? Pin
Taen_Karth1-Sep-05 11:47
Taen_Karth1-Sep-05 11:47 
Questiontwo scroll bars? Pin
monageasmear31-Aug-05 4:06
monageasmear31-Aug-05 4:06 

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.