Mark-

The example application I am working from does the following (but never actually does a CreateObject with the dll):

 ' set up the input
  Dim pConv As New SRS_CONLib.Point2D
  pConv.x = CDbl(m_sX)
  pConv.y = CDbl(m_sY)
  pConv.Projection = m_inProj

  ' check to see if the range is valid (or the user wants to override)
  If checkRange(pConv.x, pConv.y, m_inProj) = False Then Exit Sub



The reference the the dll is as follows:

Reference=*\G{A816BA3B-2465-11D5-9122-000629432AA8}#1.0#0#C:\Program Files\EGIS Utilities\ArcMap\17_srs_con.dll#srs_con 1.0 Type Library


Is what I need in either of these places? Or can I get to it from either of these two places.

As you can tell, I am baffled by COM....

Thanks again,

Eric

PS I forwarded your message to the developer, but haven't heard back yet.

Eric B. Powell
E&GIS
BSRI
(803)952-7783

When a true genius appears in this world you may know him by this sign, that the dunces are all in confederacy against him. (Swift)



"Mark Hammond" <[EMAIL PROTECTED]>

05/09/2005 06:38 PM

To
<[EMAIL PROTECTED]>, "'python-win32 Mailinglist'" <python-win32@python.org>
cc
Subject
RE: [python-win32] (no subject)





"SRS_CONLib.Point2D" is not the "ProgID" of the object - it is the name of
the typelib and interface in that typelib.

If your object can be used with Dispatch, it should be possible to create
the object in VB using "CreateObject" - CreateObject wants the ProgID too -
ie, it will fail with "SRS_CONLib.Point2D".  Whatever you can pass to
CreateObject can be passed to Python's dispatch.

Ask the developer what the "ProgID" of the object is.

Cheers,

Mark
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, 10 May 2005 2:55 AM
To: python-win32 Mailinglist
Subject: [python-win32] (no subject)



Hello again, all-

I am still trying to understand Windows COM from Python. This time, I am
trying to access a custom COM object an in-house developer has developed in
C++. The class is stored in a dll registered with my system, and can be
called from VB as follows:


>From a working VB project:

' set up the input
 Dim pConv As New SRS_CONLib.Point2D


However, when I try to call the clas via win32com, I get error messages.


In Python:

srs = win32com.client.Dispatch(r'SRS_CONLib.Point2D')

The error:

Traceback (most recent call last):
 File "<pyshell#13>", line 1, in -toplevel-
   srs = win32com.client.Dispatch(r'SRS_CONLib.Point2D')
 File "C:\PYTHON23\lib\site-packages\win32com\client\__init__.py", line 95,
in Dispatch
   dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
 File "C:\PYTHON23\lib\site-packages\win32com\client\dynamic.py", line 84,
in _GetGoodDispatchAndUserName
   return (_GetGoodDispatch(IDispatch, clsctx), userName)
 File "C:\PYTHON23\lib\site-packages\win32com\client\dynamic.py", line 72,
in _GetGoodDispatch
   IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.IID_IDispatch)
com_error: (-2147221005, 'Invalid class string', None, None)

The developer tells me the IDispatch interface is enabled, and the
SRSCON_Lib.Point2D should be in the registry.

Thanks in advance for any assistance....

Eric

Eric B. Powell
E&GIS
BSRI
(803)952-7783

When a true genius appears in this world you may know him by this sign, that
the dunces are all in confederacy against him. (Swift)


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

Reply via email to