Sprezzatura's attention to the smallest details are legendary. On Thursday I finished up the code for a window we're converting from ARev to OI 9.2. I was just about to start on the softkeys when I see it's 4:00 so I figure this is a good stopping point and I head off to pick up the kids. I leave the office, and Ellen (the office manager at Sprezz Towers West) teases me about leaving before her on Christmas break. I head home, and cycling down Spruce Street I think there's loads of extra delivery trucks, but very little traffic. I chalk this up to being just before Christmas. As I walk to the daycare center, I talk to my dad, whose a little confused why I'm picking them up now. I get Jacob and his class is on the way to the gym, and I thought that's a bit odd at this time of day, but I've only been picking up the kids since Monday, so I'm not clear on their schedule. As we walk home, Jacob and I are talking about how the days are getting longer a...
Just before Christmas we were invited by one of our clients to visit their site and to perform a number of OI related tasks in a very finite time frame. Specifically to upgrade a 16 bit OI 3.7.5 production system and an OI 8.0 web based system to OI 9.2+ whilst installing the UD Heavy. We were allocated 5 days to do this so were confident that it was achievable. Of course our confidence was rooted in real world experience - both of of our combined skill sets and of typical UK weather... So early Friday afternoon came and exercising caution the Sprezz lead consultant ("the Sprezzie") on this project began the 200 mile drive to the client - this was to be a Sat/Sun/Mon/Tue/Wed job to minimise impact on the factory production system and to fit in with some tight scheduling requirements for Sprezz. Unbeknownst to us this was to mark the beginning of some of the worst weather in recent UK history. In a normal world this 200 mile journey would take 3.5 hours. Two hours into t...
In this post we’re going to turn our attention to an old Arev subroutine called Delay() that can still be used in OpenInsight. It’s a simple function and is designed to halt a Basic+ program for a specified number of seconds before continuing again (full details can be found in the OpenInsight on-line help). However, while Delay() made the transition to the Windows world, it still behaves in a fashion befitting its DOS/Arev heritage - i.e. it expects to run in a single, non-multitasking environment. Internally it simply sits in a tight until loop until the nominated interval has passed after which it returns. This is all well and good but on a modern OS this steals virtually all the CPU time, which is silly when you consider that the actual intent is to simply “do nothing”! So, assuming that we actually want to introduce a delay of some sort into a program, what we really need to do is only put the actual OpenEngine thread (i.e. the thread that executes your Basic+ code) into a sta...
For a while now I've been suffering with an annoying problem when running OI on my Windows 7 laptop: any window or control that used the "default" font was rendered at the wrong size - it was being rendered as though I had a high DPI (120) set, which of course I didn't - the laptop was set to run at 96 DPI. Here's a couple of examples to show you what I mean: None of my other PCs running OI had this problem - just my laptop. The only difference was that the laptop OS was installed by Dell, whereas all my other machines were installed by me. After some searching I came across the following blog post which gave the solution: Windows 7, bitmap fonts and Microsoft Dynamics GP Basically the DPI was set to 120 during the installation process which means that the standard OS bitmapped fonts were installed as 120 DPI rather than their 96 DPI versions. Unfortunately in Windows 7 these fonts are not changed by a user's individual DPI settings - they are system wid...
To my mind one of the longest-standing mysteries in OpenInsight has been the purpose of the "Dialog box" checkbox in the Window Properties dialog as you can see here: For years the function of this checkbox has eluded me (and my erstwhile colleagues), so much so that I believed it was simply something that the original Rev programmers intended to use but never implemented. Well, after some recent work with the Revelation crew I came across the answer, and it's really simple: It's used by the Repository( "EXECUTE" ) method for launching a window - if it's checked then the Repository function calls the Dialog_Box() function to execute the window instead of the normal Start_Window() function. Mystery solved!
Here at Sprezz Towers we're hard at work on the Big Project: a large Arev to OI conversion using our shiny new promoted event framework (well it ain't that new but it gets more polished each time we use it). Part of this week's programming fun has been implementing Arev Softkeys functionality as a menu that dynamically configures itself based on the active MDI child - we have a promoted event that simply alters a static "placeholder" menu on the fly using a combination of properties such as VISIBLE, ENABLED, TEXT and so on. Visually all this was working really well, but as I waded into event handling I came across an unexpected problem: No events for the softkey menu items would fire! Hmm... First of all I decided to check if the MDI frame was actually being told by Windows about the menu click: The trusty Microsoft Spy++ tool soon revealed that the frame was indeed receiving the menu item's WM_COMMAND message, but still nothing was getting to OpenEngine. T...
The Rev community probably won't be aware of this but this month we're running an advert for Sprezzatura in a "mostly small business" magazine here in the UK. We figure that small business owners are sufficiently independently minded that they'll be able to see the benefit of custom software over commercial off the shelf software that still needs heavy customisation but costs ten times as much. The target market place is sophisticated so we don't want to hit them with reams of copy - rather we want to appeal to their innate good sense. You don't as a rule get to grow a small business by being stupid. So the advert we came up with is reproduced here :- We thought (and fought) long and hard about it internally and were pleased with the end result. The advert was due to go to press on September 1st. Today (September 3rd) we received an email addressed to info@sprezzatura.com from a gentleman who wanted us to fit him in for an appointment to tailor a suit...
We recently came across a situation where launching a popup would display a white screen where the popup should be and then GPF OpenInsight. This wasn't the effect we were actually looking for so we turned to our old friend WinDbg to track down the issue. Unsurprisingly it came down to the data table dll. (We say unsurprisingly because at the end of the day a popup is just an edittable with some extra buttons). Unfortunately this didn't help so an anguished cry rent the air as your weary reporter decried the vexatious piece of software. Another Sprezzie hearing the cry enquired as to its cause. Upon being told he asked "would you have a long column heading on your dictionary item?". This was rapidly checked and sure enough the dictionary column heading was three lines deep. This was modified to just be the necessary length and lo and behold the popup now worked. It hasn't been blogged previously by the other Sprezzie as it hadn't been reproducible - it was...
It has come to our attention recently about a misconception regarding the lore of the Universal Driver. It has been commonly accepted by all (including us here at Sprezz Towers) that on small networks (2-4 users), using one of the Universal Drivers without an NT Service is the preferred network configuration. However, after a lengthy debugging session involving OpenInsight 9.1.1 and the UD 4.6, Revelation US has verified that without a Linear Hash Server product, you must use the All Networks Driver. To quote Revelation: Yes, out of the box the UD clients are included but that is to ease the installation. You still need a proper server setup for shared access. You are right, but the “Universal Driver” refers to the combination of the Linear Hash Service and the Client Driver. Together the service and client drivers are the “Universal Driver” package. Using only the client driver without the service is only half the setup. ... No, the “All Networks” driver was a unique code base and wo...
One issue that recently reared it's head again at Sprezz Towers Support Central was the problem of using the Basic+ Rnd() function to generate a random number sequence - apparently the same series of numbers was being produced every time. On first investigation it appeared that the customer was not using the InitRnd() function to seed the Rnd() generator before asking for the random numbers. This is a documented requirement - Calling InitRnd() is an absolute necessity before using the Rnd() function. Even so, using InitRnd() as specified in the online help failed to produce sufficiently random results so we decided to take a closer look at the process to see what the problem was and how we could improve it. Under the hood the Basic+ InitRnd() and Rnd() functions are little more than thin wrappers around the srand() and rand() functions in the Windows C-runtime library. The rand() function actually produces a pseudorandom sequence of numbers, so it is not truly random at all - inst...
Following on from our recent post on how to remove the row-selection from an EditTable we came across a related issue last week that we think you might like to know about. Basically we designed a form with several EditTables, all row-select enabled, but during testing it became difficult to know where the actual input focus was as so many controls had a selection highlighted. We could have used the technique in the aforementioned blog post to clear the row-selection during the LOSTFOCUS event, but in this case we still needed to see which row was selected even though the focus was on another control. The solution we used was to change the highlight color of the EditTable during the LOSTFOCUS event, toning it down to a lighter shade than normal. We then reset it during the GOTFOCUS event. This is actually quite easy to achieve with the COLOR_BY_POS message, the only real challenge is to devise an algorithm to fade the highlight color. As usual we've saved you the trouble - here...
There's a quick way to select or deselect all rows in a multi-select edit table, and that's via the DTM_SELALLROWS message. It takes a single wParam argument which is TRUE$ to select all rows, or FALSE$ to deselect them. Here's an example: $insert logical equ DTM_SELALLROWS$ to 1085 ; * // ( WM_USER + 61 ) hwndEdt = get_Property ( @window : ".TABLE_1" , "HANDLE" ) * // Select all rows.... call sendMessage ( hwndEdt , DTM_SELALLROWS$ , TRUE$ , 0 ) * // Deselect all rows.... call sendMessage ( hwndEdt , DTM_SELALLROWS$ , FALSE$ , 0 )
Here at Sprezz Towers we're big fans of trying to write clean, maintainable code that lends itself to easy modification. As part of this, we like to keep our resource strings in a separate configuration row and pull them in at runtime using a call to one of our function libraries. Today this technique rose up and bit us on the proverbial... consider the following code :- begin case case memberRelatedCall = '' //* CTC012: Member call question must be answered| errorText : = zzx_Utility ( "RESSTR" , RESKEY2$ , "CTC012" , "" , 1 ) You'll see that as a friendly reminder to following programmers we include the text of the error message as a comment before the call to retrieve the error text. We were unit testing a module and ensuring that the appropriate errors messages were displayed when error conditions were found. Bu...
The Windows API provides a rich set of features for your application to utilise, but it can be a daunting task unless you’ve spent many hours programming in C/C++. Although the Windows API is well-documented on-line these days it can be a arduous task trying to map OI to Windows data types when prototyping functions and defining structures, or even searching C/C++ header files for constant definitions. Here at Sprezz Towers we've done a lot of Windows API programming over the years and we've managed to amass quite a collection of DLL function definitions, structures and constants, and you can find them all in an RDK at the link below. We've used some naming conventions with these so hopefully they don't collide with your own definitions: DLL prototype records are prefixed "DLL_WINAPI_" DLL functions are prefixed "WINAPI_" Structures are prefixed "WIN32_" Inserts are prefixed "WINAPI_" A list of all the library components can be fo...
One of the more annoying visual traits we find with the EditTable is with single row selection: There seems to be no way to unselect a row and remove the highlight once it's there, and this can lead to a confusing state when it appears that more than one control has the focus. We've often been asked how to rectify this as simply setting the SELPOS property doesn't suffice, so here's the solution - we use the Windows API SendMessage function to clear the selection like so... $insert logical equ DTM_SELROW$ to 1083 ; * // ( WM_USER + 59 ) equ DTPOS_INVALID$ to - 3 hwndEdt = get_Property ( @window : ".TABLE_1" , "HANDLE" ) call sendMessage ( hwndEdt , DTM_SELROW$ , FALSE$ , DTPOS_INVALID$ ) ...
One of the more scary things to come out of the recent Revelation conference was the frequent discussions about the new legislation coming through in the US mandating the encryption of data like SSNs. This is something that is obviously of concern to end-users and software developers alike. As some commentators mentioned: If you have a database that contains 1,000 names of Massachusetts residents and lose it without the data being encrypted, that's $5,000,000. Yikes could your business, or that of your clients, afford to take such a risk with unencrypted data? A product that we’ve been using ourselves for several years provides secure commercial grade encryption capability for OpenInsight applications (OpenInsight’s ENCRYPT_FORMAT uses an algorithm which is widely viewed as not being suitable for new applications). S/Encrypt provides multiple encryption algorithms (including AES256) to satisfy the most demanding of clients (in our case security aware financial firms and “sensiti...
Well we're back from another successful Revelation Conference and we'd just like to say a big "thank you" to Revelation for organising it. Thank you also to all of the attendees who dropped by our stand and opted to "take Sprezzatura's Speakers home with them". Whilst we don't know if it's true that "Sprezzatura always have the best giveaways" as several people commented, it is nice to know that our efforts to provide giveaways that combine a promotional message with something that you can actually use are appreciated. Highlights and lowlights of the conference will differ for everybody, but for us some of the highlights included the comments of our fellow developers. The fact that Aaron Kaplan is back with Sprezz after a two year hiatus met with universal approval - especially as he will be moving back to Philly and thus be more on time zone to help with our US clients there. He won't actually be there until summer - there are ...