纠正: 在Dll中CmdLine is nil所以上面方法不可行! 可能非得从调用的主程序给出,并用Pchar传递给dll.原文: In a program, the CmdLine variable contains a pointer to a null-terminated string that contains the command-line arguments specified when the application was started. Use ParamStr to access individual arguments.In a library (DLL), CmdLine is nil.
这样的。
Sysutils;在过程中使用 path=ExtractFilePath(ParamStr(0))
在Dll中CmdLine is nil所以上面方法不可行!
可能非得从调用的主程序给出,并用Pchar传递给dll.原文:
In a program, the CmdLine variable contains a pointer to a null-terminated string that contains the command-line arguments specified when the application was started. Use ParamStr to access individual arguments.In a library (DLL), CmdLine is nil.