runtime error coming while using MarshalAs attribute
int FWCreateStore(char *path, PCSStore *ppStore, CSPDB **ppDB)
where : # define CSPStore *PCSStore
and CSPStore and CSPDB are two classes whose data members are another class pointers or simply ints or chars.
This is there inside the DLL "FWrap"
Now , come to C# file from where i am calling this function . Here I have included it like this :
[DllImport("FWrap")]
[return:MarshalAs(UnmanagedType.U4) ]
public static extern int FWCreateStore(
[MarshalAs(UnmanagedType.LPStr)] string path,
[MarshalAs(UnmanagedType.LPStruct)] out IntPtr ipStore,
[MarshalAs(UnmanagedType.LPStruct)] out IntPtr ipDB);
internal class F4
{
IntPtr pStore;
static IntPtr pDB;
string DbPath;
internal FlaimError.Error CreateStore()
{
FError.Error rc = FError.Error.FERR_FAILURE;
lock (handleTable)
{
rc = (FError.Error) FWCreateStore(DbPath, out pStore, out pDB);
}
}
}
-- This code compiles . When i run my application then I am getting this exception :
System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal 'parameter #3': Invalid managed/unmanaged type combination (Int/UInt must be paired with SysInt or SysUInt).
at FWCreateStore(String path, IntPtr& ipStore, IntPtr& ipDB)
Can anyone tell me , what wrong i am doing with 3rd parameter passing.
Or if you can write a sample code , how to pass object pointers pointing to class . I tried taking help from MSDN links about MarshalAs attribute but they have not written any example (about passing object pointers) .
Any light in the tunnel . pl
thanks in advance ,
Anil.

