Rank: Member
Groups: Registered, Registered Users Joined: 2/23/2006(UTC) Posts: 11
|
Hello People,
I am struggling to call the MSFL A[censored] 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.
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 2/23/2006(UTC) Posts: 11
|
for anyone that cares, i was building a console appl in windows7 64bit so by defauly my console appl was 64bit, forced this to 32bit and it worked fine. happy days.
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.