Calling a dll from a new menu item in Bridge.  Idiot help needed

Hi,
I'm trying to what I believe is a fairly simple script.  I'm coming from a hobbiest Delphi background, and to be honest I'm finding JavaScript a little bit hard to understand.  My requirements are simple - add a new menu item to Bridge which executes a call to a custom dll.  Note I'm not expecting the dll to return anything here.. 
Looking at the samples provided even I can add the menu item - but getting it to successfully call the dll is a bit of a mystery. 
The script compiles and adds the menu item, however the menu action doesn't call the dll.  I believe it should be a fairly simple task and was hoping somebody here could steer me right.  Here's my code (as you'll see a clear cut and paste job from the examples ;o)
Header 1
function SnpAddMenuItem()
  this.requiredContext = "\tAdobe Bridge must be running.\n\tExecute against Bridge CS6 as the target.\n";
  this.menuID = "snpmyMenu";
  this.menuCommandID1 = "snpAddMenuItemSub1";
  $.level = 1; // Debugging level
SnpAddMenuItem.prototype.run = function()
  var retval = true;
  if(!this.canRun()) {
  retval = false;
  return retval;
  // Create the menu element
  var newMenu = new MenuElement( "menu", "myMenu", "before Help", this.menuID );
  // Create the menu item
  var alertCommand1 = new MenuElement( "command", "Load Stuff", "at the end of " + this.menuID, this.menuCommandID1);
  alertCommand1.onSelect = function (m1)
        ExternalObject.myDll = new ExternalObject('lib:/C/temp/apmDLL.dll');
        myDll.sendtoACRPM(1);
//      return retval;
SnpAddMenuItem.prototype.canRun = function()
  // Must run in Bridge
  if(BridgeTalk.appName == "bridge") {
  // Stop the menu element from being added again if the snippet has already run
  if((MenuElement.find(this.menuID)) && (MenuElement.find(this.menuCommandID)))
// $.writeln("Error:Menu element already exists!\nRestart Bridge to run this snippet again.");
// return false;
            MenuElement.remove(this.menuID);
  return true;
  $.writeln("ERROR:: Cannot run SnpAddMenuItem");
  $.writeln(this.requiredContext);
  return false;
if(typeof(SnpAddMenuItem_unitTest ) == "undefined") {
  new SnpAddMenuItem().run();

The dll needs to be compatable with the criteria set in the JavaScript Tools Guide. There is an example in the Bridge SDK that can be downloaded from http://www.adobe.com/devnet/bridge.html
But it need someone who is knowledgeable with c++
It would be great if someone could write a wrapper to access other external objects.

Similar Messages

  • New Menu Item entry in Standard Help Menu

    Hi experts,
    I have added a custom menu item under the standard Help menu of SAP using SE41 (Menu Painter) with pragram name: MENUSYST and status: MEN
    I added the new entry and gave it a function code and activated the function code as well as the interface MENUSYST.
    This worked fine and the entry is visible at the desired location. Now on click of this new entry, I need to open a URL. I had a look at the HELP_START function module but modifying that to call the URL on click of the new menu item, would require an access key.
    Is there any other method available to accomplish the task?
    Regards,
    Reema.

    Hello,
    Basically I need to open a Custom Web Dynpro Application that I have created. Also I need to pass the trannsaction code as a parameter in the URL of the WDABAP Application.
    Pl help me proceed.
    Regards,
    Reema.

  • How to call labview DLL from C#, passing char, char[], float[], long, short

    Hi,
    I'm having trouble calling labview dll from C# to perform certain function.
    The function supposed to return the values in the float Analysis[] array. However, when I execute it it only returns zero values.
    It seems that some parameters are not properly passed to the dll.
    Below is the function in the header file:
    void __stdcall Optical_Center(char FileDirectory[], long ImagePtr,
        short int Height, short int Width, char ReadFromFile, float Analysis[],
        long lenAnalysis);
    and my corresponding dll import in c#:
    [DllImport(@"SMIA.dll", CharSet = CharSet.Ansi)]
            public static extern void Optical_Center([MarshalAs(UnmanagedType.LPStr)]string FileDirectory, long ImagePtr,
                short Height, short Width,char  ReadFromFile, IntPtr Analysis,
                long lenAnalysis);
    string str = @"C:\SMIA.raw";
    int len = 3;
    long m_lenAnalysis = 3;
    long m_ImagePtr = 0;
    short m_Height = 2464;
    short m_Width = 3280;
    IntPtr m_PtrArray = Marshal.AllocHGlobal(len * Marshal.SizeOf(typeof(float)));
    char m_ReadFromFile = '1';
    Optical_Center(str,m_ImagePtr,m_Height,m_Width,m_ReadFromFile,m_PtrArray,m_lenAnalysis);
    float[] m_Analysis = new float[len];
    Marshal.Copy(m_PtrArray, floatArray,0,len);
    Marshal.FreeHGlobal(m_PtrArray);
    string printstr = "";
    for (int i=0; i<len; i++)
        printstr = printstr + floatArray[i].ToString() + "\n";       
    MessageBox.Show(printstr);
    Appreciate if anyone can help, thanks.
    KL

    I was just about to post the header file of the DLL, when
    I noticed that there's a function called LVDLLStatus.
    This little thingie turned out to be a rather handy tool.
    With that function I found that in the DLL I had a problem
    with another function that prevented the DLL to be correctly
    loaded.
    This other function in the DLL is for generating digital output
    and it worked as it should, when tested from LV.
    Anyway if someone is interested, I got it working by using
    the LoadLibrary and GetProcAddress function, as in the
    source code thatI posted earlier.
    I will investigate what is wrong with that digital output, and
    post into a another thread if I have problems with that.

  • Viewing more than 9 Forms from the Window Menu Item

    Hi,
    I would like to know if you can list more than 9 Forms at one time from the Windows Menu Item before you have to select the MORE WINDOWS option to display the entire list of currently opened forms.
    Can this be set in the .mmb or some config file?
    It would be nice to have a list of about 12 Forms to choose from at one time before selecting the MORE WINDOWS option.
    Christina.

    Hi Frank,
    The Forms version our system uses is Oracle Forms 6i.
    A user would like to know if this scenario is possible during runtime.
    However, I would like to know what modifications can I make during design time to make this possible.
    Thanks.
    Christina.

  • Add new menu Item in 11g

    Hi,
    I want to Add new menu item in UCM 11g.
    I have done in 10g throught including
    <$include super.custom_finish_layout_init$> and
    // create a collection
         navBuilder.addChildNode();
    but the same is not working in 11g.
    Please assist me in getting menu item in 11g.
    Thanks.

    Hi,
    Check below URL for more information.
    http://blogs.oracle.com/kyle/entry/modifying_navigation_menus_in_ucm
    Thanks,
    Ravinder

  • Calling external dll from oracle 8i pl/sql

    Hi
    I am facing in calling extrenal dll from pl/sql.
    Steps followed by me are
    1.
    create library crc_lib as
    'D:\ORACLE\ORA81\RDBMS\EXTPROC\EXTPROC\my.DLL';
    2.
    CREATE OR REPLACE FUNCTION check_file_crc (f1 char)
    RETURN BOOLEAN AS
    EXTERNAL LIBRARY CRC_LIB
    NAME "Check_File_CRC"
    LANGUAGE C;
    3. CREATE OR REPLACE PROCEDURE CRC_TEST (f1 varchar2) AS
         RetValue varchar2(100);
    BEGIN
         if check_file_crc(f1) then
              RetValue := '0';
         else
              RetValue := '1';
         end if;
         DBMS_OUTPUT.PUT_LINE(RetValue);
    EXCEPTION
         when others then
         DBMS_OUTPUT.PUT_LINE(sqlerrm|| 'I am in exception');
    END;
    4.ET SERVEROUTPUT ON
    SQL> exec crc_test('C:\file.txt');
    ORA-28576: lost RPC connection to external procedure agent
    I am in exception
    I have tsnames.ora as
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    and listner.ora as
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = D:\Oracle\ora81)
    (PROGRAM = extproc)
    I am unable to resolve problem please help.
    Prashant
    Edited by: prashant13 on Jul 23, 2009 11:27 AM

    See if MOS note      468404.1 proves helpful here (though not meant for your version of Oracle).

  • How to create a new menu item.. please help

    hi every one..,
    i bought a new 30GB ipod .., i would like to create a new menu item in the ipod and wanna generate all my content whichis in my database to this newly created menu item in my ipod....
    any reply to this will be greatly appreciated..
    thanks in adavance
    Prem
    AMD athlon 64. 2400+   Windows XP Pro   1.8GHZ, 512 MB RAM

    Prem,
    First of all, Welcome to the Apple Discussion Forums!
    If you get no response here you may want to post your question over in the iPod Discussion Forums for the quickest response.
    Pick the forum of the iPod in question (Usage).
    Just thought that might get you a better/quicker response than here.
    good luck,
    littleshoulders [:-)

  • Calling LV DLL from VB

    I have a vi that initializes, measures, and releases
    an OSA instrument. I want to call this routine from VB.
    I used Standard calling convention when making DLL from LV.
    Here is my VB declaration:
    Private Declare Sub OSAMeasurement Lib "C:\ADE\OSAMeasurement.dll" Alias "OSADFBMeasurement" _
    (ByVal GPIB As Long, _
    ByVal Serial_Number As String, _
    ByVal FileName As String, _
    ByVal File_Path As String, _
    ByVal Start_Wavelength_nm As Double, _
    ByVal Stop_Wavelength_nm As Double, _
    ByVal Level_Scale_dB As Double, _
    ByVal Res_nm As Double, _
    ByVal Peak_Wavelength As Double, _
    ByVal Peak_Level As Double, _
    ByVal SMSR As Double, _
    ByVal FWHM As Double, _
    ByVal Mode_Offset As Double, _
    ByRef Level_Array() As Double, _
    ByRef Wa
    velength_Array() As Double, _
    ByVal Array_Length As Long)
    Here is my VB call:
    Call OSAMeasurement(Form1.OSA.PrimaryAddress, _
    (strOXM & Form1!txtOPMNumber), _
    (CStr(CInt(dblSetVoltage)) & "v_Scan.txt"), _
    (txtDataStoragePath & strOXM & " " & Form1!txtOPMNumber & "\"), _
    1520, 1620, 5, 1, Peak_Wavelength, Peak_Level, _
    SMSR, FWHM, Mode_Offset, _
    Level_Array, Wavelength_Array, 1001)
    I get RunTime Error "49"
    Bad DLL calling convention
    What is wrong?
    Any suggestions/comments?
    Attachments:
    OSA.zip ‏703 KB

    Basically what i want to do is to call the microchip's dll called "mpusbapi.dll" from VB6. This dll is written in C++. This dll has some basic functions of usb like MPUSBRead() , MPUSBWrite , MPUSBOpen() etc.
    I have made a usb data acquisition card and i want to communicate with this card by means of VB 6. Please tell me or send a tutorial of calling a DLL from VB 6.
    Any help greatly appreciated
    Attachments:
    _mpusbapi.cpp ‏42 KB
    _mpusbapi.h ‏19 KB

  • Calling a dll from VB

    Hi all
    I have two questions
    1) I know about the visual Basic 6 but what is measurement studio for visual Basic 6?
    2) Can anyone tell me how to call a dll from Visual Basic 6? Any example for this ?
    Any help greatly appreciated :-)

    Basically what i want to do is to call the microchip's dll called "mpusbapi.dll" from VB6. This dll is written in C++. This dll has some basic functions of usb like MPUSBRead() , MPUSBWrite , MPUSBOpen() etc.
    I have made a usb data acquisition card and i want to communicate with this card by means of VB 6. Please tell me or send a tutorial of calling a DLL from VB 6.
    Any help greatly appreciated
    Attachments:
    _mpusbapi.cpp ‏42 KB
    _mpusbapi.h ‏19 KB

  • How to call LabVIEW dll from ATL COM dll

    I have tried to call simple LabVIEW 8.6 Dll from win32 test application, class Library.
    I have include LabVIEW generated SharedLib.h file and SharedLib.lib file in the test application which I created as simple win32 console project and also from win32 class Library. I was sucessfully able to call my LabVIEW dll funtion. 
    But when I create ATL COM project and try to add SharedLib.h file and SharedLib.lib file I used to get following erors
    Error 1 error C2733: second C linkage of overloaded function 'StrCatW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 463 
    Error 2 error C2733: second C linkage of overloaded function 'StrCpyW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 464 
    Error 3 error C2733: second C linkage of overloaded function 'StrCpyNW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 465 
    Error 4 error C2733: second C linkage of overloaded function 'StrCmpW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 466 
    Error 5 error C2733: second C linkage of overloaded function 'StrCmpNW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 467 
    these many errors.
    Will some one explain me how to call LabVIEW dll from ATL COM dll.
    Thanks & Regards,
    Jay

    I also had this problem.  My application is unicode-aware, but I was attempting to link it to a library with primitive C-string arguments.  You could dynamically load the DLL as suggested (more work), modify the header files (really not recommended), or if you are feeling lucky you could try fooling the compiler, as I was successfully able to do in Visual Studio 2010, by steering the preprocessor around those functions (assuming you're not using them, of course -- otherwise this probably wouldn't work):
    // prepare for NI extcode.h inclusion. avoid linker errors for this project.
    #define StrCatW(a,b)     IgnoreLinkError_StrCatW(a,b);
    #define StrCpyW(a,b)     IgnoreLinkError_StrCpyW(a,b);
    #define StrCpyNW(a,b,c)  IgnoreLinkError_StrCpyNW(a,b,c);
    #define StrCmpW(a,b)     IgnoreLinkError_StrCmpW(a,b);
    #define StrCmpNW(a,b,c)  IgnoreLinkError_StrCmpNW(a,b,c);
    // header file for my LabView-built DLL (ASCII single-byte character arguments)
    #include <MyLibraryHeader.h>
    // clean up afterwards, put things back to 'normal'
    #undef StrCatW
    #undef StrCpyW
    #undef StrCpyNW
    #undef StrCmpW
    #undef StrCmpNW

  • New Menu Item

    hi experts
    i have created a custom menu item using following steps
    esign Console > Form Information > add new
    Class Name Organizations.Merge
    Description Move users from one organization to another
    Type menuitem
    Add following to xlWebAdmin.properties, xlWebAdmin_en_US.properties
    Organizations.Merge=mergeOrgs.do?Display
    menuItem.Organizations.Merge.link=mergeOrgs.do?MergeOrganizations
    menuItem.Organizations.Merge=Merge
    mergeOrgs.button.display=Merge Organizations
    however, when i log in to an account to which that menu item has been assigned, it displayed the Menu with Name as
    menuItem.Organizations.Merge
    where i would like to have just Merge as the name. any idea what to amend??
    best Regards

    I believe you should just require these three lines embedded in the files:
    *1. In xlDefaultAdmin.properties*
    menuItem.Organizations.Merge.link=mergeOrgs.do?MergeOrganizations
    mergeOrgs.button.display=MergeOrganizations
    Remove the space between Merge & Organizations as I did and mergeOrgs.button.display should be method in getKeyMethod() of your code
    *2. In xlWebAdmin_en_US.properties*
    menuItem.Organizations.Merge=Merge
    Preferably xlWebAdmin.properties and xlWebAdmin_en.properties should be updated as well. But doesn't matter much as usually internet explorer is set to en_US. Just confirm.
    Thanks
    Sunny

  • How to call labview DLL from visual C++?

    Hi,
    I'm trying to call a LV DLL from a VC++ application
    by using the LoadLibrary and GetProcAddress functions.
    The DLL contains a simple sum function. The Library is
    loaded correctly, but the result is always 0.0000.
    I have loaded a VC++ DLL in a similar way and it works
    correctly. Also, I have tested the DLL by loading it in LV,
    and it works correctly. The calling convention is defined
    to be stdcall in LV Application Builder.
    I have also tried this solution, but I will get a compiler error
    from one the header files that are created by the LV when
    the DLL is made. The error comes from this line
    typedef char                int8;
    and the error states that
    ..\fundtypes.h(107) : error C2371: 'int8' : redefinition; different basic types
    If someone knows of newer tutorial(for LV 8.2) or knows how to use those
    LoadLibrary and GetProcAddress function for LV DLLs, I will appreciate the
    information greatly.
    Below is the code that I'm using for loading the LV DLL.
    Thanks
    #include "stdafx.h"
    #include <stdio.h>
    #include <stdlib.h>
    #include <map>
    #include <windows.h>
    int _tmain(int argc, _TCHAR* argv[])
        HINSTANCE LVLib = LoadLibrary(TEXT("Testdll"));
        typedef double (__stdcall *MYPROC)(double, double);
        if (LVLib != NULL)
            MYPROC ProcAdd = (MYPROC) GetProcAddress(LVLib, "Add");
            if (ProcAdd != NULL)
                double d = (ProcAdd)(5.5, 6.6);
                printf("sum = %f\n", d);
            else
                printf("Invalid function pointer\n");
        else
            printf("Failed to load the library\n");
        return 0;

    I was just about to post the header file of the DLL, when
    I noticed that there's a function called LVDLLStatus.
    This little thingie turned out to be a rather handy tool.
    With that function I found that in the DLL I had a problem
    with another function that prevented the DLL to be correctly
    loaded.
    This other function in the DLL is for generating digital output
    and it worked as it should, when tested from LV.
    Anyway if someone is interested, I got it working by using
    the LoadLibrary and GetProcAddress function, as in the
    source code thatI posted earlier.
    I will investigate what is wrong with that digital output, and
    post into a another thread if I have problems with that.

  • How to call Labview DLL from VB2005

    Dear all expert,
    I'm a student and very new in Labview programming.
    Currently i have build a simple vi and need to convert it to dll so that i can call it from my VB.net. But the problem is how to call the labview dll from my VB.net?
    I know we must declare function something like this,
    Auto function Bodeplot Lib"..\\Bodeplot.dll" (Byval Val1 as double, Byval Val2 as double,...) as double
    but how to determine Val1, Val2 (and so on) is input for which data?  if my vi have 10 input (frequency, Kc,Fcz,Fcp,Wzrhp,Wp,k,Wz,Beta and Operation) ? and how to select the output (my application have 3 possible output : magnitup loop,phase loop, and degree loop)
    In addition, since I'm using Labview 8.0 , and as i know apllication  builder for this version cannot convert vi to dll which contain Mathscript (but unfortunely, my vi all use Mathscript), so really hope someone can help me to convert my vi to dll using Labview 8.2 (which remove this limitation).
    here I'm attach my Vi and really hope someone willing to help.
    Thank you.
    Attachments:
    bodeplot.vi ‏1049 KB

    On Sep 17, 6:40 am, cckoh <[email protected]> wrote:
    > Dear all expert,
    > I'm a student and very new in Labview programming.
    > Currently i have build a simple vi and need to convert it to dll so that i can call it from my VB.net. But the problem is how to call the labview dll from my VB.net?
    > &nbsp;
    > I know we must declare function something like this,
    > &nbsp;
    > Auto function Bodeplot Lib"..\\Bodeplot.dll" (Byval Val1 as double, Byval Val2 as double,...) as double
    > &nbsp;
    > but how&nbsp;to determine Val1, Val2 (and so on) is input for which data?&nbsp; if my&nbsp;vi have&nbsp;10 input (frequency, Kc,Fcz,Fcp,Wzrhp,Wp,k,Wz,Beta and Operation)&nbsp;? and how to&nbsp;select the output (my application have 3 possible output : magnitup loop,phase loop, and degree loop)
    > &nbsp;
    > In addition, since I'm using Labview 8.0 , and as i know apllication&nbsp; builder for this version cannot convert vi to dll which contain Mathscript (but unfortunely, my vi all use Mathscript), so really hope someone can help me to convert my vi to dll using Labview 8.2 (which&nbsp;remove this limitation).
    > &nbsp;
    > here I'm attach my Vi and really hope someone willing to help.
    > &nbsp;
    > Thank you.
    > &nbsp;
    >
    > bodeplot.vi:http://forums.ni.com/attachments/ni/170/272124/1/bodeplot.vi
    If you insist on using Labview with your project then you should
    consider using ActveX in place of using a dynamic link library to
    interface to your VB.net code. You don't need "Application Builder"
    if you use ActiveX. The Student, Basic and Full development versions
    of Labview for Windows come with ActiveX capability. For more
    information on ActiveX look up the subject ActiveX in Labview's Help
    File.
    Howard

  • New menu items in the Admin and Contributer interfaces

    Hello,
    While creating some tree tabs or start menu items I noticed, that some of them appear in the Admin interface, others in the Contributors. So, the question is: is it a feature of web center sites or what, because in the fatwire all newly created items could have been found in the admin interface.
    PS using JSK 11.1.1.6.0
    BR Denis

    Out of the box we placed all content contribution functions in the contributor UI. We want users to use the new UI. Hence the removal from the Admin (formerly Advanced UI) UI. So the Admin UI is not more oriented to Admin/Dev tasks and does not show content assets.
    Mariam Tariq
    WebCenter Sites Product Management

  • Security exception when trying to call a DLL from an applet

    Hi all,
    I really hope someone out there can help me. I'm trying to call a windows DLL from an applet but always get some error when the call to the DLL comes. If I run it on the command line (calling a dummy main function that only calls the dll) I don't get any error. However, with the -Djava.security.manager, I get an ExceptionInitialiserError. When running it in a browser, I seem to get any of three errors, the above, securityAccessControlException (as I was expecting) and even NoClassDefFoundError.
    I realise of course that this has to do with the permissions in effect but nothing seems to happen when I change the policy file, so I have to feeling that I'm chaning the wrong file. The one I'm using is the one the JRE entry in the registry is pointing to, Java Runtime Environment->CurrentVersion...
    I even tried giving everything in the applet's directory AllPermission.
    So what I'm wondering is this. Is there any way to check if your policies are actually working and when you update the files, what do you need to do to make the changes take effect?
    Best regards,
    G�sli

    I have the same problem. Have you solved your problem, if so please let me know what the solution is.
    Einar �rn

Maybe you are looking for

  • ORA-12154 while installing Oracle 10g on windows 7

    Hi, I am trying to install Oracle 10g express edition on my machine (core 2 duo 2.93) running on Windows 7. The installation moves on perfectly for the 1st step and while running the 2nd step (Net configuration Assistant), it gives the ORA-12154 erro

  • X failed login attempts

    I have a test computer with slackware on it. Every time I login, it displays who logged in and how many failed login attempts there were. I like this and I would like this feature too on my archlinux box, but I don't know how to do this. Can anyone e

  • Is it safe to force eject a Time Machine disk that is being encrypted?

    The Time Machine encryption process is taking over 8 hours, is it okay to force eject it (using Finder's force eject command, not by unplugging the cable) so I can finish the encryption later?

  • Mysqldump command execution.............

    public class ProcessDemo public static void main(String args[]) try String str="mysqldump -u root -p threadpool>thre.sql"; ProcessBuilder pb=new ProcessBuilder(str); pb.start(); catch(Exception e) System.out.println(e); }hifriends.. Iam execute the '

  • Moving a page in PAGES

    HELP !!   The new PAGES does not allow you to move a completed page to another part of the document. This is fine if it just a text box that needs to be moved, but if you create an elborate ad, for example, this is a bit problem.