Results 1 to 4 of 4

Thread: ShellExecuteEx problem

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2003
    Posts
    43

    Smile ShellExecuteEx problem

    Hi friends,

    One new problem. Not working the following simple codes.



    SHELLEXECUTEINFO shell;

    // set struct parameters

    shell.cbSize = 1028;
    shell.fMask = SEE_MASK_NOCLOSEPROCESS;
    shell.hwnd = m_hWnd;
    shell.lpVerb = "print";
    shell.lpFile = "C:\Documents and Settings\avaneesh\Desktop\This is Geodesic Company.doc";

    shell.nShow = SW_SHOW;
    shell.hInstApp = AfxGetInstanceHandle();
    shell.lpDirectory = "C:\Documents and Settings\avaneesh\Desktop";
    shell.lpParameters = NULL;

    // print the file
    int val = ShellExecuteEx(&shell);

    DWORD dword = GetLastError();

    //ShellExecuteEx


    Any help?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    What message does GetLastError() give you?

    Look at the docs to see how to get the textual message.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2003
    Posts
    43

    Smile

    Yes that I got and looked in LookUpError and got message as

    "Access denied". It means I am not able to get access to printer which is remote (as I am on LAN). But same time I tried printing a .doc file it prints.

    What you about codes. I find it correct. Then ...?????

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Strange, if it doesn't have permission it should pop up a box asking for a password...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width