Home

PowerForce (Internal Only) Support™


This is faq2

 

 

Windows .dll error messages


These are .ocx / .dll messages experienced in programming, where, why & how resolved (if possible).

error number message further details
-214718113 catastrophic failure saw this message when programming to outlook. When outlook is not started on workstation, the code dies rather crudely.
-2147221005 (800401F3) Invalid class string. registry_key= 'VSPRINTER7.VSPRINTER.1mpd'
oleObj = OleCreateInstance(registry_key)
status = OleStatus()
-2147352567 exception occurred  
-2147352567   SQL
-2147467259   SQL
     
     
     
     

 

 

link to Microsoft KB article on error messages The list is apparently from winerror.h (C++)

Top of Page

SW


  • [W] scheduling_workbench
  • [W] time_bookings - edit shift window

Batch Processing


The following is the shortcut to the batch processor.

"\\<<powerforce_share>>\Oinsight\OINSIGHT.exe" /ap=pfsec /un=pfsec /mode=batch /window=batch_reporting_monitor /entity=nlpv /pfuserid=reportbatcher

This is likely to change with rel 9.x using the RTI_SCHEDULER.

Top of Page

Programming Tricks


  • AUTO TIMEOUT in OI
    On the create event of the menu, do something similar to this:

    call set_property(@window,"TIMER", 10000)
    call set_property(@window,"@TIME",time())


    And then, on the timer event of the menu (MDI Frame), have something similar to this:

    call yield()
    Time = get_property(@window,'@TIME')
    CurrTime = time()
    DeltaTime = CurrTime - Time

    // if it has been 60 minutes / 3600 seconds
    If DeltaTime > 3600 then
    x = dialog_box('AUTOSHUTDOWN', @window, '')
    End

    Have various processes update the @TIME property of the MDI Frame, as needed.


 

  • Sample program code for POPUP (sample_popup.txt)
  • exists = 1
    IF rowexists('SYSOBJ','$':progname:"*":@appid<1>) ELSE
        IF rowexists('SYSOBJ','$':progname) ELSE
            exists = 0
        END 
    END

    IF exists ELSE
        err = 'Invalid Program'
        GOTO error  
        RETURN
    END


  • starttime   = date() + time() / 86400

  • void = set_property(@WINDOW,"@THINGO",value)

  • REPBIL08 has logic for multi-week print

  • cancelled = get_printer("CANCEL")
        IF cancelled THEN 
            eof = 1
        END ELSE
            void = set_printer(" ",printline)
        END


  • CALL SET_PROPERTY(@WINDOW,"REFRESH",0)
    CALL BULK_SET_PROPERTY(CONTROLS,PROPERTIES,VALUES)
    CALL SET_PROPERTY(@WINDOW,"REFRESH",1)


  • now = iconv(oconv(date(),'D/'):' ':oconv(time(), 'MTS'), "DT^S") - gives as unique a key as possible for time stamping.


  • use a user-defined property, for example @BUSY, to flag that the processing is active.


    isBusy = Get_Property(CtrlEntId, '@BUSY')
    if isBusy then
    return 0
    end

    unused = set_Property(CtrlEntId, '@BUSY', 1)
    * Do processing here, including Yield() statements
    * ....
    Set_Property(CtrlEntID, '@BUSY', 0 )

    return 0

  • The sysadmin menus window is oryx_menu_def. To run it standalone.

  • Declare function UCASE
    menuName = UCASE("TEMP":RTI_CREATEGUID("b"))

  • [S] nv_disable_ghosting
    I've just discovered that an application can disable this behaviour (ie going grey and unresponsive) by calling the DisableProcessWindowsGhosting() Windows API function on startup. This "Disables the window ghosting feature for the calling GUI process.

    Window ghosting is a Windows Manager feature that lets the user minimize, move, or close the main window of an application that is not responding.

    "Not only that, but it seems to free up the CPU quite a bit, making OI processing faster - even on XP!

  • > oeprofile.log to DUMP boot sequence.

  • How to close a window whose WRITE event sends a close event to the form?

    In this situation the Window will close properly if the user closes through the write event. However, if the user closes using the "X" at the top right of the window, OI will prompt "Save Changes". If the user selects 'Yes', the Close calls Write, which then calls Close again. OI will debug when Close tries to run twice.

    The Solution? Ask the window is it is closing? Use retstack() to see which programs are running, if WINDOW.CLOSE if in the stack, you are already closing. The code is as follows:
    declare function retstack
    * Pre-write...Do some stuff...
    Call forward_event()
    * Post-write...Do some stuff...
    stack = retstack()
    cmd = "CLOSE.WINDOW"
    is_closing = INDEX(stack, cmd,1)
    if is_closing else
    call send_event(@window,"CLOSE")
    end

  • cancelled = Get_Printer("CANCEL")

    - then set eof = 1

  • LOOP
    this_item = list[x,@FM]
    WHILE bol2() < x
    x = col2() + 1
    ...
    ...
    REPEAT

  • timestamp = date() + (time() / SECS_PER_DAY$) (== 86400)

  • Web Browser Control exposes MSHTML (MS rendering engine & DOM). shdocvw.dll.
    Place an OLE control on your form, & set the "text" property to "Shell.Explorer".
    call send_message(@window:".OLE_WEB", "OLE.Navigate2", "http://www.envizion.com.au").

    Loading a local html file: ...,"OLE.Navigate2","file:///d:\html\file.html", including .pdf files. Browse the local file system "OLE.Navigate2", "file:///c:\windows").


  • loading content from a Basic+ string.
  • CALL SET_PROPERTY(@WINDOW,"REFRESH",0)
    CALL BULK_SET_PROPERTY(CONTROLS,PROPERTIES,VALUES)
    CALL SET_PROPERTY(@WINDOW,"REFRESH",1)

  • @WINDOW
    @FOCUS
    @SELF
    OINSIGHT /CA=caption /BN=0

    Use an existing POPUP to display only 2 keys

    existingpopup = 'CONTACT_TYPES'

    popdef = ''
    popdef<PMODE$> = 'K'
    popdef<PDISPLAY$> = 'EMAIL_INV':@VM:'EMAIL_PAY'

    result = popup(@Window, popdef, EXISTINGPOPUP)


    x

    TheSelect = 'SELECT SYSTABLES WITH @ID STARTING WITH ':Quote('KRON_'):'
    OR WITH @ID STARTING WITH ':Quote('MAINT')

    RLIST(TheSelect, 5, '', '', '')

    eof = false$
    TableList = ''
    Loop
    Readnext tbid else eof = true$
    Until eof do
    TableList := tbid:@VM
    Repeat

    TableList[-1,1] = ''

    SelectedTables = ''

    popdef = ""
    popdef<PFORMAT$> = "Table":@svm:40:@svm:"L"
    popdef<PDISPLAY$> = TableList
    popdef<PMODE$> = "L"
    popdef<PSELECT$> = 2
    popdef<PTITLE$> = "Select the relevant tables"
    popdef<PTYPE$> = "F"
    popdef<PINITSELECT$> = SelectedTables
    popdef<PCaptureEsc$> = True$


    result = Popup (@Window, popdef)
    In the above definition, mode is the field that says I'm passing 'L'iteral data and display is the actual data
    If mode was 'K', then display would be a vm list of keys and you would need popdef<PFILE$> to specify the which dictionary

    SelectedTables would be an @vm list of rows you want to appear as already selected in a multiselect popup or a single row otherwise.


    x

    result = Popup (@Window, popdef, existingpopup)
     So yours may look like this

    popdef = ''
    popdef<PMODE$> = 'K'    ; // just in case it isnt already
    popdef<PDISPLAY$> = 'EMAIL_INV':@VM:'EMAIL_PAY'

    result = popup(@Window, popdef, contact_types)


    This might be a writeup on how Events propogate:

    My current understanding of promoted events, the event chain and how OLE events figure into this.
    They're having an issue with OLE events triggering before other events are finishing, eg the click of an OLE button is happening before the Lostfocus of the previous control has done its thing. I believe its the way the frameworks are implemented as Don told James, its expected behaviour. Regardless of the background, I did my best to explain the steps to James and whilst I'm sure you're atop of all this, thought it might be handy to add to your list of things to remember documentation. That wasn't all lost with the fried server was it? Anyway, the crux of the info is below for you to do with what you will.

    Your application is 'YOURAPP'
    Your test window is 'TEST'
    Your editline is called 'DATE'
    The event you're firing is the 'LOSTFOCUS'

    When the lostfocus event occurs on the date editline, whilstever you continue to return a 1, the following actual events are checked and run if something is found. They do so in this order.

    1. YOURAPP*LOSTFOCUS*TEST.DATE ...
    2. YOURAPP*LOSTFOCUS*TEST ...
    3. YOURAPP*LOSTFOCUS.EDITFIELD.OIWIN* ...
    4. SYSPROG*LOSTFOCUS.EDITFIELD.OIWIN* ...
    5. YOURAPP*LOSTFOCUS..OIWIN* ...
    6. SYSPROG*LOSTFOCUS..OIWIN* ...
    7. YOURAPP*..OIWIN* ... SYSPROG*..OIWIN* ...

    Which in english means

    1. Run any lostfocus code that is specific to the 'DATE' editfield on the 'TEST' window
    2. Run any lostfocus code that is specific to the 'TEST' window
    3. Run any lostfocus code that is specific to editfields on ANY window in application 'YOURAPP'
    4. Run any lostfocus code that is specific to editfields on ANY window in application 'SYSPROG'
    5. Run any lostfocus code that is specific to ANY window in application 'YOURAPP'
    6. Run any lostfocus code that is specific to ANY window in application 'SYSPROG'
    7. Run any code that is specific to ANY window in application 'YOURAPP'
    8. Run any code that is specific to ANY window in application 'SYSPROG'

    Of course, the more inheritance levels you have, the longer that chain is but hopefully you get the picture.

    Now my understanding of the qualify_event is that its job is to tell OI what point in the chain should any OLE events be sent to. In other words, OLE events themselves don't automatically follow this process above. In fact OI ignores them altogether unless you specifically qualify the event, which is why we do it. Qualifying tells OI to firstly listen for whichever OLE event you qualify, (in your case, all of them) and then when you hear one, run any code specified at the point in the chain you've qualified to.
    That's where the EventKey comes in. Your EventKey in your qualify message is YOURAPP*..OIWIN* which if you look back up is the 7th point in the chain above. So, whilst your lostfocus event makes its way through the chain to that point, the OLE click goes directly there. Now, admittedly, this is still a little grey area but it is therefore conceivable that the two can get in each others way.
    Qualifying to here makes sense in the context of the frameworks because that event will be found in every OI app so nothing other than installing frameworks is required and promoted events just start working.

    What do we do differently?

    Our EventKey points to YOURAPP*OLE.OLECONTROL.OIWIN*

    As you can see, that doesn't appear in the event chain above at all but is the equivalent of line 3 but for OLE events not LostFocus events. So my guess at the grey area is that in our case, the lostfocus event gets to finish its entire chain and then the OLE chain begins. In your case, the OLE event is somehow intercepting the lostfocus because they are both trying to run the same event exe but the OLE one gets there first whilst the lostfocus is resolving itself higher up the chain.

    Now if all you do is change your qualify to point here, then the OLE events won't actually fire at all which is why they wouldn't do it within the frameworks. This event would not yet have an entry in the 'SYSREPOSEVENTEXES' file or if it does, it wouldn't be calling your code anyway. So it would appear as if the OLE controls just don't work. The other piece of the puzzle is to use the OI Event Designer to generate promoted event for the OLE event on any OLE control.

    Dave G can show you how to do that if you haven't done it before. He wrote the thing. The result would be that any time an OLE event occurs the YOURAPP*OLE.OLECONTROL.OIWIN* would run calling the routine pe_olecontrol_ole. That is where you do your generic OLE stuff.


    To turn off DEP - exec cmd as Administrator

    bcedit /set nx AlwaysOff
  • Old way of doing promoted events
    [CreateEvent] of window - make it a script, which calls the commuter module for the window with ("CREATE",CreateParam) - to pass in what the window was called with.

    This is mainly when invoking a window programatically & it wont' behave correctly. The above generally is the fix.







