Beta is out

And since version 5.2.3 hopefully is correctly installing and starting. Yet it is still an effort of a single person so the available testing abilities are limited, particularly the development is done on Windows 7 so the behavior on older platforms, especially Windows XP is untested. I noticed that the installer fails if the latest MSI installer is not present and some GUI elements, notably the Model Explorer Panel are not functional. Maybe this is a problem of older, not fully compatible with Windows 7 system libraries and can be identified and fixed. Some help with compiling WhiteStarUML on Windows XP would be appreciated.

Other significant changes came with modified COM object and library identifiers to make them distinct from StarUML and to be good COM citizens (as no distinct components are expected to exist with the same GUID). Such an arrangement should help avoid clashes with StarUML so it can coexist peacefully installed on the same machine. GUIDs of interfaces remain the same as it is perfectly valid to have the same interface implemented by different components.

If you think of creating an addin DLL component that can work both with StarUML and WhiteStarUML (and possibly other forks as well) when instantiating the COM object you may check who is calling using the system GetModuleFileName() function. As an example a COM addin initializer could look like:

StarUMLApp: IStarUMLApplication;  // defined in external scope

procedure TAddInObj.Initialize;
var
  NameInput: array [1 .. MAX_PATH] of WideChar;
  FileName: string;
  NameLength: Cardinal;
begin
  try
    NameLength := GetModuleFileName(0, @NameInput, MAX_PATH);

    if NameLength > 0 then
      FileName := ExtractFileName(WideCharToString(@NameInput));

    if FileName = 'WhiteStarUML.exe' then
      StarUMLApp := CreateOleObject('WhiteStarUML.WhiteStarUMLApplication')   
        as IStarUMLApplication
    else // Most likely StarUML.exe 
      StarUMLApp := CreateOleObject('StarUML.StarUMLApplication')
        as IStarUMLApplication;

  except
    assert(False,'Could not instantiate Application Object')
  end;
end;

From this point you can use StarUMLApp reference uniformly independently from how it was created. Of course this code snippet can be easily translated to any language supporting COM.

Posted by Janusz Szpilewski 2012-02-18