Anteriormente en VB6 yo declaraba el siguiente API:
Código:
Y para Abrir el PDF ejecutaba el siguiente código:Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Código:
Pero esto en .NET no me funciona, sino que me da el siguiente error:ShellExecute(0, vbNullString, "c:\Archivo.PDF", vbNullString, vbNullString, vbNormalFocus)
Cita:
¿Que puedo hacer para abrir un PDF desde VB.NET 2005? A call to PInvoke function 'LecturaLog!LecturaLog.frmPrincipal::ShellExecute' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
