/Sources/scclink.pas

http://github.com/Nashev/OracleOutsideIn4Delphi · Pascal · 46 lines · 26 code · 6 blank · 14 comment · 1 complexity · 88c557d9999f919f950520afcea73c72 MD5 · raw file

  1. unit scclink;
  2. interface
  3. uses
  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. { Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. }
  19. function SCCLoadViewerDLL(AViewerPath: string): THandle;
  20. function SCCGetModulePath(AHInststance: THandle): string;
  21. implementation
  22. function SCCLoadViewerDLL(AViewerPath: string): THandle;
  23. begin
  24. if AViewerPath = '' then
  25. AViewerPath := 'SCCVW.DLL'
  26. else
  27. AViewerPath := ExcludeTrailingPathDelimiter(AViewerPath) + '\SCCVW.DLL';
  28. Result := LoadLibraryEx(PChar(AViewerPath), 0, LOAD_WITH_ALTERED_SEARCH_PATH);
  29. end;
  30. function SCCGetModulePath(AHInststance: THandle): string;
  31. const
  32. FileNameBufSize = 1000;
  33. var
  34. FileName: string;
  35. begin
  36. SetLength(FileName, FileNameBufSize);
  37. GetModuleFileName(AHInststance, PChar(FileName), FileNameBufSize);
  38. Result := ExtractFilePath(FileName);
  39. end;
  40. end.