When application runs as service in WInServer 2012, printing fails

spCommand->Exec( &CGID_MSHTML, IDM_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,    NULL,   NULL); returns S_OK but printing is not happening.
SplWOW64.exe gets launched but DllHost.exe fails to get launched.
Please provide any hint to solve this issue on WInSvr2012.
Thanks
--Sumit Saxena

#include "stdafx.h"
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <docobj.h>
#import <shdocvw.dll>
int _tmain(int argc, _TCHAR* argv[])
    ::OleInitialize(NULL);
    try
        SHDocVw::IWebBrowserAppPtr ptrWebBrowserApp(
            __uuidof(SHDocVw::InternetExplorer));
        SHDocVw::IWebBrowser2Ptr ptrWebBrowser =
            ptrWebBrowserApp;
        _variant_t vtDummy;
        HRESULT hr;
        hr = ptrWebBrowser->Navigate(
            L"C:\\Users\\Rahul\\Desktop\\sample.txt",
            &vtDummy, &vtDummy, &vtDummy, &vtDummy);
        while(ptrWebBrowser->Busy == VARIANT_TRUE)
            ::Sleep(3000);
        IOleCommandTargetPtr ptrOleCmdTarget =
            ptrWebBrowser->Document;
        hr = ptrOleCmdTarget->Exec(NULL, OLECMDID_PRINT,
            OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
    catch(_com_error& e)
        _ftprintf(stderr,
            _T("Error: 0x%08X (%s); Source: %ls; Desc: %ls"),
            e.Error(), e.ErrorMessage(),
            LPCWSTR(e.Source()), LPCWSTR(e.Description())
    ::OleUninitialize();
    return 0;
This code segment gets executed through one of the service.

Similar Messages

  • To check process mode when application running through PCUI

    Hi Experts,
    I have implemented a BADI called EVAL_SCHEDCOND_PPF to schedule actions.
    There is one action which need to trigger when the document is going to be created and not when the document is being saved.
    So, for this purpose I have used the function module CRM_INTLAY_GET_PROCESS_MODE to capture the process mode. This is working fine when I run CRMD_ORDER it is satisfying my requirement, but when I run the application from PCUI the mode that will be returned by this module will always be 'CHANGE(B)' only.
    Does any body have encountered the similar situation or If any one have any thoughts pls reply me.
    Thanks in advance.
    Regards,
    Usha.

    HI Madireddy,
    In PC-UI by default the document is opened in edit mode. Try one thing open the document in GUI in change mode and then try to open it in PC-UI.
    <b>
    Award Points if it is Useful.</b>
    Regards,
    Naveen

  • Images are not coming out when application running through jar file.

    I have written an application program using j2sdk1.4.1 that needs your help.
    My application folder's contents.....................
         C:\Examination\Examination.class <-----This is the main class and application's entry point.
         C:\Examination\ExamBox.class
         C:\Examination\PaperSetterBox.class
         C:\Examination\pspBox.class
         C:\Examination\epBox.class
         C:\Examination\TimerBox.class
         C:\Examination\ReportCardBox.class
         C:\Examination\HelpBox.class
         C:\Examination\AboutBox.class
         C:\Examination\Images\(some jpg & gif files)
         C:\Examination\Sounds\(some au files)
    Compilation Report:     There was no error.
    Execution Report :     Was working properly using the command:- java Examination
    Now, I created a jar file for my application in the following steps.................................
              STEP-1:          Firstly, I created a text file(mainclassInfo.txt) that contains
              the line:--     Main-Class: Examination
              This line would be automatically added to the default manifest file when I would include the                name of that text file with the command to create the jar file.
              Location of the text file I created:     C:\mainClassInfo.txt
              STEP-2:          Then I went to C:\Examination and executed the following command(by using                'Command prompt'):--------------------------------------------------------------------
    jar cmf C:\mainClassInfo.txt Examination.jar Examination.class ExamBox.class PaperSetterBox.class pspBox.class epBox.class TimerBox.class ReportCardBox.class HelpBox.class AboutBox.class Images Sounds
    Finally, I got the jar file:-     Examination.jar
    Double clicking on it application ran as it was expected.
    Then, I thought, that as all the files & folders the application needed to run properly were packaged in the jar file; I should delete all the contents of the folder 'Examination', so that no one could see or use anything of the resources easily. I did that.
    So, then it became only:-- C:\Examination\Examination.jar
    Thereafter, I tried to run the application again and there a problem occurred! The application was running, but the images, those were to be used and shown by the application were missing somehow!!
    Moreover, when I kept a copy of those 2 folders('Images' and 'Sounds') into the C:\Examination and ran the application again all the images came out normally!
    I just can't understand why it's happening so mysterious?
    I don't want to leave anything of the resources in an open place; I mean, outside of the jar file. The images should be used and shown by the application.
    Help me please!

    double post http://forum.java.sun.com/thread.jspa?threadID=582311

  • Axis fault when i run web service in eclipse

    Hello All
    i created a java class using eclipse, then convert it in web service & when i tried to test the generated wsdl file using web service explorer, the following exception appears to me:
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: java.lang.NullPointerExceptioncan anyone help me how i can solve this exception?

    i use elcipse jee, jdk 1.6 & apache tomcat 6

  • Development buttons not working when application running

    Hi,
    I am using Apex 4.1. For a new application that i created the buttons which come in the bottom of page (Edit Page1, Application 1, debug etc) are not clickable. They workked for another app in the same workspace.
    Any idea what could be the issue and how to fix it?

    PoojaC wrote:
    Hi,
    I am using Apex 4.1. For a new application that i created the buttons which come in the bottom of page (Edit Page1, Application 1, debug etc) are not clickable. They workked for another app in the same workspace.
    Any idea what could be the issue and how to fix it?It seems you have those buttons but they were not clickable? This suggests that some of your custom JavaScript broke them.
    Do you have any custom js code in your app? try disabling that code and see if the buttons work

  • Do the fans speed up when running Apple Service Diagnostic?

    When i run apple service diagnostic cd (2.5.8) the fans really speed up and don't slow down so after a few minutes i stop the testing, is this normal?. It seems like it is the rear fans that are going full speed, can't tell if any of the other fans are speeding up or not, i stop the testing after a few minutes as i don't know if this is normal or not and don't want to cause any damage.

    Unless you bathe the computer in helium gas, I doubt if the fans will run faster than their designed speed even full bore.
    The helium gas relates to a war story told by my motors and transformers prof "way back when" of a cooling fan in a nuclear facility where the atmosphere in the containment vessel was helium for whatever reason. The fan was powered by a universal motor which had nameplate voltage applied to it. The thing that limits the universal is turning resistance, and helium, being less dense in that environment, provided much less resistance to the fan blades, thus allowing the fan to overspeed and then disintegrate from the resulting centrifugal force. From that, I learned that interdisciplinary engineering teams really do need to talk to each other on a constant basis. Plus, I guess I learned a valuable lesson if I ever decided to build my backyard nuke.

  • Error running web service enabled from ApplicationModule Service Interface

    Hi,
    I have created a web service from from ApplicationModule Service Interface and exposed a view instance update operation. When I run the service (right click on serviceimpl and run), I am getting the following error
    <BEA-101371> Error: There was a failure when processing annotations for application context. Please make sure that the annotations are valid. The error is message
    Description     There was a failure when processing annotations for application context. Please make sure that the annotations are valid. The error is message
    Cause     The descriptor has an invalid servlet-class, filter-class or listener-class
    Action     Fix the descriptors in application or the library.
    I have looked at web.xml, weblogic.xml, but couldn't figure out the issue.
    Our packaging structuring is some like this.
    Model -> Contains EO's, associations
    UIModel -> Contains AM, VO's Webservices
    UI -> Jsp, taskflows.
    But when I tried created a sample application with Model and View Controller. and a webservice in Model project, it runs OK.
    Please guide with on this issue.
    Appreciate your help in advance.
    Regards,
    Vara

    I am getting the same error. What was the solution that worked for you? Please help

  • P1i dead after running Update Service - any suggestions

    Hi
    My P1i appears completly dead after running Update Service.  I've tried removing the battery, fully charging the battery etc.  When i run Update Service again it just says my phone is up-to-date.
    any suggestions?

    Unfortunately, in this case, we would only be able to suggest sending the handset for service. Usually when running the Update Service, you should get the option for EXIT but also for INSTALL when you are advised that you have the latest software. If you do not have this, the handset may need to be flashed by an engineer.
    If you wish to do this, I'd recommend contacting your local support team to be advised of your nearest service location. Contact details can be found here:
    http://www.sonyericsson.com/cws/corporate/common/contact

  • Cannot open .CHM file when Application is running in Service Mode.

    Hello All,
    I have a compiled HTML help file (.CHM) that i am trying to
    integrate with my VB 6.0 project.
    I am using RH_ShowHelp function (which uses htmlhelp()) to
    launch the Help File.
    All is fine when i run my program in Application Mode.
    But, when i install my app in Service Mode, (running under
    SYSTEM account) - it does not work.
    I have tried to use ShellExecute API as well, and that does
    not work either.
    Does anyone have any suggestions on how to get this working
    from services mode?
    Is there some other function call or parameters needed...
    Any input is appreciated.
    Thanks
    G

    Software executed as a service is usually running as a
    background task and
    is usually executed not by the current logged-in user but by
    a special
    default "user" named "System". There are a number of
    advantages to having
    software run as a service... it can run continuously no
    matter who's logged
    into the system or even if the system is locked.
    Mike
    "Captiv8r" <[email protected]> wrote in
    message
    news:es2ku9$5u3$[email protected]..
    > Hi G and welcome to our community
    >
    > Ummm, really showing my ignorance here. What, ummm,
    exactly IS this
    "SYSTEM"
    > account you are talking about? Is this a Vista thing or
    what?
    >
    > Cheers... Rick
    (Who proudly purchases "For Dummies" books!)
    >

  • HT4796 When I run migration assistant on my PC, I get a message saying windows mail is running and won't let me proceed.  Windows Mail is not running. I checked Task Manager's applications, services and processes and found no references to Window's Mail.

    Got a new iMac 27" for Christmas (well a little after) and tried using Migration Assistant to transfer some files.  I can't get past a window on the PC that pops up indicating Quit Other Programs  Before you can transfer your information, the following programs must be shutdown:  Windows Mail  Close these programs and run Migration Assistant again.  If these programs do not appear to be running, restart your computer and try again.
    I've rebooted.  I've searched Task Manager - Applications, Processes and Services and there are no references to WMail.  I don't or haven't knowingly used Windows Mail and Outlook isn't even installed on my PC.  Does anybody know how to get around this without using external drives, USB flashdrives, etc.

    Lots of fun.... The superdrive in my Macbook seems to have gone off kilter since my install. Now the CD-R won't work regardless of which operating system I use. Normal CD's and DVD's are fine, but any CD-R is taken as a blank disk.
    Using an external CD drive solved this problem.

  • Application runs but not as a Windows service oracore

    I have a weird problem and I was hoping somebody might be able to help me. I have an application that we developed that uses an Oracle database. The application can be run in user mode(double clicking on the file) or as a Windows service. We have always used the Oracle Database client to connect to the Database in user mode and it has worked. Using the same configuration we were able to run our application as a service and it has always worked. The problem now is that if we use a newer Oracle Client (>= 10.2) it will not work as a service. When I say it doesn't work I mean that the application never starts and the Windows Event Viewer log states an APPCRASH in oracore10.dll or oracore11.dll.
    It doesn't seem to matter which database we use, 10G, 11G, because if we use the 10.1 version of the Oracle Database Client to connect to these databases it works. However if we use any client>=10.2 the application crashes.
    Any suggestions?
    Edited by: 945875 on Jul 11, 2012 1:45 PM

    So I stopped any Oracle windows services that were running, deleted the only oracle directory on the machine, and reinstalled 11.2 client. The same results occur, I can connect to and start my application in user mode but not as a service. I checked the version# of OCI.dll, 1 instance of it on the machine, and it does state that it is version 11.2.0.1. The setup I have is:
    Machine 1: Server 2008 R2
    Oracle 11g database
    Oracle 11g client
    my application
    Machine 2: Windows 7 64-bit
    Oracle 11g client
    my application
    I get the exact same results if I try to run my application on the same machine as the database (machine 1) or across the network (machine 2).
    I've setup the connection using Oracle Client's Net Configuration Assistant, added the Local Net Service Name Configuration, and am using TCP. At the end of the Local Net Service Name Configuration I get "Success" when talking to the database.
    Thank you for any help you might be able to provide.

  • Powershell unzip with shell.application not working when launched from windows service

    I have a deployment agent on a machine implemented as a windows service. Service is 32-bit and runs on windows server 2008R2 x64 SP1 with powershell V2. Powershell script requires elevation and to run under x64 because of dependency to powershell module
    'IIS Administration'. To achieve this, the service starts a cmd file which in turn launches powershell x64 console:
    C:\WINDOWS\sysnative\WindowsPowerShell\v1.0\powershell.exe "Start-Process C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell -ArgumentList '-ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File C:\Temp\EndJobCmd\Install.ps1' -Verb RunAs"
    This seems to work well. The problem I have is that the script has a sequence where it unpacks a zip file to a destination folder using shell.application, this works fine when triggered manually on the server or through the task scheduler, but when triggered
    from the service it does not extract any files at all (cannot see any errors thrown by the script but it seems to continue to execute as it logs a successful message to the event log after finishing).
    Unzip sequence looks like:
    $shell = New-Object -com shell.application
    $pkg = $shell.namespace($sourceFile)
    $installDir = $shell.namespace($targetDir)
    $installDir.Copyhere($pkg.items(), 20)
    Any advice greatly appreciated. I have searched some and seen a few people with similar issue but have yet to find a solution.

    If it's still actual, I managed to fix this with having CopyHere params equal 1564. 
    So in my case extract zip function looks like:
    function Expand-ZIPFile{
    param(
    $file, $destination
    $shell = new-object -com shell.application
    $zip = $shell.NameSpace($file)
    foreach($item in $zip.items())
    $shell.Namespace($destination).copyhere($item,1564)
    "$($item.path) extracted"
    1564 description can be found here - http://msdn.microsoft.com/en-us/library/windows/desktop/bb787866(v=vs.85).aspx:
    (4) Do not display a progress dialog box.
    (8) Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.
    (16) Respond with "Yes to All" for any dialog box that is displayed.
    (512) Do not confirm the creation of a new directory if the operation requires one to be created.
    (1024) Do not display a user interface if an error occurs.

  • This copy of Microsoft Office 2013 cannot be used on a computer running Terminal Services" error message when you try to open the Click-to-Run version of an Office 2013 program or suite on a terminal server

    Hi All,
    I have Citrix VDI (Virtual Desktop Infrastructure) Implemented
    in my company and installed few Applications on App Server lets say.... MS Office 2013, filzialla, putty, etc...
    I assigned these apps to the users through CITRIX STUDIO, when I try to use these apps. on VDI everything is working fine only when i tried to open Word, Excel or Powerpoing, outlook it throws error as 
    ""This copy of Microsoft Office 2013 cannot be used on a computer running Terminal Services" error message when you try to open the Click-to-Run version of an Office 2013 program or suite on
    a terminal server"" and apps gets closed.
    Please help me on this ASAP.
    Thanks & Regards,
    Sachin Shinde

    Hi,
    As mentioned in ths article below, run for Office 365 products on to a Remote Desktop Session Host server is not supported. You can install Office products for Office 365 to a virtual desktop, but the virtual desktop must be assigned to a single user.
    http://technet.microsoft.com/en-us/library/jj219423(v=office.15).aspx
    Regards,
    Melon Chen
    TechNet Community Support

  • Can you see which apps are open and/or running like you can on an android phone by going to settings applications running services?

    can you see which apps are open and/or running (like you can on an android phone by going to settings>applications>running services)?

    Hi wjosten,
    thank you for the help.  I should have said I had a iphone 3.  A friend has the same phone and she showed me how she can see what web pages are open when she double taps the home button.  Mine is set to bring up favourites when I double tap (chosen from settings>general>home button).. BUT my choices are only HOME; SEARCH; PHONE FAVORITES; CAMERA or IPOD.  I changed my choice to HOME but that just defeats the purpose as when I am at the home page and double tap nothing happens.  Am I making sense?

  • Error while running Java Application as NT Service using INSTSRV

    Hi,
    I am trying to run Java Application as an NT Service using Instsrv.But when i start the service It works fine.when i stop the service it does not stop and it continues to run the application.When i uninstall the service It still executes.When i reboot my machine it stops .Is there any solutions for this.Any help is greatly appreciated.
    Thanks.

    I actually had similar situation. I used autoexnt.ext tool (it creats a service that can be called when rebooting) to start a batch file which in turn run a java program. After the program starts, it can only be stopped through Task Manager or Ctrl-C at the dos window (it creats a dos window) or close the window directly. Stopping the service has nothing to do with the program. I feel this is reasonable because the only function of the service here is to start the application. After that the service does not (very likely) have any connection with the program so whatever you do with the service will not affect the program itself. I wonnder if you are in the same situation.
    PC

Maybe you are looking for

  • Recording vocals and guitar at the same time, using the Alesis IO dock!

    Hi there! I have an Ipad 2 with the newest OS installed etc. And I rea the other posts in here. I bought an IO dock from Alesis the other day and was full of exspectations, but I got a bit disappointed -> Garageband! When I bought the Ipad dock I exs

  • &uuml is shown as &uuml instead of ü in FireFox 3.6.13 NL

    <blockquote>Locking duplicate thread.<br> Please continue here: [/questions/776785]</blockquote><br> the ampersand uml code is showed instead of interpreted this independent of existance or abundance of meta code forlanguage and codeset.

  • GC is broken in fp 9.0.124.0

    does anyone think this is working in the latest flash player?

  • BIPublisherDesktop install fails

    I'm trying to install the BI Publisher Desktop version 10.1.3.4.2 on a new machine, and it is failing with just the error: Template Builder Installer failed. There is no log being created that I can find either. Has anyone else had this problem?

  • Strange behavior of the monitor after latest update (solved)

    The new kernel seems to be working well except for one thing and I am not sure where the blame lies.  About once every 4 or 5 hours, the monitor screen goes blank.  If I hit any key it comes right back with nothing lost.  Minor thing but kind of irri