Can I use win32 COM object in a thread?

Discussion in 'Python' started by Pelmen, Dec 15, 2005.

  1. Pelmen

    Pelmen Guest

    When I try to call a method of COM object, it return error about "There
    wasn't 'CoInitialize' call", or if I use thread, I have to access COM
    object methods in other way?

    thanks for any help
     
    Pelmen, Dec 15, 2005
    #1
    1. Advertising

  2. Pelmen

    Pelmen Guest

    Sorry for post, answer was near ... just do search

    2. Ixokai

    From: "Ixokai" <>
    Mon, 9 Feb 2004 11:05:08 -0800


    Basically, adodbapi uses COM, and COM and threads require a bit of
    care,
    apparently. Your webkit thing may be using a thread to handle stuff.


    import pythoncom
    pythoncom.CoInitialize()
    .... code ...
    pythoncom.CoUnitialize()


    You need to call pythoncom.CoInitialize() once for each thread...
    theres
    something about sys.coinit_flags = 0 (or 1) that may be nessecary but I

    don't know what they mean precisely :)


    --Stephen
     
    Pelmen, Dec 15, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bearsprite
    Replies:
    3
    Views:
    613
    Dennis Lee Bieber
    Dec 12, 2006
  2. Replies:
    9
    Views:
    1,853
    Piet van Oostrum
    Jul 26, 2009
  3. Vincenzo Piombo
    Replies:
    1
    Views:
    176
  4. Replies:
    6
    Views:
    250
    Paul Lalli
    Jun 1, 2006
  5. Gildor Oronar
    Replies:
    4
    Views:
    99
Loading...

Share This Page