一个在VB中打开PDF文件的问题
需求:在VB中打开一个*.pdf的文件,操作系统中已经安装了acrobat reader 7.0了。
实现步骤:
1、我首先使用Shell()来打开文件,结果发现,Shell只能执行exe程序。而执行(打开)某个PDF文件报错“无效过程调用或参数”
2、第一种方法实现不了之后,我想用windows API即 ShellExcute函数,因为我在C语言中是可以正常使用的,函数入口在Shell32.lib中。函数原形为
HINSTANCE ShellExecute(
HWND hwnd,
LPCTSTR lpVerb,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
所以在VB中,我这样声明
Private Declare Function ShellExecute Lib "shell32" (ByVal hwnd As Integer, _
ByVal lpVerb As String, ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Integer) As Integer
但是一执行,就报错“找不到 DLL 入口点 ShellExcute in shell32”。
问题:我的代码有什么错误吗?