Note that there are some explanatory texts on larger screens.

plurals
  1. POORCA Api - C# p/invoke issues
    primarykey
    data
    text
    <p>I'm trying to work with the Powerbuilder ORCA Api from C#, and I'm having some issues with marshaling. <a href="http://pborca.googlecode.com/svn/trunk/pborca11.h" rel="nofollow" title="ORCA 11">Here</a> is the C header file for the ORCA Api, I'm trying to implement the PBORCA_SccGetConnectProperties function, which requires the pborca_scc struct. Here are my definitions:</p> <pre><code>[DllImport(OrcaModule, CharSet = CharSet.Auto)] internal static extern int PBORCA_SccGetConnectProperties(IntPtr ORCASession, [MarshalAs(UnmanagedType.LPWStr)] string Workspace, ref OrcaSccInfo SCCInfo); public delegate int TextOutDelegate( [MarshalAs(UnmanagedType.LPWStr)] string data, int userData); public delegate void BuildProjectDelegate( OrcaBuildError BuildError, IntPtr userData); [StructLayout(LayoutKind.Sequential)] public sealed class OrcaSccInfo { internal IntPtr Wnd = IntPtr.Zero; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] internal string ProviderName = null; internal int Capabilities = 0; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] internal string UserID = null; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 301)] internal string Project = null; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 301)] internal string LocalProjPath = null; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 301)] internal string AuxPath = null; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 301)] internal string LogFile = null; internal TextOutDelegate SccMsgHandler = null; internal BuildProjectDelegate OrcaMsgHandler = null; internal int lCommentLen = 0; internal int lAppend = 0; internal IntPtr CommBlk = IntPtr.Zero; internal int DeleteTempFiles = 0; } </code></pre> <p>When calling the function like so:</p> <pre><code>ret = Interop.PBORCA_SccGetConnectProperties(session.Handle, @"D:\PB11-test\test.pbw", ref scc); </code></pre> <p>I receive a FatalExecutionEngineError with a message that it could be due to marshaling errors. I've gone over this again and again and can't seem to find where I'm making a mistake with how I'm marshaling the function, the struct, or the delegates.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload