Hi!

I test with my own Python-COM-server (Ponx), and I have also an error:

---------------------------------------------------------------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Runtime Error!

Program: D:\Dev\Python\PonxTest101.exe

R6034

An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.
---------------------------------------------------------------------------------


I use Python 2.7.3 and Pywin32.218 on Win-7-64 bits.
If I comment the line, like: #import uuid the problem disappears

@-salutations
--
Michel Claveau





Le 18.10.14 02:24, Blair Hall a écrit :
OK, sorry, here are some more details.

I have Python 2.7.8, win32, running on a Windows7 64-bit home machine (not professional).

Here is my python script:

#---------------------------------------
import pythoncom

#import uuid

class Bug:

    _reg_clsid_ = '{E3D5F332-F080-47B3-A319-A3A0E287E466}'
    _reg_progid_ = "BugServer"
    _public_methods_ = ['hello']

    def __init__(self):
        pass
#------------------------------------------------------------------------
    def hello(self,who):
        return "Hello {}".format(who)

#============================================================================
if __name__=='__main__':

    # cmd options: --register --debug and --unregister
    import win32com.server.register
    win32com.server.register.UseCommandLine(Bug)
#---------------------------------------------


As it is, this works fine. I just run the script with an Admin command window to register the server. But when I uncomment the 'import uuid' line the error occurs as Excel opens.

In my VBA code I have (in ThisWorkbook)

Private Sub Workbook_Open()
    ' When the workbook opens we create the object
    Set Bug = CreateObject("BugServer")
    Debug.Print "open"
End Sub

and in a separate module I have defined the UDF

Public Bug As Object
Function hello(ByVal expr As String) As Variant
    '
    '
    hello = Bug.hello(expr)

End Function

Thanks for the help.



On Fri, Oct 17, 2014 at 8:18 PM, Vernon D. Cole <vernondc...@gmail.com <mailto:vernondc...@gmail.com>> wrote:

    Which version of Python are you running?
    32 or 64 bit?
    Which version of pywin32?
    Which version of Windows?
    Can you make a small test case that will demonstrate the error?


    On Thu, Oct 16, 2014 at 7:47 PM, Blair Hall <blairdh...@gmail.com
    <mailto:blairdh...@gmail.com>> wrote:

        I have a small python COM server that worked fine with Excel
        until I decided to import the standard Python 'uuid' module.

        Now I get the Windows Runtime error R6034 "An application has
        made an attempt to load the C runtime library incorrectly"

        I there anything that I can do to fix this?

        _______________________________________________
        python-win32 mailing list
        python-win32@python.org <mailto:python-win32@python.org>
        https://mail.python.org/mailman/listinfo/python-win32





_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


--
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to