G
Guest
Can someone suggest a way to get the functions to match - I am trying to get
file versions, etc info. But its still in unmanaged code as far as I can
find.
VGetFileVersionInfoSizeA' has unbalanced the stack. This is likely because
the managed PInvoke signature does not match the unmanaged target signature.
And should I be using by ref or out for those return values ?? Thanks
public class APICall
{// Private Declare Function GetFileVersionInfoSize Lib "version.dll" Alias
"GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As
Long) As Long
//Private Declare Function GetFileVersionInfo Lib "version.dll" Alias
"GetFileVersionInfoA" (ByVal lptstrFilename As String, ByVal dwHandle As
Long, ByVal dwLen As Long, lpData As Any) As Long
[DllImport("version.dll")]
public static extern long GetFileVersionInfoSizeA(string
lptstrFilename, long lpdwHandle);
[DllImport("version.dll")]
public static extern long GetFileVersionInfoA(string
lptstrFilename, long lpdwHandle, long dwLen, string lpData);
public string extVersionGetFileVersionInfo(string fullFileName)
{
string theVersion = "";
string lpData = "";
long hWnd=0;
try
{ // crash on first API call
long dwLen = GetFileVersionInfoSizeA(fullFileName,
hWnd);
long val = GetFileVersionInfoA(fullFileName, 0, dwLen,
lpData);
}
catch (Exception e)
file versions, etc info. But its still in unmanaged code as far as I can
find.
VGetFileVersionInfoSizeA' has unbalanced the stack. This is likely because
the managed PInvoke signature does not match the unmanaged target signature.
And should I be using by ref or out for those return values ?? Thanks
public class APICall
{// Private Declare Function GetFileVersionInfoSize Lib "version.dll" Alias
"GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As
Long) As Long
//Private Declare Function GetFileVersionInfo Lib "version.dll" Alias
"GetFileVersionInfoA" (ByVal lptstrFilename As String, ByVal dwHandle As
Long, ByVal dwLen As Long, lpData As Any) As Long
[DllImport("version.dll")]
public static extern long GetFileVersionInfoSizeA(string
lptstrFilename, long lpdwHandle);
[DllImport("version.dll")]
public static extern long GetFileVersionInfoA(string
lptstrFilename, long lpdwHandle, long dwLen, string lpData);
public string extVersionGetFileVersionInfo(string fullFileName)
{
string theVersion = "";
string lpData = "";
long hWnd=0;
try
{ // crash on first API call
long dwLen = GetFileVersionInfoSizeA(fullFileName,
hWnd);
long val = GetFileVersionInfoA(fullFileName, 0, dwLen,
lpData);
}
catch (Exception e)