2016-06-07 4 views
1

그래서 Wonderware Archestra IDE 4.1이 있습니다. 기본적으로 서버에서 가장 최신의 2015입니다.Archestra Client Control dll 파일 가져 오기

내 랩톱에서 Visual Studio 2015에서 만든 WordControls라는 C# 클래스 라이브러리가 있습니다. 빌드 할 때 릴리스는 같은 이름의 dll 파일입니다.

내가 복사하고 서버의 문서 폴더에 DLL 파일을 붙여 넣기하고 왼쪽 상단에 마우스를 이동하고이 드릴 다운 한 단순해야한다 : 갤럭시 -> 가져 오기 -> 클라이언트 관리를

그리고 거기에서 내가 만든 DLL 파일을 선택하고 확인을 클릭하십시오. 그런 다음 기본값에서 다시 확인을 클릭하십시오. 그리고 마침내 수입 과정을 거칩니다. 대신에 파일을 가져 오는 것을 제외하고, 나는 약간 다른 것을 얻을 :

그것은을 "처리 파일을 WordControls.dll .... 1 개 파일 (들) 0 객체 (들)의 수입 총" DLL을 가져 오지 못하고 이유를 모르겠습니다. 이전에 2014 년 Archestra 및 Visual Studio 2013에서 작업 한 적이 있기 때문에 잘못했는지 파악할 수 없습니다.

누구나 Archestra IDE의 클라이언트 컨트롤 측면에서 일한 경험이 있습니까? 나는 SMC 로거 볼 때

나는이 두 가지 경고를 얻을 :

Microsoft.Office.Interop.Word, 버전 = 15.0.0.0을, 문화 = 중립, PublicKeyToken = 71e9bce111e9429c 종속 파일이 존재하지 않습니다.

컨트롤이 C : \ Users \ vegeto18 \ Documents \ WordControls.dll에 없습니다.

내 프로그램이 Microsoft.Office.Interop.Word를 사용하여 MS 워드 프로세서를 사용하고 서버에 MS 오피스 (터미널 서버)가 없다는 사실 외에 첫 번째 경고를 어떻게해야할지 모르겠습니다. Intouch보기 응용 프로그램과 함께 배포됩니다).

두 번째 부분은 랩톱에서 복사 한 후 해당 폴더에 붙여 넣은 후 dll이있는 곳이므로 해석 방법을 정확히 알지 못합니다.

