TwlToolsRED/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/FingerPrinterTWL.cpp
nishikawa_takeshi e4c12c4dc0 フィンガープリンタ:コマンドラインだとDLLがうまく呼び出されないので、環境変数PATHを実行前に一時的に書き換えることにした。
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@264 7061adef-622a-194b-ae81-725974e89856
2009-04-17 12:32:34 +00:00

58 lines
1.3 KiB
C++

// FingerPrinterTWL.cpp : メイン プロジェクト ファイルです。
#include "stdafx.h"
#include "Form1.h"
extern void fingerprintConsole( cli::array<System::String^> ^args );
void setpath();
using namespace FingerPrinterTWL;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
// GUIモードかチェック
bool guimode = false;
for each( System::String ^arg in args )
{
if( arg->StartsWith("-") && (arg->IndexOf('g') >= 0) )
{
guimode = true;
setpath();
break;
}
}
if( (args->Length == 0) || guimode )
{
// コントロールが作成される前に、Windows XP ビジュアル効果を有効にします
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// メイン ウィンドウを作成して、実行します
Application::Run(gcnew Form1());
}
else
{
setpath(); // コマンドライン起動のときにはPATHを設定する
try
{
fingerprintConsole( args );
}
catch( System::Exception ^ex )
{
System::Console::WriteLine(ex->Message);
return -1;
}
}
return 0;
}
// 環境変数PATHの設定
void setpath()
{
System::String ^bindir = System::IO::Path::GetDirectoryName( System::Reflection::Assembly::GetEntryAssembly()->Location );
System::Environment::SetEnvironmentVariable( "PATH", bindir );
}