Runtime error: Boost::foreach on temporary object

Hello,
I have strange behavior, when using boost::foreach on the r-value (temporary object).
It compiles fine, but that it causes std::bad_alloc while running. :-(
It affects both ss12 and ss-exp (March one, CC: Sun Ceres C++ 5.10 SunOS_i386 2009/03/06).
The precompiled code posted here is generated by sstudio-express.
The problematic line is:
foreach(std::string hit_type, utils::split((**anim_itor)["hits"]))
While this is OK:
std::vector<std::string> pom = utils::split((**anim_itor)["hits"]);
foreach(std::string hit_type, pom) {
Here is precompiled code:
http://filebin.ca/gpubbw/unit_animation.i
Full source code can be found here (line 557):
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_animation.cpp?rev=33993&dir_pagestart=250&view=markup
Can you please check if it's suncc bug - in case yes, are all info which I provided here enough to put inside bug report?
Thanks a lot,
Petr

Hi
Looking at
http://www.boost.org/doc/libs/1_38_0/boost/foreach.hpp
there's this
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)                                                      \
  || BOOST_WORKAROUND(__BORLANDC__, < 0x593)                                                    \
  || (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER))                   \
  || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x570))                                      \
  || BOOST_WORKAROUND(__DECCXX_VER, <= 60590042)
#  define BOOST_FOREACH_NO_RVALUE_DETECTIONso there's something specific for Studio 10.
I have 2 ideas:
Change the above __SUNPRO_CC test to 0x590 or 0x510
Use the -featuers=tmplife option.
Paul
Edited by: Paul_Floyd on Mar 23, 2009 4:50 AM

