Trouble using CALL SHELL()


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

View Poll Results: Was this helpful?

Voters
0. You may not vote on this poll
  • Yes

    0 0%
  • No

    0 0%
Results 1 to 5 of 5

Thread: Trouble using CALL SHELL()

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    Virginia Beach, VA
    Posts
    3

    Trouble using CALL SHELL()

    I found and pasted the code called "Alternative to VB's Shell Function" into my application from this site. The SHELL command will not open a PDF file! Is Adobe doing something strange to their files that will not allow them to open? I am getting the path and file name from the Common Dialog Control. The weird thing is, I can right click the file in the CDC and choose "open with Acrobat..." and the file opens. If I left click the file and choose OPEN, I get nothing. If I pass the PATH to your SHELL command, I get nothing. If I pass "...system32\calc.exe" to your SHELL command I get the Windows Calculator, no problem. Any ideas?

  2. #2
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    can you post the url where you found the code?
    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  3. #3
    Join Date
    Sep 2005
    Location
    Virginia Beach, VA
    Posts
    3

  4. #4
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    this works fine with me:

    Private 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
    Private Const SW_SHOW = 5


    ShellExecute 0, "open", "C:\MyFolder\MyPDFFile.pdf", vbNullString, vbNullString, SW_SHOW

    check that: 1) you are passing the full path name and that 2) the .pdf files have Acrobar Reader as the default application. For the second point, try to double click on a pdf file as see if it opens ok. If not, select Acrobat Reader from the list of applications and select it as the default.

    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  5. #5
    Join Date
    Sep 2005
    Location
    Virginia Beach, VA
    Posts
    3

    Thanks!!!

    That worked great and I thank you very much.

Similar Threads

  1. Learning Help
    By Carlos in forum Java
    Replies: 3
    Last Post: 07-31-2005, 05:17 PM
  2. syntax to call procedure inside a procedure in db2
    By anshulsarabhai in forum Database
    Replies: 1
    Last Post: 07-08-2005, 02:08 PM
  3. Shell Program
    By none_none in forum C++
    Replies: 13
    Last Post: 04-19-2005, 05:20 PM
  4. NetUserEnum Api
    By Mike in forum VB Classic
    Replies: 2
    Last Post: 04-24-2000, 03:30 PM
  5. NetUserEnum Api
    By Mike in forum VB Classic
    Replies: 0
    Last Post: 04-24-2000, 03:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center