This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Issue calling COM function(s)


>>>>> "Paul" == Paul K Gleske <pkg@gleske.org> writes:

    Paul> I'm having trouble porting a VC++ based windows project to a
    Paul> GCC based project.  Don't ask why, it just is.

    Paul> My issue is one of the first (the first?) COM function I
    Paul> call is CreateStreamFromHGlobal.  This function seems to
    Paul> work, but I get a segv on the first method call on the
    Paul> stream (IStream->Stat).  It seems that the vtable might be
    Paul> wrong.

I was running into the same problem myself.  Make sure you call
CoInitialize() before you issue any COM calls in your program.  It
should clear the memory faults.

Oh, one other thing: you'll need to pass -lole32 to gcc when linking.
Actually, you may need to specify additional Windows libraries
depending on what COM stuff you're calling.

Hope this helps,

-- 
Dario Alcocer -- Sr. Software Developer, Helix Digital Inc.
alcocer@helixdigital.com -- http://www.helixdigital.com

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]