VB.NETでFMIFS.DLL の FormatExを使用したいのですが方法が分かりません。

VB6のサンプルは簡単に見つかるのですが、VB.NETへの移植が出来ませんでした。
やりたいことはVB.NETからのリムーバブルメディアのフォーマットです。
可能であれば他の方法でも構いませんが、SHFormatDriveのようにダイアログが表示されるのはNGです。
プログラマーではないので、なるべくズバリ回答をお願いします。

回答の条件
  • 1人5回まで
  • 登録:
  • 終了:2009/02/24 22:05:03
※ 有料アンケート・ポイント付き質問機能は2023年2月28日に終了しました。

回答1件)

id:rome0315 No.1

回答回数13ベストアンサー獲得回数3

ポイント60pt

環境がなく確認できてないので、間違ってたらすいません。

下記のように宣言してFormatExを呼び出すのではできないでしょうか?



<DllImport("FMIFS.dll")> _

Private Shared Function FormatEx _

(ByVal thePath As String, ByVal theFlag As Int32, ByVal theType As String, ByVal theLabel As String, ByVal theQuickOrNot As

Byte, ByVal theSize As Integer, ByVal theCallBack As FormatExCallBackDelegate)

End Function

id:laphloaig

ご回答ありがとうございます。

私も以下のページを参考に同じ宣言を試しましたが、正しい結果は得られませんでした。

http://bytes.com/groups/net-vb/350924-formatex-function

一見、FormatEXを呼び出しているように見えるのですが、CallBackされるCommandは

「Done」が一回のみ。フォーマットも実行されません。

<DllImport("FMIFS.dll")> _

Private Shared Function FormatEx _

(ByVal thePath As String, ByVal theFlag As Int32, ByVal theType As String, ByVal theLabel As String, ByVal theQuickOrNot As

Byte, ByVal theSize As Integer, ByVal theCallBack As FormatExCallBackDelegate)

End Function

Delegate Function FormatExCallBackDelegate _

(ByVal theCommand As FormatCommand, ByVal theSubAction As

Int32, ByVal theAction As IntPtr) As Boolean

Function FormatExCallBack(ByVal theCommand As FormatCommand, ByVal

theSubAction As Int32, ByVal theAction As IntPtr) As Boolean

2009/02/24 01:34:46

コメントはまだありません

この質問への反応(ブックマークコメント)

「あの人に答えてほしい」「この質問はあの人が答えられそう」というときに、回答リクエストを送ってみてましょう。

これ以上回答リクエストを送信することはできません。制限について

回答リクエストを送信したユーザーはいません