| 查看: 331 | 回复: 1 | |||
| 当前主题已经存档。 | |||
jiali2843金虫 (正式写手)
|
[交流]
【求助】VC调用VB生成的dll出错,求助
|
||
|
错误信息: Test.cpp C:\Documents and Settings\Owner.LENOVO-52CEDA01\桌面\Test.cpp(23) : error C2664: 'readGAM60Value' : cannot convert parameter 1 from 'char [9]' to 'unsigned short ** ' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast Error executing cl.exe. VB生成的dll见附件 程序代码: #include // This is the path for your DLL. // Make sure that you specify the exact path. #import "d:\project1.dll" no_namespace void main() { BSTR bstrDesc; try { CoInitialize(NULL); // Declare the Interface Pointer for your Visual Basic object. here, // _Class1Ptr is the Smart pointer wrapper class representing the // default interface of the Visual Basic object. _Class1Ptr ptr; // Create an instance of your Visual Basic object, here // __uuidof(Class1) gets the CLSID of your Visual Basic object. ptr.CreateInstance(__uuidof(Class1)); double jiaodu =ptr->readGAM60Value("2330300D" ; } catch(_com_error &e) { bstrDesc = e.Description(); } CoUninitialize(); } [ Last edited by jiali2843 on 2009-9-28 at 09:28 ] |
» 猜你喜欢
征友后感触
已经有10人回复
考博求助
已经有4人回复
憎水剂,表面活性剂
已经有3人回复
申博
已经有7人回复
食品与机械 编辑C处理稿子时间
已经有4人回复
注意啦!用基金购买打印纸、硒鼓、优盘、移动硬盘、个人计算机属于违规了
已经有4人回复

2楼2009-10-02 00:15:28










;
回复此楼