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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. COM
  4. MAPI thows Cannot change thread mode after it is set exception

MAPI thows Cannot change thread mode after it is set exception

Scheduled Pinned Locked Moved COM
csharpvisual-studiohelpquestion
1 Posts 1 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.
  • G Offline
    G Offline
    Gavin Jeffrey
    wrote on last edited by
    #1

    Hi, I have a windows form(c#) and I am using the mapi dll to read email from a specific account. my project runs from - C:\Documents and Settings\GJeffrey.LAWACTIVE\My Documents\Visual Studio Projects but when i try to ininitialize the mapi session i.e. oSession = new MAPI.Session(); in a class named Email and not on my main form it bombs out with this error. It seems to me that it cannot run this object because this object is in the following directory - C:\Program Files\Common Files\System\Mapi. If i declare my mapi session as the first thing in my class constructor(or onload of the form) it seems to run fine but then it runs from the second directory. Any ideas or thought as to how i can solve this or why it is happening??

    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