传递给系统调用的数据区域太小。 (异常来自 HRESULT:0x8007007A)

Tord_zhang 2008-06-11 09:00:50
[DllImport("pborc90.dll", CharSet = CharSet.Auto)]
public static extern int PBORCA_CompileEntryImportList(IntPtr hORCASession,
[MarshalAs(UnmanagedType.LPArray,
ArraySubType = UnmanagedType.LPStr)] string[] lpszLibraryName,
[MarshalAs(UnmanagedType.LPArray,
ArraySubType = UnmanagedType.LPStr)] string[] lpszEntryName,
EntryType[] otEntryType,
[MarshalAs(UnmanagedType.LPArray,
ArraySubType = UnmanagedType.LPStr)] string[] lpszComments,
[MarshalAs(UnmanagedType.LPArray,
ArraySubType = UnmanagedType.LPStr)] string[] lpszEntrySyntax,
int[] lEntrySyntaxBuffSize,
int iNumberOfEntries,
[MarshalAs(UnmanagedType.FunctionPtr)] CompileEntryDelegate pCompErrorProc,
IntPtr lpUserData);

protected int CompileEntryImportList(IntPtr hORCASession,
string[] lpszLibraryName,
string[] lpszEntryName,
EntryType[] otEntryType,
string[] lpszComments,
string[] lpszEntrySyntax,
int[] lEntrySyntaxBuffSize,
CompileEntryDelegate pCompErrorProc)
{
int res;
IntPtr lpUserData = IntPtr.Zero;
res = Orca_Inco.PBORCA_CompileEntryImportList(hORCASession,
lpszLibraryName,
lpszEntryName,
otEntryType,
lpszComments,
lpszEntrySyntax,
lEntrySyntaxBuffSize, //这个参数有一个值是22128-->传递给系统调用的数据区域太小。 (异常来自 HRESULT:0x8007007A)
lpszLibraryName.Length,
pCompErrorProc,
lpUserData);
return res;
}

//错误

未处理 System.Runtime.InteropServices.COMException
Message="传递给系统调用的数据区域太小。 (异常来自 HRESULT:0x8007007A)"
Source="PowerBuilderCompile"
ErrorCode=-2147024774
StackTrace:
在 Orca_Inco.PBORCA_CompileEntryImportList(IntPtr hORCASession, String[] lpszLibraryName, String[] lpszEntryName, EntryType[] otEntryType, String[] lpszComments, String[] lpszEntrySyntax, Int32[] lEntrySyntaxBuffSize, Int32 iNumberOfEntries, CompileEntryDelegate pCompErrorProc, IntPtr lpUserData)
在 ORCA_Operate.CompileEntryImportList(IntPtr hORCASession, String[] lpszLibraryName, String[] lpszEntryName, EntryType[] otEntryType, String[] lpszComments, String[] lpszEntrySyntax, Int32[] lEntrySyntaxBuffSize, CompileEntryDelegate pCompErrorProc) 位置 E:\net\PowerBuilderCompile0409xs\PowerBuilderCompile\Orca\ORCA_Operate.cs:行号 97
在 ORCA_Operate.ImportEntrys(String[] pLibNames, String applib, String appname, PBEntrys[] pbentryobjs, String ImportPath) 位置 E:\net\PowerBuilderCompile0409xs\PowerBuilderCompile\Orca\ORCA_Operate.cs:行号 540
在 CompileSubmit.ImportSubmitEntry(VersionInfos& mVersionInfos, String AppID, String VerID, Boolean bSpecify, PBEntrys[] TobeBuildSpecify, String[] TobeGetVssSpecify) 位置 E:\net\PowerBuilderCompile0409xs\PowerBuilderCompile\Compile\CompileSubmit.cs:行号 49
在 PowerBuilderCompile.Compile.CompileSubmitFromDataBase(VersionInfos& mVersionInfos, Boolean bSpecify, PBEntrys[] TobeBuildSpecify, String[] TobeGetVssSpecify) 位置 E:\net\PowerBuilderCompile0409xs\PowerBuilderCompile\Compile.cs:行号 286
在 PowerBuilderCompile.Compile.btnGO_Click(Object sender, EventArgs e) 位置 E:\net\PowerBuilderCompile0409xs\PowerBuilderCompile\Compile.cs:行号 177
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
在 System.Windows.Forms.Button.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.Run(Form mainForm)
在 PowerBuilderCompile.Program.Main() 位置 E:\net\PowerBuilderCompile0409xs\PowerBuilderCompile\Program.cs:行号 17
在 System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
...全文
1656 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Tord_zhang 2008-07-11
  • 打赏
  • 举报
回复
楼上的难道是个贱人~?
nec_741 2008-06-19
  • 打赏
  • 举报
回复
hm7921936 2008-06-12
  • 打赏
  • 举报
回复
[DllImport("pborc90.dll", CharSet = CharSet.Auto)]
public static extern int PBORCA_CompileEntryImportList(IntPtr hORCASession,
[MarshalAs(UnmanagedType.LPArray,
ArraySubType = UnmanagedType.LPStr)] string[] lpszLibraryName,
[MarshalAs(UnmanagedType.LPArray,
ArraySubType = UnmanagedType.LPStr)] string[] lpszEntryName,
EntryType[] otEntryType,
[MarshalAs(UnmanagedType.LPArray,
ArraySubType = UnmanagedType.LPStr)] string[] lpszComments,
[MarshalAs(UnmanagedType.LPArray,
ArraySubType = UnmanagedType.LPStr,SizeCount=64)] string[] lpszEntrySyntax,
int[] lEntrySyntaxBuffSize,
int iNumberOfEntries,
[MarshalAs(UnmanagedType.FunctionPtr)] CompileEntryDelegate pCompErrorProc,
IntPtr lpUserData);


protected int CompileEntryImportList(IntPtr hORCASession,
string[] lpszLibraryName,
string[] lpszEntryName,
EntryType[] otEntryType,
string[] lpszComments,
string[] lpszEntrySyntax,
int[] lEntrySyntaxBuffSize,
CompileEntryDelegate pCompErrorProc)
{
int res;
IntPtr lpUserData = IntPtr.Zero;
res = Orca_Inco.PBORCA_CompileEntryImportList(hORCASession,
lpszLibraryName,
lpszEntryName,
otEntryType,
lpszComments,
lpszEntrySyntax,
lEntrySyntaxBuffSize, //这个参数有一个值是22128-->传递给系统调用的数据区域太小。 (异常来自 HRESULT:0x8007007A)
lpszLibraryName.Length,
pCompErrorProc,
lpUserData);
return res;
}



你需要查询API文档[MarshalAs(UnmanagedType.LPArray,
ArraySubType = UnmanagedType.LPStr,SizeCount=64)] string[] lpszEntrySyntax,
int[] lEntrySyntaxBuffSize,
此参数大小设置SIZECOUNT
Tord_zhang 2008-06-12
  • 打赏
  • 举报
回复
我该怎么写啊~
Tord_zhang 2008-06-12
  • 打赏
  • 举报
回复
hm7921936~~~

我只知道那参数是 long 型数组

物品该怎么写啊~
wanabe 2008-06-12
  • 打赏
  • 举报
回复
up

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