/Sources/scclink.pas
Pascal | 46 lines | 26 code | 6 blank | 14 comment | 1 complexity | 88c557d9999f919f950520afcea73c72 MD5 | raw file
1unit scclink; 2interface 3uses 4 Windows, SysUtils; 5{ 6 Automatically converted by H2Pas 1.0.0 from 7 D:\work\FPC\ooi\sources\api\c_sources\scclink.h 8 The following command line parameters were used: 9 -e 10 -p 11 -D 12 -v 13 -w 14 -o 15 And handmade update after it. 16 D:\work\FPC\ooi\sources\api\c_sources\scclink.c 17} 18 19 { Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. } 20 21function SCCLoadViewerDLL(AViewerPath: string): THandle; 22function SCCGetModulePath(AHInststance: THandle): string; 23 24implementation 25 26function SCCLoadViewerDLL(AViewerPath: string): THandle; 27begin 28 if AViewerPath = '' then 29 AViewerPath := 'SCCVW.DLL' 30 else 31 AViewerPath := ExcludeTrailingPathDelimiter(AViewerPath) + '\SCCVW.DLL'; 32 Result := LoadLibraryEx(PChar(AViewerPath), 0, LOAD_WITH_ALTERED_SEARCH_PATH); 33end; 34 35function SCCGetModulePath(AHInststance: THandle): string; 36const 37 FileNameBufSize = 1000; 38var 39 FileName: string; 40begin 41 SetLength(FileName, FileNameBufSize); 42 GetModuleFileName(AHInststance, PChar(FileName), FileNameBufSize); 43 Result := ExtractFilePath(FileName); 44end; 45 46end.