Executing plug-in through COM object

Hello,
I have tried  to create plugin with ATL COM object for  possibility execute the function into plug-in from my  application. And have got Runtime Exception which  refer to red line in code below ("Expression: gCoreVersion>=CoreHFT_VERSION_2")
The next list is my C# code for invoke function RunReplacen for COM coclass ConnectorToAcrobat
     Type type = Type.GetTypeFromCLSID(guid);
     ConnectorToAcrobat connector = (ConnectorToAcrobat) Activator.CreateInstance(type);
     connector.RunReplace(@"Part1.u3d");
The next C++ code  is part of COM object
#ifndef MAC_PLATFORM
#include "PIHeaders.h"
#endif
STDMETHODIMP CConnectorToAcrobat::RunReplace(BSTR filePathToU3D)
      char myPath[MAX_PATH];
      wcstombs(myPath, filePathToU3D, MAX_PATH);
      ASAtom pathType = ASAtomFromString("Cstring");
     // Function of plug-in
      CreatePDFWith3DAnnotation(&name);
      return S_OK;
What is wrong? How can I workarround this problem?

No, plugin and COM object it is a one  solid file.
Anyway, I've faced with new problems.  The  AVDocOpenFromFile(ASPathName , ASFileSys , ASText )  function  works perfectly,  but if file doesn't containe forms. And when I want to open file with forms I getting crash.
Next, works with multithreading.
ACCB1 ASBool ACCB2 PluginInit(void)
DWORD ThreadID;
HANDLE hThread = CreateThread(0,0, ThreadProc, NULL, 0, &ThreadID);
return MyPluginSetMenu();
DWORD WINAPI ThreadProc(LPVOID lpParam )
BSTR filePathToU3D = SysAllocString(L"Part1.u3d");
char myPath[MAX_PATH];
wcstombs(myPath, filePathToU3D, MAX_PATH);
ASAtom pathType = ASAtomFromString("Cstring");
//Unhandled exception at 0x56230fa0 in Acrobat.exe: 0xC0000005: Access violation reading location 0x00000044.
ASFileSys fileSys = ASGetDefaultFileSysForPath(pathType, myPath);
ASPathName name = ASFileSysCreatePathName(fileSys, pathType, myPath, NULL);
  CreatePDFWith3DAnnotation(&name);
    return 0;
(this code works fine in one thread)

