|
试图用SFmpq.dll来创建和打开MPQ文件~~可是怎么都不行~~
[codes=vb]
' MpqOpenArchiveForUpdate flags
Public Const MOAU_CREATE_NEW As Long = &H0
Public Const MOAU_CREATE_ALWAYS As Long = &H8 'Was wrongly named MOAU_CREATE_NEW
Public Const MOAU_OPEN_EXISTING As Long = &H4
Public Const MOAU_OPEN_ALWAYS As Long = &H20
Public Const MOAU_READ_ONLY As Long = &H10 'Must be used with MOAU_OPEN_EXISTING
Public Const MOAU_MAINTAIN_LISTFILE As Long = &H1
Declare Function MpqOpenArchiveForUpdate Lib "SFmpq.dll" (ByVal lpFileName As String, ByVal dwFlags As Long, ByVal dwMaximumFilesInArchive As Long) As Long
[/codes]
简单地调用
[codes=vb]
MpqOpenArchiveForUpdate("111.mpq",MOAU_CREATE_NEW,&H40000)
[/codes]
然后就华丽地提示我:
检测到 PInvokeStackImbalance
Message: 对 PInvoke 函数“VBsSF!VBsSF.Win32::MpqCreateArchive”的调用导致堆栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标签名是否匹配。
用用C#也这个提示~~
[codes=c#]
[DllImport("SFmpq.dll", CharSet=CharSet.Auto,CallingConvention=CallingConvention.StdCall)]
public static extern long MpqOpenArchiveForUpdate(string lpFileName, long dwFlags, long dwMaximumFilesInArchive);
MpqOpenArchiveForUpdate("111.mpq", 0x4, 0x40000)
[/codes]
其实我是先用C#不行才去用VB的55~~暗暗~~谁来帮帮忙~~ |
|