Questions tagged [late-binding]

Late binding is a mechanism in which the method being called upon an object is looked up by name at runtime.

Late binding is a mechanism in which the method being called upon an object is looked up by name at runtime.

The specific type of a late bound object is unknown to the compiler at compile time. This is contrasted with early binding, where relationships between objects, methods are properties are established during compile time.

It is expected that questions tagged specifically relate to programming using late bound code. You should also tag your post with the specific programming language being used.

Example (VBA):

' late bound objects are declared As Object
Dim obj As Object
Set obj = CreateObject("Excel.Application")

Related Tags:

353 questions
0
votes
2 answers

What the various ways of calling a method at runtime?

I need to call a method on an object but I do not know the method name until runtime. What are the techniques available? (e.g. GetMethod().Invoke(), delegates, c# 4.0 dynamic) Thanks!
Brian Low
  • 11,605
  • 4
  • 58
  • 63
0
votes
1 answer

Execute method once for each child class

I am trying to execute initialize() method for each class that extends from a baseClass, by using late static bindings: class BaseClass { protected static $initialized = false; public static function find() { …
CarlosCarucce
  • 3,420
  • 1
  • 28
  • 51
0
votes
2 answers

Late Binding Issue with BackgroundWorker in VB.Net

I am running a BackgroundWorker, and want to report its progress. In the example below I create a test list which the BackgroundWorker then iterates through. The problem lies in the line 'sender.ReportProgress(i)'. If I have Option Strict on, it…
Tim Makins
  • 394
  • 4
  • 12
0
votes
0 answers

Excel-VBA Userform with different MSXML6 versions all in one

Background: VBA code for my working vba project (UserForm) resides in a single Excel file based on xml files (so a MSXML6.dll reference "Microsoft XML, v6.0" is necessary) for a restricted number of users in a network. Until now all participants…
T.M.
  • 9,436
  • 3
  • 33
  • 57
0
votes
1 answer

Is there a way to attach late-binding puts/logging to rake tasks?

If I have a task defined in my Rakefile that looks like this: MyLibrary::CopySrcTask.new(:copySrc) do |task| puts "Copying source" task.src_dir = 'src/' task.destination = 'build/lib/' end I've come to realize that the puts in the above task…
Dasmowenator
  • 5,505
  • 5
  • 36
  • 50
0
votes
2 answers

Dynamically Change Self Binding

In Javascript, bind, call, and apply allow you to change the reference to this on demand. I'm looking at a situation in Python where the code would look a bit nicer if I were able to do this instead of using getattr. I'd like to pass a reference to…
SapphireSun
  • 9,170
  • 11
  • 46
  • 59
0
votes
1 answer

Dynamically Create Range Late Binding VBA

trying to dynamically create ranges using this: ws.Range(Cells(1, 1), Cells(q + 1, z + 1)).Value2 = xaRR this works in excel like a charm, but access vba keeps giving me issue. It doesnt like the cells part. The annoying thing is this doesnt give…
Doug Coats
  • 6,255
  • 9
  • 27
  • 49
0
votes
1 answer

Late Binding, or accessing a page element from its resource dictionary

As a simple example, I have a button in a resource dictionary, which I will store in a ContentControl. I need a to bind the Button's Visibility property to a checkbox located on the page, but the button is created before the checkbox, so my setter…
bwall
  • 984
  • 8
  • 22
0
votes
1 answer

How to create excel 2013 timeline from access

It's my first question here so please be easy on me.. I'm trying to create an excel report from a dataset i've created in MS Access as part of a MS-Access based large project. This project has to run on many machines and to avoid reference errors i…
0
votes
2 answers

Initialize a object with a derived class constructor

Consider the following C++ code: #include using std::cout; class A { public: int a; A():a(0) { cout << "A constructor\n"; } virtual void f() { cout << "f inside A\n"; } }; class C : public…
Radioga
  • 416
  • 1
  • 5
  • 16
0
votes
3 answers

C#, Get DLLs referenced by Activator.CreateInstance(assemblyType) object

I have a console app that resides in C:\MyApp. I have several libraries that are NOT referenced by the app. I use an Activator.CreateInstance() to use them. They reside in C:\MyLibrary\Job001, C:\MyLibrary\Job002, etc. Each of these libraries…
Keith Barrows
  • 24,802
  • 26
  • 88
  • 134
0
votes
1 answer

TYpescript : Static methods on Function as class

I have a fn that inherit an existing fn ( take Angular1 $q for example ) //$q original behavior var defer = $q.defer(); defer.promise.then(function(result){}) //or $q( (resolve, reject) => { //promise execution…
Ant
  • 1,812
  • 5
  • 22
  • 39
0
votes
1 answer

What are the advantages of late binding? Give one example in context of function pointers in C++

Firstly, let me clarify this question doesn't explain my doubt clearly. To set the context clear. I'm asking this question specifically with regard to function pointers in C/C++. I know the difference between early binding and late binding and how…
Vivek Vijayan
  • 337
  • 5
  • 19
0
votes
1 answer

Searching an Excel Worksheet from Outlook VBA

I have an Outlook Macro that opens some excel files. I want to know how I can use the Cells.find syntax and workbooks.Activate syntax in my Outlook macro. 'OUTLOOK VBA CODE here (works fine)... Dim xlApp As Object Set xlApp =…
PocketLoan
  • 534
  • 4
  • 13
  • 28
0
votes
1 answer

Delayed binding for promises

I'm trying to figure out how to do a late bind of a promise function parameter. In most cases, I like to have promise flow just be a series of function names, so that it reads like a series of steps (unless it's a one liner like…
maschwenk
  • 569
  • 1
  • 9
  • 20