Similar Messages

  • Error while reading indesign(.indd) file through COM object in c#

    I want to read InDesign(.indd) file in c#. I have installed adobe InDesignCS6.
    I have added COM reference of 'Adobe InDesign CS6 Type Library' in my c# application.
    Code snippet is as follows.
            [STAThread]
            static void Main(string[] args)
                InDesign.Application app = (InDesign.Application)COMCreateObject("InDesign.Application");
                Document doc = app.ActiveDocument;
                Page page = doc.Pages[1];
                TextFrame frame = page.TextFrames[1];
                Console.WriteLine(frame.Contents.ToString());
            public static object COMCreateObject(string sProgID)
                // We get the type using just the ProgID
                Type oType = Type.GetTypeFromProgID(sProgID);
                if (oType != null)
                    return Activator.CreateInstance(oType);
                return null;
    But the first line itself throwing an following error while type casting output of COMCreateObject method into InDesign.Application type.
    Error :
    Unable to cast COM object of type 'System.__ComObject' to interface type 'InDesign.Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{ABD4CBB2-0CFE-11D1-801D-0060B03C02E4}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
    Kindly help me. Its urgent.

    try this,
    InDesign.Application app = (InDesign.Application)COMCreateObject("InDesign.Application.CS6");

  • How can I use a COM object that does not have a type library?

    Hello,
    I've created a com server in python for which I do not have a type library. I am able to call functions for this application in Python, TCL, I'm sure VB, etc. without the type library.
    Must I have a type library registered to use this COM object with Labview? I was hoping I could simply supply the name to the refnum (or the GUID) then call functions by passings strings to the invoke node. This does not seem to be possible - am I missing something?
    In the event that I cannot use a com server without a type library. Any recommendataions on how to create one? I'm wondering if I can use the same GUID and create a shell in LabWindows which generates the IDL/TBD file I need for Labview to see my
    com server.
    Any help is greatly appreciated.
    73,
    Timothy

    Timothy Toroni wrote:
    > Thanks for the info, however their example is labview server and
    > python client. I'm going the other way. It's good to know about
    > LabPython though...
    >
    > As of now, it seems to be there is no way to use a COM object without
    > a type library from inside LabView.
    Yes that is true. LabVIEW needs that to configure the Property and
    Methode Nodes correctly. Otherwise it would need to have a special
    Property and Method Node with a configuration dialog similar to the Call
    Library Node, but a LOT more complicated. Not sure many people could
    make use of that, and it would be a very tiring experience trying to get
    things setup in that way, by going through the edit, test, and crash
    cycle over and over again.
    Rolf Kalberm
    atter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Rename a File in a SharePoint document library through Client object model

    Hi,
    How  to Rename a File in a SharePoint document library through Client object model?
    Thanks
    Poomani Sankaran

    Hi,
    According to your description, you want to rename file in the document library using SharePoint Client Object Model.
    Here is a code snippet works well in my environment for your reference:
    static void Main(string[] args)
    string url = "http://sp2013sps/sites/test/";
    ClientContext clientContext = new ClientContext(url);
    Microsoft.SharePoint.Client.List spList = clientContext.Web.Lists.GetByTitle("Documents");
    clientContext.Load(spList);
    clientContext.ExecuteQuery();
    if (spList != null && spList.ItemCount > 0)
    Microsoft.SharePoint.Client.CamlQuery camlQuery = new CamlQuery();
    camlQuery.ViewXml =@"<View> <Query> <Where><Eq><FieldRef Name='LinkFilenameNoMenu' /><Value Type='Computed'>New Microsoft Word Document.docx </Value></Eq></Where> </Query> <ViewFields><FieldRef Name='Title' /></ViewFields> </View>";
    ListItemCollection listItems = spList.GetItems(camlQuery);
    clientContext.Load(listItems);
    clientContext.ExecuteQuery();
    listItems[0]["Title"] = "word.docx";
    listItems[0]["FileLeafRef"] = "word.docx";
    listItems[0].Update();
    clientContext.ExecuteQuery();
    More information about SharePoint Client Object Model:
    http://msdn.microsoft.com/en-us/library/office/ee537247(v=office.14).aspx
    http://www.codeproject.com/Articles/399156/SharePoint-Client-Object-Model-Introduction
    http://www.learningsharepoint.com/2010/07/12/programmatically-upload-document-using-client-object-model-sharepoint-2010/
    Best regards

  • Access current user's manager name in the console application ( through Client object model)

    Hi Guys,
    Is there any way to retrieve current logged-in user's Manager name in the console application.
    As I don't have access to the server where SharePoint 2010 is installed so I wanted to access through client object model.
    arun singh

    Unfortunately, you can't use CSOM to do this in SharePoint 2010 (you can in SharePoint 2013!), but you CAN use the User Profile Service .asmx web service to accomplish this. You need to call the
    GetUserProfileByName method exposed
    in the http://<yourServerName>/_vti_bin/UserProfileService.asmx web service. Pass in the user name for the current user and Manager will be one of the properties that is returned.
    Here is a link to a blog post with example code.
    Please mark my reply as helpful (the up arrow) if it was useful to you and please mark it an answer (the check box) if it answered your question! Thank you!
    Danny Jessee | MCPD - SharePoint Developer 2010 | MCTS - SharePoint 2010, Configuring
    Blog: http://dannyjessee.com/blog | Twitter: @dannyjessee

  • Error to execute the script through command prompt

    I tried to execute the script through command prompt. I got some following error. Could you please advice me how to rectify this.
    cscript D:\JS\Test.js
    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
    D:\JS\Test.js(1, 1) Microsoft JScript runtime error: 'app' is undefined.
    Thanks,
    Prabudass

    I haven't use CS for quite some time and file associations may not work with the command prompt.
    You can try using Windows Explorer to browse to a .js file then right click on that file. From the popup menu choose Open With. Even if you see Photoshop in the file list choose Browse at the bottom. Browse to Photoshop and make sure to check 'Always use selected program...'
    If that doesn't work you will need to create an action that runs your script and make a droplet from that action. You can then use the droplet in the command prompt. You may also need to create a 'dummy' image file to launch the droplet with if you script doesn't require an open document at startup. See http://www.ps-scripts.com/bb/viewtopic.php?t=967

  • Trying to load flash file in iWeb and when I enter info in the "html snippet" box a "missing plug-in" message comes up (although i have adobe flash player in, if that's the plug-in they're looking for). Anyone have any similar problems or solution. Thanks

    I'm trying to load flash file in iWeb and when i enter info in the "html snippet" box a "missing plug-in" message comes up (although i have Adobe Flash player installed, if that's the plug-in they're looking for). Anyone have any similar problems or solutions. Thanks

    when i publish my site and vew it the page on the web it just comes up with the file name w/ the ,swf and the "mising plug-in" message below. if i click on the file name it displays the flash file but gigantic (the entire height of the page).totally perplexed!
    anyway, here is the code.
    <object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000”codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0, 40,0”width=”244” height=”221” id=”ETrade_banner_Gumby_replay”><paramname=movie value=”ETrade_banner_Gumby_replay.swf”><param name=qualityvalue=high><param name=base value=”.”><embed src=”ETrade_banner_Gumby_replay.swf”quality=high width=”244” height=”221” name=”ETrade_banner_Gumby_replay”align=”” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer”base=”.”></embed></object>

  • COM object that has been seperated from its uderlying RCW cannot be used

    What exactly does this error mean?
    I receive this error when I perform "Unload All Modules" from the sequence editor using TestStand 4.2.1.83 development system, which is part of NI Developer Suite 2010 DS1.
    It causes TestStand to crash citing that error, and then a secondary error cites corrupted memory.

    ATE_Dude_22 wrote:
    Here is a capture of my sequence editor, where I have a alert from TestStand telling me the parameter specified doesn't match the sequence parameters (specified in the vi prototype as a string not a number), but this version of TestStand allows it to execute without needing to clear the error.
    Do you think this may have anything to do with the error I am seeing?
    Probably not. Sequence calls support mismatched parameters, what happens is that the callee gets whatever is passed to it, if that's not what it's expecting, then you might get a type mismatch error if type checking is enabled, if not then it's up to the sequence what it tries to do with the parameter for what happens next.
    Most likely the bug is in one of the code modules you are calling, probably a vi or dll is not properly maintaining a reference count somewhere or is corrupting memory and only indirectly causing the error. If most of your code is in labview, one thing to look out for is incorrectly specified calls to dlls from LabVIEW. If a call to a dll is incorrectly specified, either from LabVIEW or TestStand that can very easily lead to memory corruption and random errors later on in the code.
    I'd recommend trying to either debug and see where it's failing, if it's always failing in the same place. Or try to eliminate possibilities and reduce the called code to the minimum code required to reproduce the problem and then look for bugs in that code (paying special attention to the possibility of incorrectly specified dll calls and/or perhaps incorrectly maintained reference counts on COM objects).
    Another idea, to see if the problem is memory corruption caused by a vi, is to run all of your labview vis using the development environment (labview adapter setting), if so, any memory corruption would be in the labview process and not the main teststand process and should not bring down teststand.
    -Doug

  • Updation of List Settings through Client object model

    Hi all,Is there any way to update List settings through Client object model.
    I want to work with all the list settings programmaticaly using client object model.
    Is there any way??? 

    Hi,
         Handful operations you can do it with client object model as certain limitations are there, which are not in server object model. Sharepoint Client obejct model comes with 3 APIs .i.e .Net managed code, javascript api and silverlight
    object model . 
    For reference , i implemented test code to add list on the Quick launch.
             ClientContext clientContext = new ClientContext("Web FullUrl");
                Web web = clientContext.Web;
                List list = web.Lists.GetByTitle("Test");
                list.OnQuickLaunch = true;
                list.Update();
                clientContext.Load(list);
                clientContext.ExecuteQuery();
    Regards,
    Milan Chauhan
    LinkedIn
    |
    Twitter | Blog
    | Email

  • Problem calling COM Object on Windows Server 2008 x64

    Hi,
    We are using 32 bits COM object called in Coldfusion page on 32 bits OS. It works fine since few years.
    Now we need to use it on x64 Windows Server 2008 and 64bits IIS.
    As I 've seen (http://www.coldfusionjedi.com/forums/messages.cfm?threadid=87869C67-B1 9B-288F-F32B6E8BAB3228CA ),a 64 bits process can only call 64 bits DLL.
    So we created a 64 bits Wrapper like this : http://www.dnjonline.com/article.aspx?id=jun07_access3264
    But  calling 64 bits COM Object still raises the same error (" The cause of  this exception was that: java.lang.RuntimeException: Can not use  native  code: Initialisation failed") whereas it works fine with a 64 bits  executable created in .NET for example.
    Is there a known issue about this subject?
    Sorry for english , I'm a french developper.
    Thanks in advance.

    Can somebody please share the solution for this issue?
    I am facing similar issue with Windows 2012 R2 x64 OS and Excel 2007(32-bit) combination.
    I tried couple of things like Excel is able to Open an existing workbook on my system but fails to
    create a new Workbook as done by invoking the "Add" command. It fails with Error 800a03ec.
    I tried creating the two folders i.e. C:\Windows\SysWOW64\config\systemprofile\Desktop & C:\Windows\system32\config\systemprofile\Desktop, but could not get it working.

  • Iterating through View Object RowIterator Bug.

    I use this code to loop through the rows of a view object (As described in javadoc of RowIteratior).
    public String checkIterations() {
    String res = "Iterated through : ";
    RowIterator view = this.getDepartmentsView1();
    view.reset();
    Row row;
    while ((row = view.next()) != null) {
    System.out.println("rownum: " + row.getAttribute("RowNum"));
    res += row.getAttribute("RowNum") + " ";
    return res;
    Yet this code never goes through the first row if the executequery has been performed for view object.
    details:
    [http://adfbugs.blogspot.com/2009/07/iterating-through-view-object.html]
    Is this a bug?
    Edited by: mkonio on Jul 28, 2009 11:41 PM

    Thanks Andrejus and Steve.
    Its a development bug
    problem and solution described in:
    Fusion Developer's Guide for Oracle ADF
    9.7.6 What You May Need to Know About Programmatic Row Set Iteration

  • COM object model not functioning after encrypting the word document using office extention

         After encrypting A word document using office extention, it seems like the COM object model becomes unusable. I cannot not manipulate the encrypt document through COM interface, nor can I write macro VBScript to do some operation on the docuent.
         For example, I create a word Macro with some simple code.
    Sub hi()
        Dim i As Integer
        i = ThisDocument.Fields.Count
        MsgBox i   
    End Sub
         If the document is not encrypt, then we will see a msgbox which tells us the number of bookmarks in the current document.
         Now, encrypt the word document using the office extention, running the macro code will fail with error code " 80004005" and error message:Method 'Fields' of bject 'ThisDocument' failed.
    It is very important for us to manipulate word documents through COM interface in our system, I want to know why the COM interface does not work anymore after the document is encrypted.

    I take macro script as an example to demonstrate that word COM object model cannot be used after encripted. Actually you can reproduce the same problem when you manipulate word document through COM interface using any programming language.
    For example, you can create a text document  with the following VBscript:
    set a = createobject("Word.Application")
    set doc = a.Documents.Open("E:\temp\test.docx")
    msgbox doc.Fields.count
    doc.close
    a.quit
    Save the document with ".vbs" file extention and then run it by double clicking it. it will fail if the document is encrypted using the office extention. 

  • How do I get LabVIEW to recognise a Gaussmeter as a device through COM port 1?

    Hello everyone.
    I am trying to do display the readings from a GM05 Gaussmeter in LabVIEW through COM Port 1 on my computer.  I have installed the relevant drivers and MAX recognises that something is plugged in by listing COM 1, COM 2 and LPT 1 under devices, but it does not recognise the Gaussmeter as a device (it does not say 'device #' in brackets next to COM 1)..  Therefore when I come to create a new Virtual Channel in the Data Neighbourhood I cannot select my COM port as a device.  Can anyone help me to solve this problem, any advice would be greatly appreciated.
    Regards,
    Rob.

    Unlike GPIB the com port or serial communication usually does not have an identify query, so it wont auto recognize the device.  You should look in the manual of the device and send an appropriate string (there might be a self-test or identify string) and check for the correct response.  Not all devices communicate both ways (some are talkers, some are listeners and many are both).
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Accessing COM Objects provided by an EXE server

    Hello,
    I need to control an application through COM. I did this before with Excel and other software and used LabView's ActiveX functions.
    But this time I can't find the object I need when I browse the type library.
    The COM server actually is registered. But it's an "EXE Server" (I used "COM Explorer" to browse all registered COM objects - and the one I need is listed under EXE Servers).
    Is there any possibility to gain access to this interface?
    Thanks!
    Regards,
    Robert

    Hi Robert,
    there is not really a difference between ActiveX object and COM object.
    All COM objects (ActiveX objects) should be accessible.
    If you can't see the object, but you know that you had register it, there are only two possibilities:
    1) Something is wrong with the object -> it is not really standard
    2) You can try to browse manually to the object.
    Use the "Browse" Button (see Browse.jpg) and select the object manually.
    If that doesn't work, there must be something wrong with the object.
    Best regrads
    Dippi
    Attachments:
    Browse.jpg ‏29 KB
    Select Object.jpg ‏163 KB

  • Photoshop COM Object Scripting via PhP

    Has anyone had any joy creating a photoshop COM Object using PhP?
    Normally you would do something like this :
    $ps = new COM("Photoshop.Application.8") or die ("Failed to initialize.");
    var_dump($ps);
    I can see photoshop launched in the task manager, but when run in my browser appears to be stuck in a loading cycle, no output of the Object.
    Doing this :
    $ps = new COM("Microsoft.XMLDOM") or die ("Failed to initialize.");
    var_dump($ps);
    Correctly outputs 'object(com)#1 (0) { }'
    ie. an initialized XMLDOM COM object.
    If i can initialize Photoshop as a COM object i should be able to script it directly in PhP, rather than using the command line to execute a droplet that calls an action to execute a VB/JSX Script.

    I would like some information on this as well...

Maybe you are looking for