Advertisement
Guest User

Untitled

a guest
Feb 8th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.78 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.InteropServices;
  5. using System.Text;
  6. using DWToolkit;
  7.  
  8. namespace PremierExportDocument
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             // DWTKGetSessionHandle
  15.             long DWTKGetSessionHandleResult = -1;
  16.             long hWndParent = 0;
  17.             IntPtr lplToolKitSessionHandle = IntPtr.Zero;
  18.  
  19.             DWTKGetSessionHandleResult = DWTKDLL.DWTKGetSessionHandle(
  20.                 in hWndParent,
  21.                 out lplToolKitSessionHandle
  22.             );
  23.  
  24.             if(DWTKGetSessionHandleResult == 0)
  25.             {                
  26.                 long lToolKitSessionHandle = lplToolKitSessionHandle.ToInt64();
  27.  
  28.                 // DWTKStartDocuWare
  29.                 long DWTKStartDocuWareResult = -1;
  30.                 string lpszDWUserName = "admin";
  31.                 string lpszDWPassWord = "admin";
  32.                 uint uiTimeOutInSeconds = 50;
  33.  
  34.  
  35.  
  36.                 DWTKStartDocuWareResult = DWTKDLL.DWTKStartDocuWare(
  37.                     lToolKitSessionHandle,
  38.                     lpszDWUserName,
  39.                     lpszDWPassWord,
  40.                     uiTimeOutInSeconds
  41.                 );
  42.  
  43.                 // DWTKOpenArchive
  44.                 long DWTKOpenArchiveResult = -1;
  45.                 string lpszArchive = "safety";
  46.                
  47.  
  48.                 DWTKOpenArchiveResult = DWTKDLL.DWTKOpenArchive(lToolKitSessionHandle,  lpszArchive);
  49.  
  50.                
  51.  
  52.  
  53.                 // Last run
  54.                 long DWTKFreeSessionHandleResult = -1;
  55.  
  56.                 DWTKFreeSessionHandleResult = DWTKDLL.DWTKFreeSessionHandle(
  57.                     lToolKitSessionHandle
  58.                 );
  59.  
  60.  
  61.  
  62.             }
  63.  
  64.         }
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement