def Boot(what=0):
    # Locate the GRiNSRes.dll file.  This is presumably in the same directory as
    # the extensionmodules, or if frozen, in the main directory
    # This call allows Pythonwin to automatically find resources in it.
    import win32ui
    dllPath = os.path.split(win32ui.__file__)[0]
    try:
        global resdll
        resdll = win32ui.LoadLibrary(os.path.join(dllPath, "GRiNSRes.dll"))
        resdll.AttachToMFC()
    except win32ui.error:
        win32ui.MessageBox(
            "The application resource DLL 'GRiNSRes.dll' can not be located\r\n\r\nPlease correct this problem, and restart the application"
        )
        # For now just continue!?!?!
    # run the given cmif file
    try:
        if what == PLAYER:
            import grins
        elif what == SUBSYSTEM:
            exec 'import %s\n' % subsystemModuleName
        else:
            import cmifed
    except SystemExit, rc:
        win32ui.GetMainFrame().PostMessage(WM_CLOSE)
Example #2
0
def Boot( bEditor = 0 ):
    CMIFDIR = win32api.GetFullPathName(os.path.join(os.path.split(sys.argv[0])[0], "." ))

    # TEMP TEST FOLDER
    if bEditor:
        specificPath = "editor"
        os.environ['GRiNSApp']='GRiNSed'
    else:
        specificPath = "grins"
        os.environ['GRiNSApp']='GRiNS'

    CMIFPATH = [
            os.path.join(CMIFDIR, '%s\\win32' % specificPath),
            os.path.join(CMIFDIR, 'common\\win32'),
            os.path.join(CMIFDIR, 'lib\\win32'),
            os.path.join(CMIFDIR, '%s' % specificPath),
            os.path.join(CMIFDIR, 'common'),
            os.path.join(CMIFDIR, 'lib'),
            os.path.join(CMIFDIR, 'pylib'),
            os.path.join(CMIFDIR, 'pylib\\audio'),
            os.path.join(CMIFDIR, 'win32\\src\\Build'),
    ]
    CMIF_USE_WIN32="ON"
    #CHANNELDEBUG="ON"

    sys.path[0:0] = CMIFPATH

    os.environ["CMIF"] = CMIFDIR
    #os.environ["CHANNELDEBUG"] = "ON"
    os.environ["CMIF_USE_WIN32"] = "ON"

    # Locate the GRiNSRes.dll file.  This is presumably in the same directory as
    # the extensionmodules, or if frozen, in the main directory
    # This call allows Pythonwin to automatically find resources in it.
    import win32ui
    dllPath = os.path.split(win32ui.__file__)[0]
    win32ui.GetWin32Sdk().SetCurrentDirectory(dllPath)
    try:
        global resdll
        resdll = win32ui.LoadLibrary(os.path.join(dllPath, "GRiNSRes.dll"))
        resdll.AttachToMFC()
    except win32ui.error:
        win32ui.MessageBox("The application resource DLL 'GRiNSRes.dll' can not be located\r\n\r\nPlease correct this problem, and restart the application")
        # For now just continue!?!?!

    # set app registry root to GRiNS
    from version import registrykey, registryname
    win32ui.SetAppName(registryname)
    win32ui.SetRegistryKey(registrykey)

    # run the given cmif file
    if bEditor:
        import cmifed
    else:
        import grins
Example #3
0
def dllFromDll(dllid):
    " given a 'dll' (maybe a dll, filename, etc), return a DLL object "
    if dllid == None:
        return None
    elif type('') == type(dllid):
        return win32ui.LoadLibrary(dllid)
    else:
        try:
            dllid.GetFileName()
        except AttributeError:
            raise TypeError, "DLL parameter must be None, a filename or a dll object"
        return dllid