IntPtr in 64 bits PC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eck3ko
    New Member
    • Mar 2009
    • 6

    IntPtr in 64 bits PC

    Hi everybody! i have a program in c# that use a method inside a c# dll that acts as a proxy to a c++ dll xD this works perfect in a x86 pc but when using in a x64 pc this thing just crash with the next error:

    i think is something about IntPtr any ideas?...


    System.BadImage FormatException : An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
    at DLLProxy.OPCSer ver.CreateOPCSe rver()....

    c# dll:
    Code:
                [DllImport("kOpcClient.dll")]
                static private extern IntPtr CreateOPCServer();
    
                private IntPtr m_pNativeObject;		// Variable to hold the C++ class's this pointer        
    
                public OPCServer()
                {
                    // We have to Create an instance of this class through an exported function
                    this.m_pNativeObject = CreateOPCServer();
                }
    c++ dll:

    Code:
    extern "C" L2KDLL_API CKServer* CreateOPCServer()
    {
    	return new CKServer();
    }
Working...