using System; 
    using System.Windows.Forms; 
    using Microsoft.Office.Interop.Word; 
    using System.IO; 

    namespace WordControls 
    { 
     public partial class DocBrowser : Form 
     { 
      private System.Windows.Forms.WebBrowser webBrowser1; 
      delegate void ConvertDocumentDelegate(string fileName); 

      public DocBrowser() 
      { 
       InitializeComponent(); 

       // Create the webBrowser control on the UserControl. 
       // This code was moved from the designer for cut and paste 
       // ease. 
       webBrowser1 = new System.Windows.Forms.WebBrowser(); 

       webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill; 
       webBrowser1.Location = new System.Drawing.Point(0, 0); 
       webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); 
       webBrowser1.Name = "webBrowser1"; 
       webBrowser1.Size = new System.Drawing.Size(532, 514); 
       webBrowser1.TabIndex = 0; 

       Controls.Add(webBrowser1); 

       // set up an event handler to delete our temp file when we're done with it. 
       webBrowser1.DocumentCompleted += webBrowser1_DocumentCompleted; 

      } 

      private void Form1_Load(object sender, EventArgs e) 
      { 
       var url = "http://qualityworkbench/ivscripts/qwbcgi.dll/docfetchraw?db=live&id=1090"; 

       LoadDocument(url); 
      } 

      string tempFileName = null; 

      public void LoadDocument(string fileName) 
      { 
       // Call ConvertDocument asynchronously. 
       ConvertDocumentDelegate del = new ConvertDocumentDelegate(ConvertDocument); 

       // Call DocumentConversionComplete when the method has completed. 
       del.BeginInvoke(fileName, DocumentConversionComplete, null); 
      } 

      void ConvertDocument(string fileName) 
      { 
       object m = System.Reflection.Missing.Value; 
       object oldFileName = (object)fileName;    
       object readOnly = (object)false; 
       Microsoft.Office.Interop.Word.Application ac = null; 

       try 
       { 
        // First, create a new Microsoft.Office.Interop.Word.ApplicationClass. 
        ac = new Microsoft.Office.Interop.Word.Application(); 

        // Now we open the document. 
        Document doc = ac.Documents.Open(ref oldFileName, ref m, ref readOnly, 
         ref m, ref m, ref m, ref m, ref m, ref m, ref m, 
         ref m, ref m, ref m, ref m, ref m, ref m); 

        // Create a temp file to save the HTML file to. 
        tempFileName = GetTempFile("html"); 

        // Cast these items to object. The methods we're calling 
        // only take object types in their method parameters. 
        object newFileName = (object)tempFileName; 

        // We will be saving this file as HTML format. 
        object fileType = (object)WdSaveFormat.wdFormatHTML; 

        // Save the file. 
        doc.SaveAs(ref newFileName, ref fileType, 
         ref m, ref m, ref m, ref m, ref m, ref m, ref m, 
         ref m, ref m, ref m, ref m, ref m, ref m, ref m); 

       } 
       finally 
       { 
        // Make sure we close the application class. 
        if (ac != null) 
         ac.Quit(ref readOnly, ref m, ref m); 
       } 
      } 

      void DocumentConversionComplete(IAsyncResult result) 
      { 
       // navigate to our temp file. 
       webBrowser1.Navigate(tempFileName); 
      } 

      void webBrowser1_DocumentCompleted(object sender, 
       WebBrowserDocumentCompletedEventArgs e) 
      { 
       if (tempFileName != string.Empty) 
       { 
        // delete the temp file we created. 
        File.Delete(tempFileName); 

        // set the tempFileName to an empty string. 
        tempFileName = string.Empty; 
       } 
      } 

      string GetTempFile(string extension) 
      { 
       // Uses the Combine, GetTempPath, ChangeExtension, 
       // and GetRandomFile methods of Path to 
       // create a temp file of the extension we're looking for. 
       return Path.Combine(Path.GetTempPath(), 
        Path.ChangeExtension(Path.GetRandomFileName(), extension)); 
      } 

     } 
    } 
+0

DLL에 archestra로 가져올 수있는 유효한 컨트롤이 없다는 불평을하는 것 같습니다. 가져 오는 것은 무엇입니까, 사용자 정의 Form의 일부 유형입니까? Visual Studio 프로젝트를 만들고 컨트롤을 가져 와서 VS에서 작동하는지 확인하십시오. 그렇지 않다면 DLL과 ArchestrA가 아닌 문제입니다. – Grambot

+0

@Grambot 온라인에서 Word 문서를 참조하는 Window 폼을 만듭니다. 필자는 Microsoft.Office.Interop.Word를 해결하기위한 해결책으로 .NET Framework가 가장 최신의 (4.6.1) .NET Framework인지 확인했습니다. 컨트롤에 관한 두 번째 문제는 System.Windows.Forms -> Control.ControlCollection -> Controls와 관련된 것입니다. 나는 System.Windows.Forms와 심지어 System.Windows.Controls.Ribbon이라는 참조를 가지고있다. (정말로 추측하고있다.) – vegeto18

+0

ArchestrA가 가져올 'UserControl'의 인스턴스를 찾는다 고 가정했다. 그것은 DLL을 열고 가져올 아무것도 볼 수 없지만 지금 당장 추측하고있어, 전 결코 Form에서 파생 된 컨트롤을 가져 오려고 시도한 적이 없다. – Grambot

답변

1

내 코드와 아무 문제가 없었다, 그것이 내 프로젝트 유형 :

이 내 코드가 될 것입니다. Visual Studio에서 Window Forms 응용 프로그램으로 작성했습니다. Window Forms 사용자 컨트롤을 사용하기로되어있었습니다. 결국 내 문제가 해결되었습니다.