やりたいことは、「オープンファイルダイアログでOKボタンを押すと、Form1内の
c_printfunc()にファイル名を渡して、c_printfunc()の中でファイル名を出力する」です。
c_printfunc()はCまたはC++形式で記述したいです。

ファイル名の型は、Form1.h内(VC++側)ではString^、c_printfunc.cpp内(C側)では
wchar_t*なので、キャストしてある(つもりです)。

ビルドは正常終了するのですが、実行してオープンファイルダイアログのOKボタン
を押しても何も出力されません。

どうすればファイル名を出力することができますか?よろしくお願いします。

-----Form1.h-----
void c_printfunc(const wchar_t*){}

private: System::Void openFileDialog1_FileOk(System::Object^ sender,
 System::ComponentModel::CancelEventArgs^ e) {
 String^ fname;
 fname = openFileDialog1->FileName;
 pin_ptr<const wchar_t> wch = PtrToStringChars(fname);
 c_printfunc(wch);
}
-----c_printfunc.cpp-----
#include "stdafx.h"
void c_printfunc(const wchar_t* str) {
 printf("%s\n", str);
}
-----環境-----
Windows2000
VisualC++2005ExpressEdition