Yes, but you need to get the question clearer.
Sometimes, you do know the COM interface upfront, just not the implementation. In that case, you can create a dummy implementation of the interface and #import that. At runtime, you'd still register the real component, get an object from it (via CoCreateInstance
probably) and store that in an appropriate smart pointer.
With VB6, it's a bit less direct. This adds a level of indirection. Read up on IDispatch
. You need to get that known interface to describe an unknown interface. That way, the unknown interface can be obtained at runtime.