Board index » delphi » Passing Interface pointer to a DLL + COM thoughts

Passing Interface pointer to a DLL + COM thoughts

Hi,

I have currently made a Delphi application that sends an interface to
a DLL so that the DLL can query/communicate with my application.
I have not made a type library but just copy/pasted the interface
declaration
to the Delphi DLL. Would this also work for a DLL written in C++ as long as
I supplied a type library to the DLL writer?

I'm thinking of redesigning my application to take advantage of interfaces
so that
I could load a plugin and send it a pointer to my main interface (IAppInfo).
Other interfaces in my program could be obtained from this one.
Does this seem to be a viable solution? I do not think I would need to make
the app.
automatable as it is only the plugins/dlls that I load that needs access to
the
internal interface.

I guess to be able to do drag/drop from my main app. to a form in the plugin
I will need to get up to speed on dragging and dropping with COM also.

I have not worked much with COM so please let me know if you have any input
on the above approach.

Thanks
-Tommy

 

Re:Passing Interface pointer to a DLL + COM thoughts


Quote
> I have currently made a Delphi application that sends an interface to
> a DLL so that the DLL can query/communicate with my application.
> I have not made a type library but just copy/pasted the interface
> declaration
> to the Delphi DLL. Would this also work for a DLL written in C++ as long
as
> I supplied a type library to the DLL writer?

If you supply the tlb, then I assume that you are expecting the client to
access your object through COM. Then yes it would work as a normal COM
interface.

Quote
> I'm thinking of redesigning my application to take advantage of interfaces
> so that
> I could load a plugin and send it a pointer to my main interface
(IAppInfo).
> Other interfaces in my program could be obtained from this one.
> Does this seem to be a viable solution? I do not think I would need to
make
> the app.
> automatable as it is only the plugins/dlls that I load that needs access
to
> the
> internal interface.

If youre doing 1 language host and plugins, internal interfaces are OK. If
you have cross language integration, COM interfaces ensure that they will
work without hassle.

Quote
> I guess to be able to do drag/drop from my main app. to a form in the
plugin
> I will need to get up to speed on dragging and dropping with COM also.

Yep.

have fun
--
Binh Ly
Need help on COM development?
http://www.techvanguards.com

Other Threads