Posts filed under ‘code’

Upgrading to MIL-Lite 9

More about the MIL-Lite upgrade, I have had several problems. I should start by mentioning that we require our applications to work on MIL-versions back to 6, in order to be able to support the excisting customer base:

– Matrox have strengthen the typing on all MxxxInquire functions. Probably a good idea, but it means that all previous uses of the functions, for example MBufInquire is not supported anymore and have to be upgraded. Since we are dealing with pointers here, pointers to stuff of different lengths, this is not an easy upgrade. My solution was to use #if M_MIL_CURRENT_INT_VERSION >= 0x0900 in those places where I was unsure about whether further use of the pointers required a specific width.

– I am unable to retrieve previous hanlder ptr and user handler ptr:
The type of the third parameter is not supported anymore (MAPPHOOKFCTPTR)

– The most serious problem is that Matrox has ceased support for the Mvga functions. I used them for getting a pointer to a DIB structure, in order to draw the dib to a printer device context. I canot find a real alternative to these functions

– And, not related to code, I am not able to debug the application as I constantly get an error message about missing license. However I have a Matrox Meteor 1394 card installed, with a Sony 1394b camera. I am not sure why this does not work – perhaps the Meteor is not supported in version 9, or there is still problems with 1394b speeds. Anyway I will order a USB license key.

– The Matrox developer forum is a closed one. Whenever I try to enter, typically every sixth month, I am not able to log on. Of course I have a valid support agreement and all that, but I do not remember my username or my password. I do remember the email address I am registered with, but it seems not to be enough. So I am not able to see any posts. I don’t understand why the access needs to be that restricted.

So at the moment, I am not able to get Mil-Lite 9 to work on Vista – or any version of MIL to work on Vista, I am not able to get help through the forums, and I wonder whether I rather should switch to another vendor!

September 27, 2008 at 2:13 pm 6 comments

Cleaning up 10 years of outlook history

When upgrading to Vista and Outlook 2007, I decided to go through various backups and get 10 years of outlook use into one mailbox file (outlook.pst). After collecting several different .pst files, I opened all in Outlook. Thereafter I moved mail messages from the backup .pst files into the current one. However, then a problemed surfaced: When moving a folder hierarchy of mails (e.g. “personal folders\archive\…”) between an old .pst file into a new one with an identical folder hierarchy outlook automatically create a sequence numbered folder (e.g. “personal folders\archive1\…”). This was not what I wanted, and not what you are used to when moving files around your harddisk(in that case you get a replace question or something like that).

Anyway, there was no easy solution here, other than going through that hierarchy and copying the contents of each subfolder in the backup .pst to the similar subfolder in the target .pst. After pondering about for close to an hour, I created this macro vbscript to do the job:

Option Explicit

Sub MoveToArkiv()

Dim objFolder As Outlook.MAPIFolder
Dim objFolderFromBase As Outlook.MAPIFolder
Dim objFolderToBase As Outlook.MAPIFolder

Set objFolder = Application.Session.Folders.Item("Personal Folders")

' Set the two next lines to the approprite to and from folders
Set objFolderFromBase = objFolder.Folders.Item("Arkiv3")
Set objFolderToBase = objFolder.Folders.Item("Arkiv")

' Recursively go thorugh the folders and subfolders, moving every item
MoveItems objFolderFromBase, objFolderToBase

End Sub

Sub MoveItems(objFolderFromFolder As Outlook.MAPIFolder, objFolderToFolder As Outlook.MAPIFolder)

Dim objFolderSource As Outlook.MAPIFolder
Dim objFolderTemp As Outlook.MAPIFolder
Dim objFolderTarget As Outlook.MAPIFolder
Dim blnFound As Boolean
Dim objMailToMove As Outlook.MailItem

For Each objFolderSource In objFolderFromFolder.Folders
blnFound = False
' check whether a similar folder exist in target
For Each objFolderTemp In objFolderToFolder.Folders
If objFolderTemp.Name = objFolderSource.Name Then
Set objFolderTarget = objFolderTemp
blnFound = True
End If
' If not found, create
If Not blnFound Then
Set folderTarget = folderToFolder.Folders.Add(folderSource.Name)
End If

' For each subfolder runs this procedure
MoveItems objFolderSource, objFolderTarget

' Then copy all items in the folder
For Each objMailToMove In objFolderFromFolder.Items
objMailToMove.move objFolderToFolder
End Sub

To use it edit the two lines at the top to set the correct base folders for moving from and moving to. The script was used with Outlook 2007 but should work on Outlook 2003 as well.

March 24, 2007 at 12:08 am 3 comments


July 2020

Posts by Month

Posts by Category