スレッド・プロセス

 ASP.NETからWPFのライブラリを呼び出することができます。Asp.net 動作環境はMTAスレッドですが、WPF は STA スレッドを利用しているから、Asp.net から WPF ライブラリを呼び出す時、下記のような例外が発生します。

呼び出しスレッドは、多数の UI コンポーネントが必要としているため、STA である必要があります。
The calling thread must be STA, because many UI components require this.

上記の問題を回避するため、System.Thread.Thread クラスで、WPF ライブライを動作するための STA スレッドを作成すれば、解決できます。

 Dim thread As System.Threading.Thread = _
  New System.Threading.Thread(_
  New System.Threading.TheadStart(AddressOf GimmeMore))
thread.SetAparmentState(System.Threading.ApartmentState.STA)
thread.Start()

用語:



超多機能のアクセス解析が永久無料!

コメント:



(画像の文字列を入力して下さい)

トップ   編集 凍結 差分 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2019/12/02 (月) 12:44:14 (1627d)

G|Cg|C@Amazon Yahoo yV

z[y[W yVoC[UNLIMITȂ1~] COiq COsیI