none
Word Addins - A privileged service was called -- Office 2010 64 bit on Windows 7 (64 bit) machine RRS feed

  • Question

  • Hi,

     The Word (excel or powerpoint) addins were loaded but when click on the button on the ribbonbar that should open my custom application. It is failing to open and WOrd crashing. When I look into the event viewer, below given information is being written. Please help me how to over come this one.

    Thanks,

    Badrinath

    A privileged service was called.


    Service:
    Server: Security
    Service Name: -

    Process:
    Process ID: 0xdf4
    Process Name: C:\Program Files\Microsoft Office\Office14\POWERPNT.EXE

    Service Request Information:
    Privileges: SeCreateGlobalPrivilege

    Event ID: 4763

    Task Category: Sensitive Privilage Issue

    Level: Information
    Keywords: Audit Failure

    Tuesday, July 17, 2012 6:52 PM

Answers

  • I could able to find a solution for it. If you open the 32 bit application in a separate process, the Office 64 bit Addins opening it. 

    I created a console application with the code required to open my 32 bit application and built the exe with platform target to x86. Then created a separate process and called my console app. (given below code snippet)

    private bool OpenMyApp(StringBuilder sbCmd) { try { string strCmd = sbCmd.ToString(); //Input to my application ProcessStartInfo startInfo = GetProcessStartInfo(strCmd); if (!ReferenceEquals(startInfo, null)) { Process proc = new Process(); proc.StartInfo = startInfo; proc.Start(); //Read the process output stream string retValue = proc.StandardOutput.ReadToEnd(); proc.WaitForExit(); sbCmd.Remove(0, sbCmd.Length); retValue = retValue.TrimEnd('\r', '\n');

    sbCmd.Append(retValue); return true; } } catch (Exception e) { WriteToEventLog("Unable to Load app"); } return false; } private ProcessStartInfo GetProcessStartInfo(string command) { ProcessStartInfo startInfo = new ProcessStartInfo(); string fileName = "C:\MyConsoleApp.exe"; startInfo.CreateNoWindow = true; startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; startInfo.FileName = fileName; startInfo.UseShellExecute = false; startInfo.RedirectStandardOutput = true; startInfo.Arguments = command; return startInfo; }


    Monday, August 20, 2012 10:12 PM

All replies

  • And what is the code attached to the button in the Ribbon that should start your custom application?

    Cindy Meister, VSTO/Word MVP

    Wednesday, July 18, 2012 4:07 PM
    Moderator
  • The same addins were working fine on Win XP, Win 7 32 bit machine (office 2010 32bit, office 2007) and Win 7 64 bit (Office 2010 32 bit) machine as well. 

    Thanks,

    Badrinath

    Ribbon.XML:

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2006/01/customui" loadImage="GetImage">
      <commands>
        <command idMso="FileSave" onAction="OverrideSave"/>
        <command idMso="FileSaveAs" onAction="OverrideSaveAs"/>
      </commands>
      <ribbon startFromScratch="false">
            <tabs>
                <tab id="tab1" insertAfterMso="TabAddIns" label="My Addins" >
                    <group id="group1" label="My Group">
                        <button id="btnOpenMyApp" getImage="GetImage" onAction="OpenApp" keytip="ALT" screentip="Open Document" label=" MY App Open" size="large" />
                    </group>
                </tab>
            </tabs>
        </ribbon>
    </customUI>

    Ribbon.cs:

            public void OpenApp(Office.IRibbonControl control)
            {
                OpenDocRecords();  //Opening my custom application 
            }

    Thursday, July 19, 2012 4:18 PM
  • Please tell us more about OpenDocRecords

    Cindy Meister, VSTO/Word MVP

    Friday, July 20, 2012 1:30 PM
    Moderator
  • OpenDocRecords: 

       This will open up our custom application which is written in VB6. We call the respective method using a COM reference. All this working fine in all other versions except Office 64 bit.

    Thanks,

    Badrinath

    Friday, July 20, 2012 7:57 PM
  • Cindy,

       The OpenDocRecords method calls our application which is a 32 bit. I researched a bit as the Office is a 64 bit app, it will not load the 32 bit DLLs.

    The Error I see in the EventViewer is: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

       Is there a way to achieve this? We really need to support these addins which are crucial to our customers at the same time can't develop our legacy application in 64 bit. 

      Any help is greatly appreciated.

    Thanks,

    Badrinath


    • Edited by Badribnath Thursday, August 9, 2012 2:33 PM
    Thursday, August 9, 2012 2:03 PM
  • Hi Badribnath

    Sorry about the long silence - "real life" has been keeping me busy for a while (again!).

    I'm not knowledgeable about the 64-bit stuff. I agree with your analysis that the reason for your problem is that your VB6 app is 32-bit. The only solution I'd know is to have people install Office on the 64-bit machine in 32-bit mode. Unless people are using some Excel features very intensively, running in 64-bit mode doesn't bring anything, anyway.

    If you want to discuss whether there's any way to make it work, I suggest you post a new message in the General Office Development form http://social.msdn.microsoft.com/Forums/en-us/officegeneral/threads with that as the topic.


    Cindy Meister, VSTO/Word MVP

    Sunday, August 19, 2012 3:31 PM
    Moderator
  • I could able to find a solution for it. If you open the 32 bit application in a separate process, the Office 64 bit Addins opening it. 

    I created a console application with the code required to open my 32 bit application and built the exe with platform target to x86. Then created a separate process and called my console app. (given below code snippet)

    private bool OpenMyApp(StringBuilder sbCmd) { try { string strCmd = sbCmd.ToString(); //Input to my application ProcessStartInfo startInfo = GetProcessStartInfo(strCmd); if (!ReferenceEquals(startInfo, null)) { Process proc = new Process(); proc.StartInfo = startInfo; proc.Start(); //Read the process output stream string retValue = proc.StandardOutput.ReadToEnd(); proc.WaitForExit(); sbCmd.Remove(0, sbCmd.Length); retValue = retValue.TrimEnd('\r', '\n');

    sbCmd.Append(retValue); return true; } } catch (Exception e) { WriteToEventLog("Unable to Load app"); } return false; } private ProcessStartInfo GetProcessStartInfo(string command) { ProcessStartInfo startInfo = new ProcessStartInfo(); string fileName = "C:\MyConsoleApp.exe"; startInfo.CreateNoWindow = true; startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; startInfo.FileName = fileName; startInfo.UseShellExecute = false; startInfo.RedirectStandardOutput = true; startInfo.Arguments = command; return startInfo; }


    Monday, August 20, 2012 10:12 PM