[Wine] Accessing a COM object's property throws "Object doesn't support this property or method: 'XXX'"

LD ld at gardschwingdoazah.de
Wed Oct 28 13:10:25 CDT 2009

Hi wine-users!

My first time here so a big hello to everyone!

I've only started working with wine two days ago and must say I'm
amazed: It's smooth beyond my expectations.

But I'm experiencing a problem with my current task:

I'm using wine 1.0 on Ubuntu Linux 8.04 to run a specialized
application/service (recognizing scanned business cards), have also
tried 1.1.32.

To automate the recognition process I'm trying to code a small
commandline tool that's supposed to look at a JPEG file, analyze it and
report its findings.  That tool is just a wrapper for some application
(cardiris) which offers its service through the COM framework.

My problem: I have never done any COM stuff before and know almost none
of it.  I do have some example .NET C# code that works on a native
Windows installation, but I failed to get it running under wine with
either dotnet20 or Mono.

I came about the very lightweight disphelper plain-C-framework
(http://disphelper.sourceforge.net/) which gave me some pleasant
surprises at first: Calling some simple methods on a COM object just
worked fine.

Here's some code that works OK:

  // Create the main object
  dhCreateObject (L"Cardiris.Application", NULL, &ci_app);

  // Analyze the image, returns the result as an ICard object in ci_card
  DISPATCH_OBJ (ci_card);
  HRESULT hr_Recognize =
    dhGetValue (L"%o", & ci_card, ci_app,
                L".Recognize(%s, %d, %b)",
                img_filename, 3017, TRUE);

But now I'm stuck: ci_card is another COM object whose properties are
just the thing I ultimately want.  But whichever property I try to
access, I always get an "Object doesn't support this property or method:
'LastName'" error:

  // Get the value of "ci_card.LastName"
  wchar_t * last_name;
  HRESULT hr_GetValue_LastName =
    dhGetValue (L"%s", & last_name, ci_card, L".LastName");

It doesn't seem to be my own mistake, though, because the same code does
work on a Windows machine.  (Under wine it bails with the error
mentioned above, under Windows the string last_name gets set to the
correct value.)

Now, do I stand any chance to make this work? I wouldn't mind some
different approach or some workaround, but to me it seems that the
dhGetValue call on the ci_card object fails at some deeper level in the
COM machinery (although no errors/warnings/fixmes show up in the output
of wineconsole).

Ah, maybe that's important, too: I need to register two things for the
application to work, a DLL using regsvr32 and an executable (registers
itself when invoked with some commandline switch).  I *think* that the
ci_card object's class is defined in the DLL, whereas
Cardiris.Application is from the executable.

Would anyone be some kind as to share their ideas? I'd really appreciate
even pointers as to how to go on debugging this.

Thanks in advance and best regards

More information about the wine-users mailing list