Similar Messages

  • I am mac user and want to create Object in VBA macro. when i write "set objwrd=createObject("Word.Application")"- it returns "runtime error "492" can't create object". now what it alternative to create object for word in excel macro???

    I am mac user and want to create Object in VBA macro. when i write "set objwrd=createObject("Word.Application")"… it returns "runtime error "492" can't create object". now what it alternative to create object for word in excel macro???

    Any help here...
    http://support.microsoft.com/kb/288117
    http://www.macworld.com/article/1154785/welcomebackvisualbasic.html

  • Gettting 0x800a139e - JavaScript runtime error: SecurityError on creating websocket object in .js page

    Hi Team,
    I am creating a websocket object in the existing webapplication I have. When creating the object with url :    var url = 'ws://localhost:4334//WebSocketServer.ashx?name=Satya'; getting error  . 0x800a139e - JavaScript runtime error: SecurityError.
    var ws;
    var message ;
    var messageVal;
    function $(id) {
        return document.getElementById(id);
    function wireEvents() {
        $('sendChat').addEventListener('click', function () {
            message = $('message');
            ws.send(message.innerText);
            messageVal=message.innerText;
            message.innerText = '';
        $('btnCancelChat').addEventListener('click', function () {
            ws.close();
    function Chat () {
        wireEvents();
        var conversation = $('conversation');
        var url = 'ws://localhost:4334//WebSocketServer.ashx?name=Satya';
        //var url = 'ws://https://127.0.0.1:444/WebSocketsServer.ashx?name=Satya';
        ws = new WebSocket(url);
        ws.onerror = function (e) {
            conversation.appendChild(createSpan('Problem with connection: ' + e.message));
        ws.onopen = function () {
            //conversation.innerHTML = 'Client connected <br/>';
        ws.onmessage = function (e) {
            conversation.appendChild(createSpan(e.data.toString()));
        ws.onclose = function () {
            conversation.innerHTML = 'Closed connection!';
    The same works fine if i create a new application i access as a HTML page on page load.
    Can any one help me on this?
    Thanks,
    Satya Chenna

    http://forums.asp.net/
    The JavaScript section is at the above forum.

  • Runtime Error '1004':, Method 'Intersect' of object '_Global' failed

    Hello
    I am getting a runtime error 1004, can someone tell me why?  I am getting the runtime error on the first Application.Intercept statement.
    Thank you for your help!
    smsemail
    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    If Not Application.Intersect(Target, Me.Range("A:A")) Is Nothing Then
    lastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
    If lastRow < 17 Then
    Exit Sub
    End If
    If lastRow > 67 Then
    lastRow = 67
    End If
    Else
    Exit Sub
    End If
    If Not Application.Intersect(Target, Me.Range("A17:A" & lastRow)) Is Nothing Then
    Application.EnableEvents = False
    If Application.WorksheetFunction.CountA(Worksheets("RIPS").Range("A17:A67")) = 0 Then
    Exit Sub
    End If
    If Application.WorksheetFunction.CountA(Worksheets("RIPS").Range("B17:B67")) = 0 And _
    Application.WorksheetFunction.CountA(Worksheets("RIPS").Range("C17:C67")) = 0 And _
    Application.WorksheetFunction.CountA(Worksheets("RIPS").Range("D17:D67")) = 0 Then
    Exit Sub
    End If
    If CmdExecute = True Then
    Exit Sub
    End If
    If CmdClear = True Then
    Exit Sub
    End If
    Worksheets("RIPSSummary").Activate
    lastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
    Set SourceRange = Application.Intersect(Range("A2:A" & lastRow), ActiveSheet.UsedRange)
    MsgBox "Source Range: " & SourceRange
    Worksheets("RIPS").Activate
    lastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
    Set TargetRange = Application.Intersect(Range("A17:A" & lastRow), ActiveSheet.UsedRange)
    MsgBox "Target Range: " & TargetRange
    Exit Sub
    wsDeleted = False
    For Each acell In SourceRange.Cells
    RecordFound = True
    If Not IsEmpty(acell.Value) Then
    Set C = TargetRange.Find(acell.Value, LookIn:=x1values)
    If C Is Nothing Then
    RecordFound = False
    End If
    If RecordFound = False Then
    wsDeleted = True
    For Each Worksheet In Worksheets
    If Worksheet.Name = acell.Value Then
    Worksheet.Delete
    End If
    Next Worksheet
    End If
    End If
    Next acell
    If vbKeyDelete Or _
    vbKeyClear Then
    r = lastRow
    Do Until r < 17
    If Worksheets("RIPS").Range("A" & r).Value = "" Then
    Rows(r).Delete
    End If
    r = r - 1
    Loop
    End If
    Application.EnableEvents = True
    End If
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    End Sub

    It should work but maybe there's something about your workbook we can't see.
    In passing generally best not to disable screenupdating, alerts or events unless need to do so. More importantly though you should ensure they always get reset. As written you have several Exit Sub's before any code that resets them. Also in case of an error
    consider resetting them in an error handler.

  • VBA Runtime Error 1004 "Application-defined or Object-defined error"

    I have code VBA code written in MS Access 2010 (.mbd file) to write data into an Excel file (.xls file). Below is the code to write data into that excel file. When you run this code, it always throws Error#1004 "Application-defined or Object-defined
    error". When you debug the code (F8) or run it (F5), it runs absolutely fine with out any issues. I am still not able to figure it out on what exactly the issue is. This code works fine when executed in MS Access 2007.
    Below is thr code that's getting executed and when it fails, the focus is set on the 3rd last line of the code marked in double astriek mark.
    Sub PopulateReport(appExcel As Object, testcam)
    Dim Site As String, intRec As Integer, i As Integer, cnt As Integer, intRecSet As Integer, cntr As Integer
    Dim F1 As String, F2 As String, F3 As String, F4 As String, F5 As String, F6 As String, F7 As String
    Dim F8 As String, F9 As String, F10 As String, F11 As String, F12 As String, F13 As String, CAMDate As Date
    Close
    i = 0
    cnt = 0
    cntr = 0
    Set cnn = CurrentProject.Connection
    rec.Open "SELECT * FROM Site", cnn, adOpenStatic, adLockPessimistic
    rec.MoveLast
    rec.MoveFirst
    intRec = rec.RecordCount
    Do Until cnt = intRec
    rec.MoveLast
    rec.MoveFirst
    rec.Move cnt
    Site = rec(4)
    Select Case Site
    Case "Fort Worth"
    cntr = 0
    recset.Open "SELECT * FROM Employee", cnn, adOpenStatic, adLockPessimistic
    recset.MoveLast
    recset.MoveFirst
    intRecSet = recset.RecordCount
    appExcel.Application.Goto Reference:="START_FW_CL"
    Do Until cntr = intRecSet - 1
    appExcel.Selection.EntireRow.Copy
    appExcel.Selection.EntireRow.Insert
    cntr = cntr + 1
    Loop
    appExcel.Application.CutCopyMode = False
    appExcel.Application.Goto Reference:="START_FW2_CL"
    go = appExcel.Application.Range("START_FW2_CL")
    cntr = 1
    With appExcel.Worksheets("Accts. > Clearing").[START_FW2_CL]
    Do Until recset.EOF
    **.Offset(cntr, 0) = recset(0)**
    .Offset(cntr, 1) = recset(1)
    .Offset(cntr, 2) = recset(2)
    End Sub

    What's wrong about it? It can only copy what you chose to have in the recordset. If you only want some fields or fields in a different order, replace
    SELECT * FROM  with
    SELECT Field1, Field2, etc
    CopyFromRecordset is bay far the best method and runs much faster.
    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

  • Runtime Error in BW, in RSA1 transaction

    Hello Boss,
    Iam getting runtime error while activating the info object in RSA1 transaction.
      I got OSS notes also from our basis consultant, plz give suggestion how to rectify this one.
      Even while executing the program iam getting runtime error.
      In this OSS notes they mentioned while u activating DSO u get this runtime error & solutions r given. iam not activating any DSO, activating info object. plz give ur suggestion.

    Hi,
            check in ST22 what exactly is message.. Ask basis to check server space and bg process.
    Abhi

  • RH8 for Word 2003. Runtime Error 5152: Cant move focus to control

    Hi, I am trying to open a word file from the RoboHelp source files and am getting the following error:
    Runtime Error '5152': Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.
    I am using Word 2003 and RoboHelp 8. I didnt not change anything in the code, its a RoboHelp provided code. RH was installed with my netword id and with admin rights. When I click debug, it highlights the following piece of code.
    Private Function IsRoboHookLoaded() As Boolean
        IsRoboHookLoaded = False
        ' No addins, not loaded
        If (AddIns.Count = 0) Then
            GoTo IsRoboHookLoadedExit
        End If
        For i = 1 To AddIns.Count
            AddInName$ = LCase$(AddIns.Item(i).Name)
            If (AddInName$ = "robohook.wll") Then
                If (AddIns.Item(i).Installed = True) Then
                    IsRoboHookLoaded = True
                    Exit For
                End If
            End If
        Next
    IsRoboHookLoadedExit:
    End Function
    Also, when I click end and try to close the Document, I get another error:
    Runtime Error '5152': Method 'Name' of Object 'AddIN' failed.
    It again highlights the same piece of code on debug.
    Can you please suggest why this might be so?
    Thanks in advance.
    - Shubs

    The formatting is lost if the robohelp.dot template is not present in the same folder as the word document I am trying to open (and edit). The template is still present under application data\templates. Below are your answers:
    So if you have the robohelp.dot in the application data\templates folder and open the project and the doc, the fomatting is gone in the doc and it is is plain text, correct? - Yes
    Are any styles attached to the text at all? - Yes
    For instance if you highlight what was a heading 1, is it still heading 1? - Yes - It still shows as heading 1, but not as big and coloured as the headings in documents with robohelp.dot
    if you create a new help project, do you run into the same problem? - Yes
    I tried copying the styles from robohelp.dot to my document, but still it doesn't reflect the changes.
    I want to be able to open the document (with the robohelp template and its styles attached to it) and edit it, without changing any styles/formatting.
    I am not an expert on this but my feeling is it has something deeper to do with other than just the location of the template or the styles. There should be a reason for  the runtime error 5152: "Can't move focus to control....".

  • Runtime Error: CREATE_OBJECT_CLASS_NOT_FOUND

    Dear Friends,
    My system is worked fine. But after Kernel Upgradation. I couldn't run the query. Now, the problem is, when I run the query, the ABAP runtime error occurs:
    Runtime Error        CREATE_OBJECT_CLASS_NOT_FOUND
    Exception              CX_SY_CREATE_OBJECT_ERROR
    CREATE OBJECT: Class "\CLASS=CL_IM_FI_PAYREF_BADI_010" could not be found.
    What happened?
    Error in ABAP application program.
    The current ABAP program "CL_EXIT_MASTER================CP"
    terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    Error analysis
    An exception occurred. This exception is dealt with in more detail below
    . The exception, which is assigned to the class 'CX_SY_CREATE_OBJECT_ERROR',
    was neither
    caught nor passed along using a RAISING clause, in the procedure
    "INSTANTIATE_IMP_CLASS" "(METHOD)"
    Since the caller of the procedure could not have expected this exception
    to occur, the running program was terminated.
    The reason for the exception is:
    The class entered dynamically at CREATE OBJECT
    ("\CLASS=CL_IM_FI_PAYREF_BADI_010") cannot be found,
    neither locally. nor as a global class in the system.
    Can somebody Please tell me the solution of this error.
    Thanks and Rrgards,
    Rahul Asthana

    Hello Friend,
    Thanks for your Answer.
    Friend i have tried it, but still i am facing same problem.
    Thanks and Regards,
    Rahul Asthana.
    Edited by: Arun Kamath on Feb 22, 2012 3:27 PM

  • Run-time error '1004' Application-Defined or object-defined error

    Hello friends,
    My requirement is to make the cells under Columns Actual, forecast and target (Dimesnion Category) Locked.
    I've used various methods like GetOnlyRange but it didnt work.
    Now, i've selected all the cells of the sheet, where user can input and made them unlocked. ( from Right-click>FormatCells>Protection tab-->Locked checkbox unchecked)
    Then, go to "review" tab, click "Allow Users to edit Ranges",-> Protect Sheet---> ticked "Unlocked Cells"
    Then go to WorkBook Options and set a password for the worksheet.
    But on expand, I'm facing Run-time error '1004' Application-Defined or object-defined error.
    Please help.
    Please help.

    Hi,
    I think that  is VBA Runtime error, you can fix these errors by downloading in various sites.
    http://www.articlesbase.com/data-recovery-articles/vba-runtime-error-1004-application-defined-or-object-defined-error-fix-these-errors--1339060.html
    You can try with the above link.  I hope this could solve your problem.
    Regards,
    B.S.RAGHU

  • Runtime Error: Visual C++ in Xcelsius

    I have created a Dashboard in which when I try to export to PDF Format I recieve the following error message:
    Microsoft Visual C++ Debug Library
    +Debug Error
    Program: D:\ProgramFiles\Business Objects\Xcelsius\Xcelsisu.exe
    abnormal program termination+
    Which when ignored results in the follwing Pop-Up Error
    Microsoft Visual C++ Runtime Library
    +Runtime Error
    Program: D:\ProgramFiles\Business Objects\Xcelsius\Xcelsisu.exe
    abnormal program termination+
    Followed by the crash of Xcelsius.
    I use a Pentium4 machine with 1 GB RAM and have Xcelsius Enagage 2008 SP1 installed. This is also seen to crash in SP2.
    I use a Excel Sheet based data which forms the database on Local Machine.
    I am ready to share the XLF file in case it is needed as I unable to work on it at all except for designing.
    Regards
    Vikash

    I'm not sure if it's worth you trying to install the vcredit.msi  which can be found in the Xcelsius   \package\redist  folder. which is to do with C++ components.
    Not sure if this will solve the problem , but might be worth a go.
    Ian
    Flynet
    [http://www.flynetviewer.com]

  • VA01 runtime error

    Hi Frens,
    I am running tcode VA01/02 or 03 but getting the same runtime error stating that :
    The data object "VBAK" does not have a component called "OIISOIL". Include VBAKDAOI is referring to this field and making it fail.
    Now versions of the system is following :
    Basis is
    PI_BASIS       0013     PI_BASIS
    SAP_APPL 600     001  Logistics and Accounting
    Appreciate any input. Is there any patch or note that is missing.
    Thanks for any help.
    Regards,
    Rahul

    This could be due to some recent code changes in SAPMV45A...may be some user exits...
    The Dump which is obtained can be analysed by an ABAP person and could lead you tot he right issue.
    Hope this helps
    Regards
    Biju

  • BEx Web Application Designer Runtime Error 398

    Whenever I close a Template Window the runtime error "398: Application-defined or object-defined error" occurs.
    This error happens since about 1 week - before there weren't any problems. The error occurs for each template that is closed.

    Hi all,
    if you would search in OSS or in the forum you would find note 819131
    or topic
    WAD run-time error message
    Kind regards
      Heike

  • Runtime error 429, activeX component cant create object while using netbet pro on windows 7 & 8.1 HELP!!!

    runtime error 429, activeX component cant create object while using netbet pro
    does anyone know what I could do to fix this problem??? netbet pro was't available for a while then it's back but has yet to run

    What's netbet pro?
    I'd recommend asking questions about third party applications in the vendor's forum, not a Microsoft forum meant for admin scripting.
    EDIT: Ah, some gambling website...
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • Jsp calling a function in js -- object expected runtime error

    Hi,
    I have a js file. script.js
    *function popup( url ) {*
    newWin=window.open(url,'popupWindow,resizable=yes,menubar=no,status=no,toolbar=no,scrollbars=yes');
    newWin.focus();
    void(0);
    and a jsp calling the function in js
    *<HTML>*
    *<HEAD>*
    *<SCRIPT>*
    *<jsp:include page="script.js"/>*
    *</SCRIPT>*
    *</HEAD>*
    *<BODY onLoad="javascript:popup('http;//www.google.com');">*
    *</BODY>*
    *</HTML>*
    Now when i execute the jsp, it gives runtime error -> object expected..
    Not able to figure out why this occurs.. am I doing it the right way ?

    Do you think is this the right way to include .js file...
    <SCRIPT>
    <jsp:include page="script.js"/>
    </SCRIPT>I generally do this way...
    <head>
    <script language="javascript" src = "script.js">
    </script>
    </head>

  • SBO2004A: Runtime Error 429 ActiveX Component can't Create Object

    Hello,
    We have an Addon developed with VB6 that run without problems with SBO 6.5.
    We have upgraded to SBO2004A and I have referenced in the source code to the 2004 UI and DI. I debug mode (from IDE) we don't have problems, but when I try to execute the addon from a client, I get this error message:
    <b>Runtime Error 429 ActiveX Component can't Create Object</b>
    Thanks in advance
    Blas

    I'm using Installshield 10.5 to generate the setup file. It's much more easy and not requiered to install Framework 1.1 in each PC client before to install the Addon.
    You have to create and msi project, and write the Installscript to retrieve the install directory from parameter string passed by SAP.
    After install you must execute the AddOnInstallAPI.EndInstall to notify SAP:
    #include "ifx.h"
    prototype  LONG AddOnInstallAPI.EndInstall();  
    prototype  LONG AddOnInstallAPI.RestartNeeded();
    // OnFirstUIBefore
    // First Install UI Sequence - Before Move Data
    // The OnFirstUIBefore event is called by OnShowUI when the setup is
    // running in first install mode. By default this event displays UI allowing
    // the end user to specify installation parameters.
    // Note: This event will not be called automatically in a
    // program...endprogram style setup.
    function OnFirstUIBefore()
        number  nResult, nLevel, nSize, nSetupType;
        string  szTitle, szMsg, szOpt1, szOpt2, szLicenseFile;
        string  szName, szCompany, szTargetPath, szDir, szFeatures, szTargetdir;
        BOOL    bLicenseAccepted;
        LIST listID;
    begin     
        nSetupType = COMPLETE;       
        szDir = TARGETDIR;
        szName = "";
        szCompany = "";
        bLicenseAccepted = FALSE;
    // Beginning of UI Sequence
    Dlg_Start:
        nResult = 0;
    Dlg_SdWelcome:
        szTitle = "";
        szMsg = "";
        //{{IS_SCRIPT_TAG(Dlg_SdWelcome)
        nResult = SdWelcome( szTitle, szMsg );
        //}}IS_SCRIPT_TAG(Dlg_SdWelcome)
        if (nResult = BACK) goto Dlg_Start;
    Dlg_SdLicense2:
        szTitle = "";
        szOpt1 = "";
        szOpt2 = "";
        //{{IS_SCRIPT_TAG(License_File_Path)
        szLicenseFile = SUPPORTDIR ^ "License.rtf";
        //}}IS_SCRIPT_TAG(License_File_Path)
        //{{IS_SCRIPT_TAG(Dlg_SdLicense2)
       // nResult = SdLicense2Rtf( szTitle, szOpt1, szOpt2, szLicenseFile, bLicenseAccepted );
        //}}IS_SCRIPT_TAG(Dlg_SdLicense2)
        if (nResult = BACK) then
            goto Dlg_SdWelcome;
        else
            bLicenseAccepted = TRUE;
        endif;
    Dlg_SdRegisterUser:
        szMsg = "";
        szTitle = "";
        //{{IS_SCRIPT_TAG(Dlg_SdRegisterUser)     
       // nResult = SdRegisterUser( szTitle, szMsg, szName, szCompany );
        //}}IS_SCRIPT_TAG(Dlg_SdRegisterUser)
        if (nResult = BACK) goto Dlg_SdLicense2;
    Dlg_SetupType2:  
        szTitle = "";
        szMsg = "";
        //{{IS_SCRIPT_TAG(Dlg_SetupType2)     
       // nResult = SetupType2( szTitle, szMsg, "", nSetupType, 0 );
        //}}IS_SCRIPT_TAG(Dlg_SetupType2)
        if (nResult = BACK) then
            goto Dlg_SdRegisterUser;
        else
            nSetupType = nResult;
            if (nSetupType != CUSTOM) then
                szTargetPath = TARGETDIR;
                nSize = 0;
            endif;  
        endif;
    Dlg_SdAskDestPath2:
        if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType2;
         szTitle = "";
        szMsg = "";
        if (nSetupType = CUSTOM) then
                    //{{IS_SCRIPT_TAG(Dlg_SdAskDestPath2)     
    //          nResult = SdAskDestPath2( szTitle, szMsg, szDir );
                    //}}IS_SCRIPT_TAG(Dlg_SdAskDestPath2)
            TARGETDIR = szDir;
        endif;
        if (nResult = BACK) goto Dlg_SetupType2;
    Dlg_SdFeatureTree:
        if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SdAskDestPath2;
        szTitle = "";
        szMsg = "";
        szTargetdir = TARGETDIR;
        szFeatures = "";
        nLevel = 2;
        if (nSetupType = CUSTOM) then
            //{{IS_SCRIPT_TAG(Dlg_SdFeatureTree)     
           // nResult = SdFeatureTree( szTitle, szMsg, szTargetdir, szFeatures, nLevel );
            //}}IS_SCRIPT_TAG(Dlg_SdFeatureTree)
            if (nResult = BACK) goto Dlg_SdAskDestPath2; 
        endif;
    Dlg_SQLServer:
        nResult = OnSQLServerInitialize( nResult );
        if( nResult = BACK ) goto Dlg_SdFeatureTree;
    Dlg_ObjDialogs:
        nResult = ShowObjWizardPages( nResult );
        if (nResult = BACK) goto Dlg_SQLServer;
    Dlg_SdStartCopy2:
        szTitle = "";
        szMsg = "";
        //{{IS_SCRIPT_TAG(Dlg_SdStartCopy2)     
        nResult = SdStartCopy2( szTitle, szMsg );     
        //}}IS_SCRIPT_TAG(Dlg_SdStartCopy2)
        if (nResult = BACK) goto Dlg_ObjDialogs;
        return 0;
    end;        
    // OnSetTARGETDIR
    // OnSetTARGETDIR is called directly by the framework to initialize
    // TARGETDIR to it's default value.
    // Note: This event is called for all setups.
    function OnSetTARGETDIR()
    number nId, nIgnore, nResult;
    string szId, szTARGETDIR; 
    string wCMDLINE;
    LIST listID;     
    begin     
        // In maintenance mode the value of TARGETDIR is read from the log file.
        if( MAINTENANCE ) then
            return ISERR_SUCCESS;
        endif;
        // Set TARGETDIR to script default.
        TARGETDIR = "<FOLDER_APPLICATIONS>
    <IFX_COMPANY_NAME>
    <IFX_PRODUCT_NAME>";
        if (CMDLINE != "") then 
           wCMDLINE = CMDLINE;   
           StrReplace (wCMDLINE, '"', '', 0);
           listID = ListCreate (STRINGLIST); 
           if (StrGetTokens (listID, wCMDLINE, "|") > 0) then
              MessageBox ("Parametros incorrectos.", SEVERE);
           else
              ListGetFirstString (listID, TARGETDIR);  
              //MessageBox (TARGETDIR, INFORMATION);
           endif;
           ListDestroy (listID); 
           return 0;
        endif;
        // Read TARGETDIR from the media.
        nResult = MediaGetData( MEDIA, MEDIA_FIELD_TARGETDIR, nIgnore, szTARGETDIR );
        // Use the TARGETDIR from the media if anything was read.
        if( nResult >= ISERR_SUCCESS && StrLengthChars( szTARGETDIR ) ) then
            TARGETDIR = szTARGETDIR;
        endif;
         // Customize the default TARGETDIR for multi-instance application.
         // TODO: If you want something different customize the code below.     
         if( MAINT_OPTION = MAINT_OPTION_MULTI_INSTANCE  && MULTI_INSTANCE_COUNT > 0) then
              // Start with the current multi-instance count plus one.
              nId = MULTI_INSTANCE_COUNT + 1;
              // Find a unique TARGETDIR.
              while( ExistsDir( TARGETDIR ) = EXISTS )
                   // Convert to string.
                   NumToStr( szId, nId );
                   // Update IFX_MULTI_INSTANCE_SUFFIX
                   IFX_MULTI_INSTANCE_SUFFIX = "_" + szId;
                   // Update TARGETDIR
                   TARGETDIR = TARGETDIR + IFX_MULTI_INSTANCE_SUFFIX;
                   // Update nId
                   nId = nId + 1;
              endwhile;
         endif;  
    end;
    // OnEnd
    // The OnEnd event is called at the end of the setup. This event is not
    // called if the setup is aborted.
    function OnEnd() 
    string  wCMDLINE;
    LIST    listID;     
    STRING  DLL_FILE;
    INT     nValue;  
    LONG    nRC;
    NUMBER  nResult;
    begin
    if (CMDLINE != "") then
           wCMDLINE = CMDLINE;   
           StrReplace (wCMDLINE, '"', '', 0); 
           listID = ListCreate (STRINGLIST); 
           if (StrGetTokens (listID, wCMDLINE, "|") > 0) then
              MessageBox ("Parametros incorrectos.", SEVERE);
           else
              ListGetFirstString (listID, DLL_FILE);
              ListGetNextString (listID, DLL_FILE);  
              // MessageBox (DLL_FILE, INFORMATION);
           endif; 
           ListDestroy (listID); 
           nResult = UseDLL (DLL_FILE);
           if (nResult != 0) then
              MessageBox ("No se ha podido cargar\nAddOnInstallAPI.dll", SEVERE);
              abort;
           endif;
           if AddOnInstallAPI.EndInstall() > 0 then
              MessageBox ("Error al ejecutar AddOnInstallAPI", SEVERE);
              abort;
           endif;
    endif;
    end;

Maybe you are looking for

  • Using Report Catergory and how to Disable 'Select Range button on screen'

    Hi All, I am using logical Database PNPCE and I have created my own report category and I would like to disable the 'Select Ranges' button that shows to the right of my field for Organization Unit as I would like them to be restricted to only one ent

  • Accessing External swf's library items

    Hi, I am Using AS2 having a Main swf in which i am loading external swf (I want to access the loaded swf 's library item in the main swf is it possible), means i want to attach a movieClip from the second swf, to the first is it possible.

  • Introspection/Reflection/this

    Hi, I would like to get the method name, dynamically, using introspection/reflection. for example: //begin of problem Class SomeClass { public void SomeMethod() { System.out.println("method name == "+ this.getClass(). ...?( what goes here to get this

  • Permanently disable an account on repeated failed logins (stolen laptop)

    How? Until now I carried a limited set of documents on my laptop, so I never really worried about security breaches. Not anymore. I would like a feature somewhat similar to what is commonly found on cellphones or smart credit cards, i.e. after x fail

  • Customized menu item

    For work I'm making a JTable bean that has Sort/Search/Filter functionality. I currently have achieved all three. Right clicking in a column brings up a popup menu where you can choose "Sort Ascending", "Sort Descending", "Search...", "Filter...". Se