2011-09-26 128 views
0

我已經在C#中構建了一個應用程序,並且還爲此應用程序構建了一個安裝程序。在安裝程序上的應用程序適用於所有Windows 7機器,但似乎不適用於任何XP機器。C#應用程序在Win 7上工作但不在XP上

我將簡要描述我的應用程序的功能。

應用程序在啓動時播放swf文件。 swf文件具有3個具有獨立功能的按鈕。 基本上,點擊這些按鈕,它必須顯示從sqlite加載的某些圖像。

問題是,應用程序正確加載swf,swf完全播放直到結束,然後在我已經放置3個按鈕的點擊事件不響應任何按鈕的末尾。 我猜測這是FSCommand的問題和dll文件沒有得到正確

註冊,我已經加入到我的設置中的DLL是

  • AxInterop.ShockwaveFlashObjects.dll
  • Interop.shockwaveFlashObjects。 DLL
  • System.Data.SQLite.dll
  • KP-ImageViewerV2.dll(從codeproject.com)

另外,根據本文件是我的清單文件和.config文件

我試圖註冊手動我的Dll使用RegSrv32 C:\ Interop.ShockwaveFlashObject.dll 並且還C:\ AxInterop.ShockwaveFlashObject.dll 錯誤我得到的是

The (DllPath and Name Here) was loaded but DllRegisterServer entry point was not found. 

,我使用,以顯示我的swf文件的代碼如下

private void axShockwaveFlash1_FSCommand(object sender,AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e) 
{ 
    string btn = e.command.ToString(); 
    if (btn == "play") 
    { 
     try 
     { 
     frmMain Main = new frmMain(); 
     Main.Show(); 
     this.Hide(); 
     } 
     catch (Exception ex) 
     { MessageBox.Show(ex.ToString()); } 
     } 
     if (btn == "syllabus") 
     { 
     SQLiteConnectionStringBuilder strbldr = new SQLiteConnectionStringBuilder(); 
     strbldr.DataSource = @Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\TVC E-Excust Customs\\E-ExcustCustoms.s3db"; 
     SQLiteConnection con = new SQLiteConnection(strbldr.ConnectionString); 
     con.Open(); 
     Syllabus_usageInformation syl = new Syllabus_usageInformation(this); 
     SQLiteCommand cmd = new SQLiteCommand("SELECT ImageFiles FROM misc WHERE Name='Syllabus new'", con); 
     SQLiteDataReader reader = cmd.ExecuteReader(); 
     byte[] imageBytes = null; 
     while (reader.Read()) 
     { 
      imageBytes = (System.Byte[])reader["ImageFiles"]; 
     } 

     MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length); 
     con.Close(); 
     syl.kpImageViewer1.OpenButton = false; 
     syl.kpImageViewer1.Image = (Bitmap)Image.FromStream(ms,true); 
     syl.kpImageViewer1.Zoom = 85; 
     syl.Show(); 
     this.Hide(); 
     } 
     if (btn == "usageInformation") 
     { 
      SQLiteConnectionStringBuilder strbldr = new SQLiteConnectionStringBuilder(); 
      strbldr.DataSource = @Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\TVC E-Excust Customs\\E-ExcustCustoms.s3db"; 
      SQLiteConnection con = new SQLiteConnection(strbldr.ConnectionString); 
      con.Open(); 
      Syllabus_usageInformation syl = new Syllabus_usageInformation(this); 
      SQLiteCommand cmd = new SQLiteCommand("SELECT ImageFiles FROM misc WHERE Name='UsageInformation'", con); 
      SQLiteDataReader reader = cmd.ExecuteReader(); 
      byte[] imageBytes = null; 
      while (reader.Read()) 
      { 
       imageBytes = (System.Byte[])reader["ImageFiles"]; 
      } 

      MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length); 
      con.Close(); 
      syl.kpImageViewer1.OpenButton = false; 
      syl.kpImageViewer1.Image = (Bitmap)Image.FromStream(ms, true); 
      syl.kpImageViewer1.Zoom = 82; 
      syl.Show(); 
      this.Hide(); 

     } 
    } 

我的swf文件有三個按鈕爲ABO提到五個。這些按鈕位於影片剪輯中,我將粘貼AS代碼 以下是其中一個按鈕發生的情況。剩下的2個與這個只更改值相同。 我對閃光很新,但可能會出現這個問題,因爲所使用的AS版本或運行此swf所需的最低版本的閃存。只是再次提到視頻播放,但按鈕是無法在XP響應,但在7?

on (rollOver) 
{ 
if (_root.link != page) 
{ 
    this.gotoAndPlay("s1"); 
} 
} 
on (releaseOutside, rollOut) 
{ 
if (_root.link != page) 
{ 
    this.gotoAndPlay("s2"); 
} 
} 
on (press) 
{ 
    fscommand("syllabus","syll"); 
} 

如果有人需要更多的解釋或更多的代碼或只是整個項目讓我知道會發送該項目。 我在這裏解決方案,所以任何幫助將不勝感激。

+1

您是否閱讀過文檔以查看所有提及的庫是否與Windows XP兼容? –

+0

您是否在兩個系統中使用相同的.NET Framework版本? – atzu

+0

請確保版本。網絡框架是相同的兩臺機器 – Prasanth

回答

0

好的問題已解決..net 4.0中存在一些問題。我發現這是因爲我搜索了一些關於我的問題的谷歌搜索,我不記得我搜索過的搜索,但它返回了2個結果!其中之一進行了交談,一些VS人和一位用戶在談論他遇到的問題,這與我的相似。 VS的傢伙一致認爲問題確實是在4.0,他們會糾正這個問題。似乎我浪費了很多時間。

相關問題