Top of Page

Running OI in Remote App (not desktop)


(taken from OI works conversation) I have RemoteApp launch a boot script so I can customize the launch process without impacting the RemoteApp icons. Attached is a stripped down version of a VBS script used to set the mapped drive and launch OpenInsight


Set wshNetwork = CreateObject("WScript.Network")
Set objShell = CreateObject("Wscript.Shell")

Dim MAPPED_DRIVE
Dim strApp, strAppArgs, strAppShare

MAPPED_DRIVE = "X:"
strApp = MAPPED_DRIVE & "\Path\OINSIGHT\OINSIGHT.exe"
strAppArgs = "/ap=APP /DV=0"
strAppShare = "\Server\Share"

'Try to remove and re-attach the mapped drive incase it points to the wrong server
On Error Resume Next
WshNetwork.RemoveNetworkDrive MAPPED_DRIVE , True, True
On Error Goto 0
wshNetwork.MapNetworkDrive MAPPED_DRIVE, strAppShare

'
'Before launching OpenInsight we must change to the OpenInsight directory
'Get the path fo the apllication and strip out the application path
'
arrPath = Split(strApp, "\")
For i = 0 to Ubound(arrPath) - 1
strAppPath = strAppPath & arrPath(i) & "\"
Next

'Change to the directory and execute OpenInsight
objShell.CurrentDirectory = strAppPath
objShell.Run strApp & " " & strAppArgs, 1, True



Try customizing it for your application and publishing a RemoteApp that points to the script instead of directly to OInsight.exe

Section


SRP Email Executables

The SRP Mail Utility Install should have installed one stored procedure executable. Examine the SYSOBJ to verify the existence of $SRP_SEND_MAIL. If this record is missing, you can re-run the setup or manually add it using the following steps:

  1. Create a new record

  2. Copy and Paste the following text

    SRPMAIL

    LPASTR STDCALL SRPSendMail(LPASTR, LPASTR)
    LPASTR STDCALL SRPSendMail(LPASTR, LPASTR) AS SRP_Send_Mail

  3. Save the record in SYSPROCS as DLL_SRP_MAIL

  4. From the command line, type the folloing:

    run declare_fcns "DLL_SRP_MAIL"

 

New report writer (9.3.1)


Top of Page

RAWS


Checking web_access: [T] SYSTEM_CONTROLS / sys_web_settings<4> log_http, writes to PHONE_LOG

Top of Page

SQL


Top of Page

ACS


  • [S] mpd_import_acs_openbal
    [S] mpd_import_acs_emps

    [W] import_employees
    [S] nv_import_employees (commuter module)
    [S] nv_import_acs_employees
    [S] nv_excel

Billing


Top of Page

EDMEN


Changes to SQLExpress (to make Dashboard work)

Sql Server Configuration Manager
-> SQL Server Network Configuration
-> Protocols for SQLEXPRESS
-> Shared Memory
-> Enabled => false
-> TCP/IP
-> Address
-- on all addresses and the 'global' section down the bottom
-> Set Dynamic Port to blank
-> TCP Port to 1433

 


Top of Page

Miscellaneous


  1. Windows 7 has an issue with displaying OI windows correctly. The following article has details of the problem and the fix. Here is the .reg fixto apply to your Windows 7 fonts.
    windows 7 fonts

  2. You'll usually find the Virtual Store for the Windows folder here:

    C:\Users\<username>\AppData\Local\VirtualStore\Windows
  3. Upgrading from pre-8.3 requires running

    [S] convert_payclass_elements_sub
    atop of running a table_update - use the most current data table patch.
    [W] build_deploy_table
    ** all clients are updated, & this should never be required again **

  4. Guidelines for choosing OI frame size
    up to 50 bytes : 1024 bytes
    51 - 100 bytes : 2048
    101+ bytes : 4096

[SYSENV/RCI_MMS] has default config so that OI reports use some ocmpany default values
x

Top of Page

See Also


Tut Quick n Easy

FAQ page 1

FAQ page 3

FAQ page 4

FAQ page 5