Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Late bound COM Reflection #1173

Open
ThunderFrame opened this issue Mar 5, 2016 · 2 comments
Open

Late bound COM Reflection #1173

ThunderFrame opened this issue Mar 5, 2016 · 2 comments
Labels
enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-inspections

Comments

@ThunderFrame
Copy link
Member

Now that we have Reflection for early-bound references, we need to consider reflecting the late bound references.

Wait... Why wouldn't we find CreateObject() calls, grab the argument, and go look up the com type?
Lots of edge cases, but the simplest one would be easy enough I think.

Well, presumably developers are late binding for a reason. It's worthy of a code inspection, at the very least.

But you might choose to late bind because the library might not exist on all PCs, or the library might vary by PC or user or some other value. You might write VBA that late binds to ADO, because you don't know which version is available on the PC, or you might bind to a particular version of MSXML, depending on the functionality/behaviour you want.

As @ckuhn203 points out, the edge case is presumably the use of a constant, variable or literal expression. Those could be hard to evaluate at design time.

If we do choose to resolve the late bound references, then I think we should have Settings that enable/configure the behavior, and annotations that allow a developer to exlude individual CreateObject statements from reflection.

@rubberduck203
Copy link
Member

A literal would be the "simple case" I was referring to. A constant, harder, but not impossible. Resolving the runtime value of a variable is the edge case I wouldn't want to have to code for. I do believe using a variable would be an edge case though. I can't think of a reason I would want to calculate which library/object I was getting an instance of.

@retailcoder
Copy link
Member

OMG I just had a vision of a keyhook-based autocomplete feature for late-bound references...

I don't want to commit this for 2.x, or even 3.x, but I want it on the roadmap.

@retailcoder retailcoder added this to the Future Versions milestone Mar 18, 2016
@Vogel612 Vogel612 added the enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. label Nov 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-inspections
Projects
None yet
Development

No branches or pull requests

5 participants