Category: Soft/Programming

  • Picture Convert

    Released today. Just added all information on html-pages and uploaded to site

    In trial a few files (10) from directory processed only and “unregistered” text placed in center of any saved image
    The registered version will work without any limitations, of course

  • Microsoft Desktops v1.0

    Русинович выпустил утилиту для виртуальных десктопов:

    http://technet.microsoft.com/en-us/sysinternals/cc817881.aspx

  • PriceWaterhouseCooper

    Очередная покупка тулзы от их сотрудника.

    С одной стороны хорошо, что один сотрудник рекомендует тулзу своему соседу, т.е. он доволен покупкой и функционала ему хватает.
    С другой стороны, раз тулза нужна многим (и не только в одном филиале), то почему бы компании не купить пакет лицензий и раздать своим сотрудникам? И им удобней, и мне приятней.

    PS: кстати такая же ситуация с Ernst&Young – тоже разные сотрудники из разных филиалов (что удивляет даже из Литвы и Чехии)  берут себе лицензии, а компания не выбивает скидки за опт.

  • save IStorage into stream

    In last days I worked with IStorage interface. For my task I needed the function to save the IStorage into file and/or stream and later to load from file/stream into IStorage.

    I wrote the next useful functions:

      procedure CreateOLEDoc(const AFileName: WideString; AStorage: IStorage);
      var
        hr: Integer;
        NewStorage: IStorage;
      begin
        hr := StgCreateDocfile(PWideChar(AFileName), STGM_DIRECT or STGM_READWRITE or STGM_CREATE or
                               STGM_SHARE_EXCLUSIVE, 0, NewStorage);
        if (hr = S_OK) then
        begin
          AStorage.CopyTo(0, nil, nil, NewStorage);
          NewStorage.Commit(STGC_DEFAULT);
          NewStorage := nil
        end
      end;

      procedure WriteStorageToStream(AStorage: IStorage; AStream: TStream);
      var
        NewStorage: IStorage;

        LockBytes: ILockBytes;
        HGlob: HGLOBAL;
        intfStream, myStream: IStream;
        oldStatstg: TStatStg;
        cbRead, cbWritten: Comp;
      begin
        HGlob := GlobalAlloc(GMEM_MOVEABLE, 0);
        try
          OleCheck(CreateILockBytesOnHGlobal(HGlob, False, LockBytes));
          OleCheck(StgCreateDocfileOnILockBytes(LockBytes, STGM_DIRECT or STGM_READWRITE or STGM_CREATE or
                               STGM_SHARE_EXCLUSIVE, 0, NewStorage));
          OleCheck(AStorage.CopyTo(0, nil, nil, NewStorage));
          NewStorage.Commit(STGC_DEFAULT);
          OleCheck(CreateStreamOnHGlobal(HGlob, True, intfStream));

          myStream  := TStreamAdapter.Create(AStream);
          try
            OleCheck(intfStream.Stat(oldStatstg, 1));
            OleCheck(intfStream.Seek(0, 0, cbWritten));

            OleCheck(intfStream.CopyTo(myStream, oldStatstg.cbSize, cbRead, cbWritten));
          finally
            myStream  := nil;
            intfStream := nil;
          end;
        finally
          NewStorage := nil;
          GlobalFree(HGlob);
        end;

        AStream.Position := 0;
      end;

  • drag file from Explorer and view/open on drop

    Today I decided to implement the new feature for all our viewers – to open the file which dropped from Windows Explorer
    When I opened the sources to implement this feature, I found that this feature is already implemented:-)

    Just forgot to include in history.

  • SMWord suite + parser for .fb2 files

    In last time the Electronic Books are very popular. Sony Reader, IBook Reader, BeBook, lBook etc

    As result, the new xml-based format for e-books was developed – FictionBook (.fb2):
    http://en.wikipedia.org/wiki/FictionBook

    All these hardware units allow to read the e-books in this format

    Today I added the new component for our SMWord suite for Delphi/C++BuilderTFictionBook
    This component allow to read any .fb2-file and extract the plain text.
    Also you may convert the text from Fiction Book into rtf (richtext) or html

    So if you want to develop the new reader or just want to add a possibility to search the information inside .fb2-files, you are welcome to order our SMWord suite.

    Now there the next formats supported:

    • .doc files (all versions for MS Word) – TMSWordDocument component
    • .docx files (MS Word 2007) – TMSWordXDocument component
    • .wpd (all versions for WordPerfect documents from Corel Office) – TWordPerfectFile component
    • .wri (MS Writer) – TWRIFile component
    • .odt (text documents from Open Office) – TOpenOfficeTextDocument component
    • .ods (spreadsheets from Open Office) – TOpenOfficeSpreadsheet component
    • .odp (presentations from Open Office) – TOpenOfficePresentation component
    • .fb2 (FictionBook, e-book) – TFictionBook component
  • new hdd for laptop

    In Saturday I buyed the new hard disk (WD2500BEVE) for my laptop (HP xt6200)
    The new disk is not initialized by default, so:
    – I plugged this unit via USB (Transcend 2,5′ IDE HDD Enclosure for USB 2.0 Port)
    – rebooted
    – opened the Control Panel\Administration\Disk Management
    – initialized the disk
    – created the main active partion (100Gb), new logical drive and formatted (NTFS)
    – created additional partion (rest 150Gb), two new logical drives (75Gb+75Gb) and formatted each (NTFS)

  • where to store the program settings (.ini)

    Most comfortable (for me personallY) place where program must store the ini-file with options/settings is the application directory. For example, dbview.exe must save the dbview.ini in same folder where .exe is

    But interface guide from Microsoft noted that these end-user settings must be saved in CSIDL_APPDATA (C:\Documents and Settings\<user>\Application Data\<Company>\<Application>)

    If application ran in MS Vista with enabled UAC and tried to write (create file) something into application directory, error raised.

    So we changed the code (to get the file name for settings):
    function GetINIFileName: string;
    var
      strFileName: string;
    begin
      strFileName := ExtractFileName(ParamStr(0));
      Result := GetUserDirectory(‘Scalabium\’ + ChangeFileExt(strFileName, ”) + ‘\’) + ChangeFileExt(strFileName, ‘.ini’)
    end;

    where
    function GetUserDirectory(const SubDir: string): string;
    var
      List: PItemIDList;
      Path: array[0..MAX_PATH] of Char;
    begin
      SHGetSpecialFolderLocation(0, CSIDL_APPDATA, List);
      SHGetPathFromIDList(List, Path);
      Result := String(Path);
      if (Result = ”) then
        Result:= ExtractFilePath(ParamStr(0))
      else
      if (SubDir <> ”) then
      begin
        Result := Result + ‘\’ + SubDir;

        ForceDirectories(Result);
      end
    end;

  • free hosting

    http://www.freehostia.com/free_hosting.html
     Data storage: 250 MB
     Monthly bandwidth: 5 GB
     Hosting for 2 domains
     NO ADS

     PHP & Perl enabled
     1 MySQL database
     10 MB MySQL DB space
     Elefante free scripts