static private void MapConsoleExterns(string dllname)
            {

            mtorque_gethwnd = (torque_gethwnd)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_gethwnd"), typeof(torque_gethwnd));
            mdnt_torque_engineinit = (dnt_torque_engineinit)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "dnt_torque_engineinit"), typeof(dnt_torque_engineinit));

            mgetEulerRotation = (getEulerRotation)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "getEulerRotation"), typeof(getEulerRotation));
            misMemberOfClass = (isMemberOfClass)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "isMemberOfClass"), typeof(isMemberOfClass));
            mpathOnMissionLoadDone = (pathOnMissionLoadDone)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "pathOnMissionLoadDone"), typeof(pathOnMissionLoadDone));



            mSetHandler_Instance_Eval = (SetHandler_Instance_Eval)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "SetHandler_Instance_Eval"), typeof(SetHandler_Instance_Eval));
            mSetHandler_Instance_Eval_Direct_New = (SetHandler_Instance_Eval_Direct_New)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "SetHandler_Instance_Eval_Direct_New"), typeof(SetHandler_Instance_Eval_Direct_New));


            mtorque_engineinit = (torque_engineinit)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_engineinit"), typeof(torque_engineinit));
            mtorque_enginetick = (torque_enginetick)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_enginetick"), typeof(torque_enginetick));
            mtorque_engineshutdown = (torque_engineshutdown)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_engineshutdown"), typeof(torque_engineshutdown));
            mtorque_setwebdeployment = (torque_setwebdeployment)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_setwebdeployment"), typeof(torque_setwebdeployment));
            mtorque_enginesignalshutdown = (torque_enginesignalshutdown)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_enginesignalshutdown"), typeof(torque_enginesignalshutdown));
            mtorque_reset = (torque_reset)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_reset"), typeof(torque_reset));
            mtorque_resizewindow = (torque_resizewindow)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_resizewindow"), typeof(torque_resizewindow));



            mclientGroup_getCount = (clientGroup_getCount)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "clientGroup_getCount"), typeof(clientGroup_getCount));
            mclientGroup_getObject = (clientGroup_getObject)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "clientGroup_getObject"), typeof(clientGroup_getObject));
            mNameSpace_isMethod = (NameSpace_isMethod)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "NameSpace_isMethod"), typeof(NameSpace_isMethod));
            mremoveTaggedString = (removeTaggedString)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "removeTaggedString"), typeof(removeTaggedString));
            mConsoleCall = (ConsoleCall)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "ConsoleCall"), typeof(ConsoleCall));
            mgetTaggedString = (getTaggedString)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "getTaggedString"), typeof(getTaggedString));
            maddTaggedString = (addTaggedString)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "addTaggedString"), typeof(addTaggedString));
            mConsole_warnf = (Console_warnf)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Console_warnf"), typeof(Console_warnf));
            mConsole_printf = (Console_printf)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Console_printf"), typeof(Console_printf));
            mConsole_errorf = (Console_errorf)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Console_errorf"), typeof(Console_errorf));
            mdeleteVariables = (deleteVariables)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "deleteVariables"), typeof(deleteVariables));
            mobjectHasMethod = (objectHasMethod)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "objectHasMethod"), typeof(objectHasMethod));
            misFunction = (isFunction)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "isFunction"), typeof(isFunction));
            mGetObjectID = (GetObjectID)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "GetObjectID"), typeof(GetObjectID));
            mclearServerPaths = (clearServerPaths)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "clearServerPaths"), typeof(clearServerPaths));
            mgetDataBlock = (getDataBlock)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "getDataBlock"), typeof(getDataBlock));
            mgetName = (getName)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "getName"), typeof(getName));
            mnameToID = (nameToID)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "nameToID"), typeof(nameToID));
            mspawnObject = (spawnObject)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "spawnObject"), typeof(spawnObject));
            mgetClassName = (getClassName)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "getClassName"), typeof(getClassName));
            mParentCall = (ParentCall)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "ParentCall"), typeof(ParentCall));
            mParentCallFunct = (ParentCallFunct)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "ParentCallFunct"), typeof(ParentCallFunct));
            mClassname_Call = (Classname_Call)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Classname_Call"), typeof(Classname_Call));
            mcommandToClient = (commandToClient)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "commandToClient"), typeof(commandToClient));
            mcommandToServer = (commandToServer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "commandToServer"), typeof(commandToServer));
            mConsole_getSimTime = (Console_getSimTime)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Console_getSimTime"), typeof(Console_getSimTime));
            mNameSpace_isInNamespaceHierarchy = (NameSpace_isInNamespaceHierarchy)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "NameSpace_isInNamespaceHierarchy"), typeof(NameSpace_isInNamespaceHierarchy));
            mContainerRadiusSearch = (ContainerRadiusSearch)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "ContainerRadiusSearch"), typeof(ContainerRadiusSearch));
            //mwle_fn_SimObject_getFieldValue = (wle_fn_SimObject_getFieldValue)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "wle_fn_SimObject_getFieldValue"), typeof(wle_fn_SimObject_getFieldValue));
            mcs_torque_getvariable = (cs_torque_getvariable)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "cs_torque_getvariable"), typeof(cs_torque_getvariable));
            mcs_torque_setvariable = (cs_torque_setvariable)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "cs_torque_setvariable"), typeof(cs_torque_setvariable));
            //mwle_fn_SimObject_setFieldValue = (wle_fn_SimObject_setFieldValue)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "wle_fn_SimObject_setFieldValue"), typeof(wle_fn_SimObject_setFieldValue));
            mSceneObject_getTypeMask = (SceneObject_getTypeMask)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "SceneObject_getTypeMask"), typeof(SceneObject_getTypeMask));
            mSceneObject_initContainerRadiusSearch = (SceneObject_initContainerRadiusSearch)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "SceneObject_initContainerRadiusSearch"), typeof(SceneObject_initContainerRadiusSearch));
            mexecute = (execute)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "execute"), typeof(execute));
            mSimObject_Call = (SimObject_Call)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "SimObject_Call"), typeof(SimObject_Call));
            mMath_MatrixCreateFromEuler = (Math_MatrixCreateFromEuler)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Math_MatrixCreateFromEuler"), typeof(Math_MatrixCreateFromEuler));
            mMath_MatrixMulVector = (Math_MatrixMulVector)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Math_MatrixMulVector"), typeof(Math_MatrixMulVector));
            //mwle_fn_activatePackage = (wle_fn_activatePackage)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "wle_fn_activatePackage"), typeof(wle_fn_activatePackage));
            misObject = (isObject)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "isObject"), typeof(isObject));
            mSimObject_isField = (SimObject_isField)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "SimObject_isField"), typeof(SimObject_isField));
            }
 static private void ClearConsoleExterns()
            {
            mClearHandler_Instance_EvalHandler_Instance_Eval = null;
            mClearHandler_Instance_Eval_Direct_New = null;
            mtorque_gethwnd = null;
            mdnt_torque_engineinit = null;
            mgetEulerRotation = null;
            misMemberOfClass = null;
            mpathOnMissionLoadDone = null;
            mSetHandler_Instance_Eval = null;
            mSetHandler_Instance_Eval_Direct_New = null;
            mtorque_engineinit = null;
            mtorque_enginetick = null;
            mtorque_engineshutdown = null;
            mtorque_setwebdeployment = null;
            mtorque_enginesignalshutdown = null;
            mtorque_reset = null;
            mtorque_resizewindow = null;
            mclientGroup_getCount = null;
            mclientGroup_getObject = null;
            mNameSpace_isMethod = null;
            mremoveTaggedString = null;
            mConsoleCall = null;
            mgetTaggedString = null;
            maddTaggedString = null;
            mConsole_warnf = null;
            mConsole_printf = null;
            mConsole_errorf = null;
            mdeleteVariables = null;
            mobjectHasMethod = null;
            misFunction = null;
            mGetObjectID = null;
            mclearServerPaths = null;
            mgetDataBlock = null;
            mgetName = null;
            mnameToID = null;
            mspawnObject = null;
            mgetClassName = null;
            mParentCall = null;
            mParentCallFunct = null;
            mClassname_Call = null;
            mcommandToClient = null;
            mcommandToServer = null;
            mConsole_getSimTime = null;
            mNameSpace_isInNamespaceHierarchy = null;
            mContainerRadiusSearch = null;
            mcs_torque_getvariable = null;
            mcs_torque_setvariable = null;
            mSceneObject_getTypeMask = null;
            mSceneObject_initContainerRadiusSearch = null;
            mexecute = null;
            mSimObject_Call = null;
            mMath_MatrixCreateFromEuler = null;
            mMath_MatrixMulVector = null;
            misObject = null;
            mSimObject_isField = null;
            GC.Collect();
            }