Hello People,
I am struggling to call the MSFL APIs from c#... any help would be much appreciated... I have done the following:
1. created a new class called MSFL and redefined all consts, enums and functions from the MSFL.h file. the functions redefined as follows:
[DllImport("MSFL91.dll", CallingConvention = CallingConvention.StdCall)]
public static extern int MSFL1_Initialize(string pszAppName, string pszUserName, int iInterfaceVersion);
2. if i execute the following logic:
int returnValue;
string string1 = "programName";
string string2 = "userName";
returnValue = MSFL.MSFL1_Initialize(string1, string2, MSFL.MSFL_DLL_INTERFACE_VERSION);
i get the following error:
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
System.BadImageFormatException was unhandled
Message="An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"
Source="AotLT"
StackTrace:
at metastock.MSFL.MSFL1_Initialize(String pszAppName, String pszUserName, Int32 iInterfaceVersion)
at AotLT.Program.Main(String[] args) in C:\Users\bundle\Documents\Visual Studio 2008\Projects\CSharp\AotLT\AotLT\Program.cs:line 97
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
thanks in advance.