Plugin Module not found for Console Apps

The Chilkat plugin contains a collection of classes, all within a module named “Chilkat”. To create an instance of the JsonObject class, one could write:

Dim json as New Chilkat.JsonObject

All works well when using the Chilkat plugin with Desktop apps. However, when trying to use in a Console app, the module isn’t recognized. Actually, the auto-completion when typing works, so if I begin typing “Chil” it will automatically suggest “Chilkat”, but when trying to run, the following error occurs:

“Can’t find a type or module with this name”
Dim json as New Chilkat.JsonObject

(The word “Chilkat” is highlighted in yellow.)

I noticed in the “Extras” directory there is an example for a Module containing functions, and an example for a class, but NOT an example for a Module containing classes. Maybe I’ll try to create a bare-bones example of a Module containing a class to see if the same problem exists.

Anyway, my question is: Off the top of your head, does anyone know of a common cause for this problem?

PS> All the class methods and properties are properly marked as REALconsoleSafe.

the module and classes inside it are also marked with REALconsoleSafe?

Thanks Christian,

Modules, by default are already console safe. This is the comment within the “Complete Module” example:

// Since a module is simply a namespace, the module itself // is always considered console-safe. However, you still // have to mark individual code items within the module for // their console safety.

I’ll double check my class definitions – maybe that’s the issue. The methods and properties are all marked as console safe.

Christian,

Your reply led me to the answer. I overlooked the mFlags member in the REALclassDefinition structure:

typedef struct { uint32_t version; const char *name; const char *superName; size_t dataSize; RBInteger forSystemUse; REALproc constructor; REALproc destructor; REALproperty *properties; size_t propertyCount; REALmethodDefinition *methods; size_t methodCount; REALevent *events; size_t eventCount; REALeventInstance *eventInstances; size_t eventInstanceCount; const char *interfaces; REALattribute *attributes; // Re-using this in 2011r3 (control version 10 and later) size_t attributeCount; REALconstant *constants; size_t constantCount; [b]uint32_t mFlags;[/b] REALproperty *sharedProperties; // Begin Added in RB2006r4 (control version 9 and later) -- Jun 23 2006 -- AJB (1) size_t sharedPropertyCount; REALmethodDefinition *sharedMethods; size_t sharedMethodCount; // End RB2006r4 stuff #if kCurrentREALControlVersion >= 11 REALdelegate *delegates; // 2013r1 (Control version 11 or later) size_t delegateCount; REALenum *enums; // 2013r1 (Control version 11 or later) size_t enumCount; #endif } REALclassDefinition;

Everything worked once the class was marked console safe. :slight_smile: