Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calling com dll functions from an ocx?

5 views
Skip to first unread message

Gopal

unread,
Oct 23, 2009, 2:09:02 PM10/23/09
to
Hi all,

I have struggled with this for a while now. I have an ocx built using MFC. I
need to call methods from a COM dll within this ocx. But I am unable to do
so. Here is what I have tried so far. I created a new class within the ocx
manually. Using #import I imported the tlb for the com dll and then using
CoCreateInstance() I instantiate the com dll object. This all goes well. But
when I call methods on the interface pointers, I get E_FAIL errors.

Am I not following the right methodology here? Or is there a step I am
missing?

Any help would be greatly appreciated. Apologies for not posting the code
here, I cannot do so due to security issues.

regards,
Gopal

Brian Muth

unread,
Oct 28, 2009, 3:02:14 PM10/28/09
to
Well it is certainly legitimate to call methods on an COM dll from within an
ocx. E_FAIL is just a general failure message, so there isn't much to go on.
You will need to singlestep into the COM dll and debug. If you are not the
author of the COM dll, you will need to contact the developer for that info.

"Gopal" <Go...@discussions.microsoft.com> wrote in message
news:4CA3C547-D7D6-4467...@microsoft.com...

0 new messages