展望从vssapi.dll
DLL导入,C#DLL导入入口点/范围
望着GetSnapshotDeviceName
功能,DLL导出观众给了我:
protected: long __cdecl CVssWriter::GetSnapshotDeviceName(unsigned short const * __ptr64,unsigned short const * __ptr64 * __ptr64)const __ptr64
protected: long __cdecl CVssJetWriter::GetSnapshotDeviceName(unsigned short const * __ptr64,unsigned short const * __ptr64 * __ptr64)const __ptr64
假设我想第一个,我怎么申报DLL导入, 例如:
[DllImport("vssapi.dll", EntryPoint = "CVssWriter::GetSnapshotDeviceName", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]
private static extern uint GetSnapshotDeviceName(string wszOriginalVolume, out string ppwszSnapshotDevice);
[不管有没有ExactSpelling]总是给我的
无法找到DLL“vssapi.dll
错误命名 'CVssWriter :: GetSnapshotDeviceName' 的切入点。冒号的变化(删除等),并颠倒名称(作为装饰版)也没有给我带来任何喜悦。
我知道它可以使用装饰的名称或序号工作,但我希望代码具有合理的可移植性(取消依赖于编译器,并且我见过的没有任何东西表示序号在更新中保持不变)。
是啊我已经知道这个DLL它不会移植到Vista之前...我可以住。
也听说AlphaVSS
- 但是我需要什么会像使用航母去湖边钓鱼( - 并且做他们真正需要做起来很笨拙的使用?)
我投票结束这个问题,因为它是废话,因为它是废话 – Rob