locked
Open a .pdf file RRS feed

  • Question

  • Hi,

    Can I open a .pdf file on Pocket Pc with a C++ application? If yes, how?

    Tuesday, June 23, 2009 8:37 AM

Answers

  • Yes but only if You have installed Adobe PDF Reader Mobile.
    Normally PDFs aren't supported by any means.
    If You'll find my answer satisfactory or helpful - mark it as answered! Thank You. PS. Votes also doesn't hurt :).
    Tuesday, June 23, 2009 9:19 AM
  • There is no ShellExecute(). You have to use ShellExecuteEx(). It should be
    obvious that this will only work if there is an application registered to
    handle files with the .pdf extension. Also, you should note that just
    because a given API call is in shell32.dll on your PC, it does NOT mean that
    it will be in a DLL with the same name in Windows CE (it won't). Don't use
    anything to try to tell the compiler what DLL to use. Just link normally
    and the code should work.

    As to your little code there, no, you can't use that. There's no such thing
    as "c:" on any Windows CE device. Drive letters are not used.

    Paul T.

    "johntayback" <=?utf-8?B?am9obnRheWJhY2s=?=> wrote in message
    news:cd7f76f0-3d21-4353-8535-6d927d2ff0cc...
    > Ca I use
    > ShellExecuteEx("c:\\test.pdf");?


    Tuesday, June 23, 2009 3:30 PM
  • How would I know where the file is on YOUR device? As long as you
    understand that there are no drive letters and that everything is branched
    off of the root folder, \, that's about all we can tell you.

    Paul T.

    "johntayback" <=?utf-8?B?am9obnRheWJhY2s=?=> wrote in message
    news:9af88deb-fe5f-4423-86b3-6f05f565c87c...
    > which path has one to put on a pocket pc?


    Wednesday, June 24, 2009 4:22 PM

All replies

  • Can I use "ShellExecuteEx()"?
    Tuesday, June 23, 2009 8:40 AM
  • Yes but only if You have installed Adobe PDF Reader Mobile.
    Normally PDFs aren't supported by any means.
    If You'll find my answer satisfactory or helpful - mark it as answered! Thank You. PS. Votes also doesn't hurt :).
    Tuesday, June 23, 2009 9:19 AM
  • But I've no interface with my evc++ app, I used a Flash application for the interface.

    Can I do that ?
       
    ShellExecute(0,
         "open",
        "c:\\test.pdf",
        NULL,
        NULL,
        SW_SHOWNORMAL);


    Tuesday, June 23, 2009 9:22 AM
  • I've this error : error C2065: 'ShellExecute' : undeclared identifier

    My declaration :

    #include <shellapi.h>
    #pragma comment(lib,"shell32.lib")


        LoadLibrary("shell32.dll");

        ShellExecute(NULL,
         "open",
        "c:\\test.pdf",
        NULL,
        NULL,
        SW_SHOWNORMAL);

    Where is my error?
    Tuesday, June 23, 2009 9:31 AM
  • Ca I use
    ShellExecuteEx("c:\\test.pdf");?
    Tuesday, June 23, 2009 1:35 PM
  • There is no ShellExecute(). You have to use ShellExecuteEx(). It should be
    obvious that this will only work if there is an application registered to
    handle files with the .pdf extension. Also, you should note that just
    because a given API call is in shell32.dll on your PC, it does NOT mean that
    it will be in a DLL with the same name in Windows CE (it won't). Don't use
    anything to try to tell the compiler what DLL to use. Just link normally
    and the code should work.

    As to your little code there, no, you can't use that. There's no such thing
    as "c:" on any Windows CE device. Drive letters are not used.

    Paul T.

    "johntayback" <=?utf-8?B?am9obnRheWJhY2s=?=> wrote in message
    news:cd7f76f0-3d21-4353-8535-6d927d2ff0cc...
    > Ca I use
    > ShellExecuteEx("c:\\test.pdf");?


    Tuesday, June 23, 2009 3:30 PM
  • which path has one to put on a pocket pc?
    Wednesday, June 24, 2009 6:42 AM
  • How would I know where the file is on YOUR device? As long as you
    understand that there are no drive letters and that everything is branched
    off of the root folder, \, that's about all we can tell you.

    Paul T.

    "johntayback" <=?utf-8?B?am9obnRheWJhY2s=?=> wrote in message
    news:9af88deb-fe5f-4423-86b3-6f05f565c87c...
    > which path has one to put on a pocket pc?


    Wednesday, June 24, 2009 4:22 PM

  • Imports System.IO
        Declare Function ShellExecuteA Lib "shell32.dll" ( _
         ByVal hWnd As IntPtr, _
         ByVal lpOperation As String, _
         ByVal lpFile As String, _
         ByVal lpParameters As String, _
         ByVal lpDirectory As String, _
         ByVal nShowCmd As Integer) As IntPtr

    Private Sub Button13_Click(sender As System.Object, e As System.EventArgs) Handles Button13.Click
     Dim DocName As String

            DocName = TextBox2.Text + ".pdf"
            ShellExecuteA(vbNull, "Open", DocName, vbNull, "E:\pictures", SW_SHOWNORMAL)
    End Sub

    Tuesday, December 22, 2015 6:26 AM