User Tools

Site Tools


createinstance_libraries

CreateInstance() and Libraries

If you are using CreateInstance() to dynamically create objects, you need to make sure the runtime knows the class that you are using to create your object. And you can create only objects that are contained in libraries compiled in the Vulcan or VO dialect - classes created in the Core dialect cannot be used.

If your class is contained in your main executable, then there is no problem at all - the runtime knows it.

If your class is contained in a dynamically loaded library, then you need to use VulcanLoadLibrary() to load this library. Using this function the runtime will read all classes contained in your library and knows where to find them.

If your class is contained in a library that is in the references of your application, you need to use a VulcanLoadLibrary() call nevertheless. Because of the delayed load of the references of an application (.NET loads libraries only when they are needed the first time) the runtime does not knows anything of the classes that are contained in your library and at the CreateInstance() call you will se an error

Error Code: 27 [Undefined class]

from the runtime.

createinstance_libraries.txt · Last modified: 2018/02/19 04:59 by wolfgangriedmann