launcher.cxx (79e08879) launcher.cxx (ebec3577)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 28 unchanged lines hidden (view full) ---

37 char szFail[ _MAX_PATH];
38
39 HAB hab = WinInitialize( 0);
40 HMQ hmq = WinCreateMsgQueue( hab, 0);
41 ERRORID erridErrorCode = 0;
42 erridErrorCode = WinGetLastError(hab);
43
44 // Calculate application name
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 28 unchanged lines hidden (view full) ---

37 char szFail[ _MAX_PATH];
38
39 HAB hab = WinInitialize( 0);
40 HMQ hmq = WinCreateMsgQueue( hab, 0);
41 ERRORID erridErrorCode = 0;
42 erridErrorCode = WinGetLastError(hab);
43
44 // Calculate application name
45 CHAR szLibpath[_MAX_PATH*2];
46 CHAR szApplicationName[_MAX_PATH];
45 CHAR szApplicationName[_MAX_PATH];
47 CHAR szDrive[_MAX_PATH];
48 CHAR szDir[_MAX_PATH];
49 CHAR szFileName[_MAX_PATH];
50 CHAR szExt[_MAX_PATH];
51
52 // get executable fullpath
53 DosGetInfoBlocks(NULL, &pib);
54 DosQueryModuleName(pib->pib_hmte, sizeof(szApplicationName), szApplicationName);
55
56 // adjust libpath
57#if OSL_DEBUG_LEVEL > 0
46
47 // get executable fullpath
48 DosGetInfoBlocks(NULL, &pib);
49 DosQueryModuleName(pib->pib_hmte, sizeof(szApplicationName), szApplicationName);
50
51 // adjust libpath
52#if OSL_DEBUG_LEVEL > 0
53 CHAR szLibpath[_MAX_PATH*2];
58 rc = DosQueryExtLIBPATH( (PSZ)szLibpath, BEGIN_LIBPATH);
59 fprintf( stderr, "1 BeginLibPath: %s\n", szLibpath);
60#endif
54 rc = DosQueryExtLIBPATH( (PSZ)szLibpath, BEGIN_LIBPATH);
55 fprintf( stderr, "1 BeginLibPath: %s\n", szLibpath);
56#endif
61 _splitpath( szApplicationName, szDrive, szDir, szFileName, szExt );
62 char* basedir = strstr( szDir, "\\PROGRAM\\");
57 char* basedir = strrchr( szApplicationName, '\\');
63 if (basedir) *basedir = 0;
58 if (basedir) *basedir = 0;
64 sprintf( szLibpath, "\"%s%s\\URE\\BIN\";\"%s%s\\BASIS\\PROGRAM\";%%BeginLIBPATH%%;",
65 szDrive, szDir, szDrive, szDir);
66 DosSetExtLIBPATH( (PCSZ)szLibpath, BEGIN_LIBPATH);
59 DosSetExtLIBPATH( (PCSZ)szApplicationName, BEGIN_LIBPATH);
67
68 // make sure we load DLL from our path only, so multiple instances/versions
69 // can be loaded.
70 DosSetExtLIBPATH( (PCSZ)"T", LIBPATHSTRICT);
71
72#if OSL_DEBUG_LEVEL > 0
73 rc = DosQueryExtLIBPATH( (PSZ)szLibpath, BEGIN_LIBPATH);
74 fprintf( stderr, "2 BeginLibPath: %s\n", szLibpath);
75#endif
76
77 // adjust exe name
60
61 // make sure we load DLL from our path only, so multiple instances/versions
62 // can be loaded.
63 DosSetExtLIBPATH( (PCSZ)"T", LIBPATHSTRICT);
64
65#if OSL_DEBUG_LEVEL > 0
66 rc = DosQueryExtLIBPATH( (PSZ)szLibpath, BEGIN_LIBPATH);
67 fprintf( stderr, "2 BeginLibPath: %s\n", szLibpath);
68#endif
69
70 // adjust exe name
78 _splitpath( szApplicationName, szDrive, szDir, szFileName, szExt );
79 _makepath( szApplicationName, szDrive, szDir, OFFICE_IMAGE_NAME, (".bin") );
71 strcat( szApplicationName, "\\" OFFICE_IMAGE_NAME ".bin");
80
81 // copy command line parameters
82 int i, len;
83 len = strlen(szApplicationName) + 1 + strlen( APPLICATION_SWITCH) + 1 + 1;
84 for( i=1; i<argc; i++)
85 len += strlen( argv[i]) + 1;
86
87 char* pszCommandLine, *pszArgs;

--- 37 unchanged lines hidden ---
72
73 // copy command line parameters
74 int i, len;
75 len = strlen(szApplicationName) + 1 + strlen( APPLICATION_SWITCH) + 1 + 1;
76 for( i=1; i<argc; i++)
77 len += strlen( argv[i]) + 1;
78
79 char* pszCommandLine, *pszArgs;

--- 37 unchanged lines hidden ---