[DllImport("coredll.dll", SetLastError=true)]
private static extern int GetModuleFileName(IntPtr hModule, StringBuilder lpFilename, int nSize);
Declare Function GetModuleFileName Lib "coredll.dll" (TODO) As TODO
None.
Do you know one? Please contribute it!
Taken from OpenNETCF.Reflection.AssemblyEx
Please add some!
class CoreDllWrapper
{
[DllImport("coredll.dll", SetLastError = true)]
public static extern int GetModuleFileName(IntPtr hModule, StringBuilder lpFilename, int nSize);
}
// Will write the current executable's complete path into exePath
StringBuilder exePath = new StringBuilder(1024);
int exePathLen = CoreDllWrapper.GetModuleFileName(IntPtr.Zero, exePath, exePath.Capacity);