CreateClass
Create an object of a registered type class [in the specified file and compile and link it as needed] [and can optionally compile and link dependent file] Consecutive calls made to FindClass returns a reference to a new instance of the same type
ClassObject CreateClass( LPCSTR lpcszName, LPCSTR lpcszPath = NULL, BOOL bCompileDependents = TRUE, BOOL bAutoDelete = TRUE )
Returns a ClassObject if successfull (can use NULL comparison) can be casted to a refrence to the desired type.
void Project_CreateClass_Ex1() { string strFilename = GetAppPath(true) + "OriginC\\Originlab\\FitNL.cpp"; OperationBase& op = (OperationBase&) Project.CreateClass("FitNL", strFilename); if( NULL == op) printf("Fail to create class object of FitNL"); op.CreateInternal(); bool bInitOK = op.Init(); if ( bInitOK ) printf("Operation init successfully"); else printf("Fail to init operation"); return; }
Project::FindClass
origin.h