Skip to content

Tutorial 04 06 Add Main Dispatcher Class

Steve Ives edited this page May 19, 2020 · 16 revisions

Harmony Core Logo

Tutorial 4: Add Main Dispatcher Class

Once you have created a dispatcher, you must register it in MethodDispatcher.dbl, which is in the Dispatchers folder in the TraditionalBridge project. This enables the dispatcher to be called. To register a dispatcher, add an mDispatchStubs.Add() call in the MethodDispatcher constructor. For example:

mDispatchStubs.Add("MyRoutine", new MyDispatcher())

When you first create a solution from the harmonycore template, the MethodDispatcher.dbl file has three examples of this:

mDispatchStubs.Add("AddTwoNumbers",  new AddTwoNumbersDispatcher())
mDispatchStubs.Add("GetEnvironment", new GetEnvironmentDispatcher())
mDispatchStubs.Add("GetLogicalName", new GetLogicalNameDispatcher())

Next topic: Add Traditional Bridge Host


Clone this wiki locally