06-11-2008 02:42 PM
@rolfk wrote:
I was refering to the Report Generation Toolkit. The different Office version libraries contain the same VIs compiled for the specific Office version. You include the one you want to support on the target into the build but can not include multiple of them into the same application.
@tbd wrote:
Hi Rolf,Not sure what you meant by "in this way you can only support one Office version in a specific build application" - example supports two OLBs (call to 11.0 is in a different case) but method could support an unlimited number of different Office versions.My [likely] mistake re: "late binding" somes from this post which is discussing LabVIEW polymorphism (see post by Greg McKaskle.) A search on this subject shows other (VB) programmers encounter this same problem - which they solve through explicit late-binding syntax.Cheers!
Late binding means a lot of things to a lot of different people. Basically it really means that the linking (binding) is not done on load time but at the first time the function is called. And from that LabVIEW does do this in Active X if I'm not mistaken. That doesn't solve the problem of an Active X method changing it's calling interface since LabVIEW defines the calling interface at compile time (except probably for Variant defined parameters which LabVIEW can adapt to at runtime). But for non Variant parameters or when suddenly there is an extra parameter or one less, LabVIEW has to throw the towel and refuse running that method since the Call Interface was compiled and prepared at build time and can not change at runtime. The same is true for C(++) where the compiler defines the method interface and as it seems even Visual Basic does the same. Of course you can prepare your code to run for different versions by implementing all the method call versions and detect which is necessary at runtime. Which you do now but while this is late binding too it's not the only way of late binding. Even Windows DLLs have delay load imports (which is also a form of late binding) which means Windows will only intilialize the
function import stub at the first time the function is used. This is still strictly linked but has been introduced to allow for circular references of DLL imports. Without delay loading Windows would get into a problem loading a DLL that references another DLL that references back to our first one and the loading would fail since all direct imports need to be fully satisfied before the load of a DLL can succeed.
Rolf Kalbermatter
Message Edited by rolfk on 06-11-2008 08:36 PM
06-11-2008 03:00 PM
@tbd wrote:Call it "source-grapes", but, if I can resolve the parameter-list discrepancy by merely re-selecting a method in the editor, perhaps the run-time engine could be smarter and resolve "calling interface" differences at run-time, assuming the selected method and supplied parameter names are supported on the target. (Even if possible, I wouldn't expect this method to be efficient ).Thanks/Cheers!
06-12-2008 10:06 AM
Of course the edit step requires a compile. What I'm postulating is that an optional method of invoking the method could be implemented at run-time (when necessary) to use an invoke-by-name strategy instead of a statically-linked strategy(?)
@rolfk wrote:
@tbd wrote:
Call it "source-grapes", but, if I can resolve the parameter-list discrepancy by merely re-selecting a method in the editor, perhaps the run-time engine could be smarter and resolve "calling interface" differences at run-time, assuming the selected method and supplied parameter names are supported on the target. (Even if possible, I wouldn't expect this method to be efficient ).Thanks/Cheers!
Ahhhhhh, but LabVIEW is a compiler!!!! And such changes require changes to the compiled code so no I do not think that is something LabVIEW could really support.
Rolf Kalbermatter
06-15-2008 11:21 PM
06-16-2008 02:22 AM
@tbd wrote:So while (it appears) LabVIEW is binding to the specific COM interface at compile-time, It's possible for other languages (including the language LabVIEW was written in) to avoid this and invoke functions by name at run-time. If only LabVIEW allowed Objects to be declared/instantiated that way!Cheers.