Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. problem with outlook application object

problem with outlook application object

Scheduled Pinned Locked Moved C / C++ / MFC
c++comhelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dharani
    wrote on last edited by
    #1

    Hello all Good day . Though this question is not relevant to MFC or Win32 but to do with VB generic behavior => I have a outlook plugin ( COM plugin ) developed in VB 6.0 . We have an external application which uses the outlook addin to get the contact details from outlook. The problem is here => We create a new application object and free it as below => Set gApp = New Outlook.Application .... Set gApp = Nothing After this code is executed when we click on outlook application it says "Operation failed" . It looks like the outlook application object is not well freed by the statement Set gApp = Nothing . But I checked by adding the line below to ensure if the gApp is really free or not . If gApp is Nothing Then Log("gApp is free") Else Log ( "gApp is not free") Endif Even after this check it shows gApp is free which does not seem to be the case . What can I further do to make sure the object is really made NULL !!!! Going crazy with VB regards

    redindian

    L R 2 Replies Last reply
    0
    • D dharani

      Hello all Good day . Though this question is not relevant to MFC or Win32 but to do with VB generic behavior => I have a outlook plugin ( COM plugin ) developed in VB 6.0 . We have an external application which uses the outlook addin to get the contact details from outlook. The problem is here => We create a new application object and free it as below => Set gApp = New Outlook.Application .... Set gApp = Nothing After this code is executed when we click on outlook application it says "Operation failed" . It looks like the outlook application object is not well freed by the statement Set gApp = Nothing . But I checked by adding the line below to ensure if the gApp is really free or not . If gApp is Nothing Then Log("gApp is free") Else Log ( "gApp is not free") Endif Even after this check it shows gApp is free which does not seem to be the case . What can I further do to make sure the object is really made NULL !!!! Going crazy with VB regards

      redindian

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      dharani wrote:

      Going crazy with VB

      Then please post your question in the correct forum! This has nothing to do with C/C++/MFC.

      Just say 'NO' to evaluated arguments for diadic functions! Ash

      1 Reply Last reply
      0
      • D dharani

        Hello all Good day . Though this question is not relevant to MFC or Win32 but to do with VB generic behavior => I have a outlook plugin ( COM plugin ) developed in VB 6.0 . We have an external application which uses the outlook addin to get the contact details from outlook. The problem is here => We create a new application object and free it as below => Set gApp = New Outlook.Application .... Set gApp = Nothing After this code is executed when we click on outlook application it says "Operation failed" . It looks like the outlook application object is not well freed by the statement Set gApp = Nothing . But I checked by adding the line below to ensure if the gApp is really free or not . If gApp is Nothing Then Log("gApp is free") Else Log ( "gApp is not free") Endif Even after this check it shows gApp is free which does not seem to be the case . What can I further do to make sure the object is really made NULL !!!! Going crazy with VB regards

        redindian

        R Offline
        R Offline
        Roger Broomfield
        wrote on last edited by
        #3

        dealing with outlook is especially difficult. first you need to attempt to connect to running instance and if successfull set a flag. if not current instance create one. do your stuff. then if you connected to running instance just free your stuff and go bye bye. if you created an instance call close on it and then go bye bye. NEVER call close on an instance you didnt create.

        L 1 Reply Last reply
        0
        • R Roger Broomfield

          dealing with outlook is especially difficult. first you need to attempt to connect to running instance and if successfull set a flag. if not current instance create one. do your stuff. then if you connected to running instance just free your stuff and go bye bye. if you created an instance call close on it and then go bye bye. NEVER call close on an instance you didnt create.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Roger Broomfield wrote:

          dealing with outlook is especially difficult.

          I have not found this either in C++ or C#, the latter being especially easy.

          Just say 'NO' to evaluated arguments for diadic functions! Ash

          R 1 Reply Last reply
          0
          • L Lost User

            Roger Broomfield wrote:

            dealing with outlook is especially difficult.

            I have not found this either in C++ or C#, the latter being especially easy.

            Just say 'NO' to evaluated arguments for diadic functions! Ash

            R Offline
            R Offline
            Roger Broomfield
            wrote on last edited by
            #5

            What I found, was that Outlook 2007, was unfriendly. It is a single instance multi process application that needs to be specifically closed. If you start it, you close it, if you dont specifically close an instance you started it sits in running processes until you log off. If you dont start it, you dont close it, but you do release all instances of objects you created. Maybe this is because I dont have the latest VS. But I dont see how that would affect the Outlook object model.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups