Way to go, CodeGear#

I know, it is a little late, but last week was stuffed with work and I did not have time to blog anything. So, all I wanted to say "Well done, CodeGear," thanks for making CodeRage II free.

Now folks, it is time for a real life conference from CodeGear - yes, we are willing to pay for that and yes, it costs much more than USD 150 for a online conference, but it is all about the face-to-face meetings...

Anyway, you all have fun attending CodeRage. Next week I'll use to prepare my Delphi CodeCamp session on Windows Vista, write a few articles and do more web development. Then I'll continue working on my localization solution, which I am going to present at the EKON Spring 2008 edition, so stay tuned, much stuff coming up soon...   

Sunday, November 25, 2007 9:10:08 PM (W. Europe Standard Time, UTC+01:00) #    Comments [0]  | 

 

Google AdSense


More on SmartInspect#

I did not get around to write more on comparing SmartInspect and CodeSight, though there are a few more things I want to name here - so stay tuned on that. However, if you are interested in learning more about SmartInspect, join me...

I will talk about SmartInspect at the upcoming EKON 12 Spring, next February in Frankfurt/Germany. In this session I will show you how to use SmartInspect in your applications, how to pass objects, how to inspect and watchs values over time, and most importantly give you a strategy on how to implement it into an already existing application - like an afterthought. But be warned, planing to use such a tool upfront is more sensible ;-)

Track description (in German)

Sunday, November 25, 2007 8:55:31 PM (W. Europe Standard Time, UTC+01:00) #    Comments [0]  | 

 

Sony Handycam and its Software#

Well, I bought a small Sony Handycam (HDR-SR5E), with a 40 GB hard drive and Full HD resolution. It is a nice video camera, though I am wondering a few things... First, isn't Full HD supposed to be 1920x1080 pixels, so why do all software applications coming with it give me a maximum resolution of 1440x1080 pixels? Would someone enlighten me, please? Next, speaking of the software - why does Sony advertise it is Vista compatible, yet nowhere they tell you, that they only support the 32 bit version of Vista (and Windows XP). You cannot even install it on Vista 64 bit. Well, you can install it, if you wish to trash your Vista installation, since you better have a backup to boot Vista 64 bit again. Honestly, the software can be installed on a Vista x64 machine, it just will not boot again, and yes, I had a clean Vista installation, only 7zip and Adobe Acrobat Reader installed so far...

So, the software they give you lacks most important features, does not run as advertised nad has a lousy MPEG-conversion. So who can name a few good low- to medium-priced software packages to edit AVCHD videos and create full featured DVDs, later Blu-Ray/HD DVD, which currently is not quiet as important, though.

Thanks in advance!

Friday, November 23, 2007 5:28:13 PM (W. Europe Standard Time, UTC+01:00) #    Comments [2]  | 

 

Creating your own interactive Welcome Page#

Often, I am asked how to implement something similar to the CodeGear RAD Studio (aka BDS) Welcome Page. Well, to be honest, I didn't know myself. All I have done for Borland/CodeGear so far, was implementing the whole HTML and JavaScript side, as well as XML and XSL. But this is all open source, and can be found in the $(BDS)\Welcomepage folder. No big secrets here.

Sample application acting on button click in HTML
Sample application acting on button click in HTML

But what you really want to know is, how to give HTML/JavaScript access to your application or how to implement your own URL, such as bds:/default.htm. Well, I took the time and investigated just that, today. And let me tell you, it is easy, once you know where to look. You need to know two interfaces:

  • ICustomDoc - allows you to assign your own document handler for the web browser instance
  • IDocHostUIHandler - allows you to return an interfaced object, that will be accessible from JavaScript and to manipulate the URL requested (as well as many other functions)

First, let me give you the interface declarations, you need:

type
  PDOCHOSTUIINFO = ^TDOCHOSTUIINFO;
  TDOCHOSTUIINFO = record
    cbSize: ULONG;
    dwFlags: DWORD;
    dwDoubleClick: DWORD;
    chHostCss: POleStr;
    chHostNS: POleStr;
  end;

  IDocHostUIHandler = interface(IUnknown)
    ['{bd3f23c0-d43e-11cf-893b-00aa00bdce1a}']
    function ShowContextMenu(const dwID: DWORD; const ppt: PPOINT; const CommandTarget: IUnknown; const Context: IDispatch): HRESULT; stdcall;
    function GetHostInfo(var pInfo: TDOCHOSTUIINFO): HRESULT; stdcall;
    function ShowUI(const dwID: DWORD; const pActiveObject: IOleInPlaceActiveObject; const pCommandTarget: IOleCommandTarget; const pFrame: IOleInPlaceFrame; const pDoc: IOleInPlaceUIWindow): HRESULT; stdcall;
    function HideUI: HRESULT; stdcall;
    function UpdateUI: HRESULT; stdcall;
    function EnableModeless(const fEnable: BOOL): HRESULT; stdcall;
    function OnDocWindowActivate(const fActivate: BOOL): HRESULT; stdcall;
    function OnFrameWindowActivate(const fActivate: BOOL): HRESULT; stdcall;
    function ResizeBorder(const prcBorder: PRECT; const pUIWindow: IOleInPlaceUIWindow; const fRameWindow: BOOL): HRESULT; stdcall;
    function TranslateAccelerator(const lpMsg: PMSG; const pguidCmdGroup: PGUID; const nCmdID: DWORD): HRESULT; stdcall;
    function GetOptionKeyPath(out pchKey: POleStr; const dw: DWORD): HRESULT; stdcall;
    function GetDropTarget(const pDropTarget: IDropTarget; out ppDropTarget: IDropTarget): HRESULT; stdcall;
    function GetExternal(out ppDispatch: IDispatch): HRESULT; stdcall;
    function TranslateUrl(const dwTranslate: DWORD; const pchURLIn: POleStr; out ppchURLOut: POleStr): HRESULT; stdcall;
    function FilterDataObject(const pDO: IDataObject; out ppDORet: IDataObject): HRESULT; stdcall;
  end;

  ICustomDoc = interface(IUnknown)
    ['{3050f3f0-98b5-11cf-bb82-00aa00bdce0b}']
    function SetUIHandler(const pUIHandler: IDocHostUIHandler): HRESULT; stdcall;
  end;

Once you figured those out, the rest is straight forward. Create a new VCL application and place a TWebBrowser component on your form. Before you can assign your own object (in the sample, it is the form itself) you have to load some document. I recommend loading about:blank, that is fast and works always.

procedure TForm8.FormCreate(Sender: TObject);
begin
  // initialize web browser
  wbbDisplay.Navigate('about:blank');
  while wbbDisplay.Busy do
    Application.ProcessMessages;

  // we have to handle some Interface requests, register this form as IDocHostUIHandler
  (wbbDisplay.Document as ICustomDoc).SetUIHandler(Self);
end;

Implement the IDocHostUIHandler interface in your form. Next you need to implement two methods:

  • GetExternal - allows you to return an interfaced object (IDispatch), which you can access from JavaScript
  • TranslateUrl - allows you to manipulate the URL before the web browser will attempt to load the file
  • Return for all other methods either E_NOTIMPL or S_FALSE according to MSDN documentation.
function TForm8.GetExternal(out ppDispatch: IDispatch): HRESULT;
begin
  ppDispatch := TMyApp.Create as IDispatch;
  Result := S_OK;
end;

function TForm8.TranslateUrl(const dwTranslate: DWORD; const pchURLIn: POLESTR; out ppchURLOut: POLESTR): HRESULT;
var
  NewURL: WideString;
begin
  if WideSameText(Copy(pchURLIn, 1, 6), 'app://') then
  begin
    NewURL := ExtractFilePath(Application.ExeName) + Copy(pchURLIn, 7, MaxInt);
    if NewUrl[Length(NewURL)] = '/' then
      SetLength(NewUrl, Length(NewUrl) - 1);
    ppchURLOut := POLESTR(NewURL);
    Result := S_OK;
  end
  else
  begin
    Result := S_FALSE;
  end;
end;

Now, you need to add a type library to your project. Once done, add an automation object (not COM-Object) to your application. This object you will return from the method GetExternal (see above, TMyApp there). Implement your methods as needed and you are done. In the code above, the application will change all URLs starting with app:// to load the files directly from the application folder. For some reason, web browser seems to add an additional slash (/) to the file requested, which has to be removed (see code TranslateUrl).

From JavaScript, you call your applications interfaced object by using the external. statement. If you name your method TestMe, you call it with external.TestMe(); from JavaScript.

That's it already. The sample projected can be downloaded (ZIP, 280 Kb).

Monday, November 12, 2007 6:20:28 PM (W. Europe Standard Time, UTC+01:00) #    Comments [0]  | 

 

CSS: Have A Real Page Footer#

Often we are challenged in life, especially when it comes to web page design. And when you want to have something "normal" as a page footer, which will always display at the bottom of the page, but never before the end of the content, you are running into THE short coming of the CSS definitions.

It is simply not designed to fit this need. However, one smart guy found a working solution, at least as long as you have a defined height for it.

Well, here you go, use it in your ASP.NET projects :)

Monday, November 12, 2007 11:19:23 AM (W. Europe Standard Time, UTC+01:00) #    Comments [0]  | 

 

Security fixes for OpenSSL with Indy Libraries#

Arvid Winkelsdorf of the digivendo GmbH has published on the Delphi-PRAXiS a security patch for using OpenSSL with the Indy libraries. The original source code has some quiet dangerous buffer overflow security risks. He allowed me to post them here, so that you can get them without having to register at the Delphi-PRAXiS.

Short Installation Instructions

Copy header files into your programm folder to ensure use of the Delphi compiler. Rebuild your project. Copy the files libeay32.dll and libssl32.dll (old name ssleay32.dll) into your application folder.

Since Indy 9 and Indy 10 are differently structured, you have to rename either IdSSLOpenHeaders9.pas or IdSSLOpenHeaders10.pas in IdSSLOpenHeaders.pas to make the fix work. Both files are in the download package.

Arvid will probably start his own blog soon and will support the Indy team in this specific area. Let's see what he will do to support us Indy-lovers. Thanks Arvid.

Download Patch (ZIP, 800 Kb)

Friday, November 09, 2007 11:49:45 AM (W. Europe Standard Time, UTC+01:00) #    Comments [0]  | 

 

Windows Vista - Quick Run as Admin#

Most of you now about the User Account Control system of Windows Vista by now. And most of you know, that you can start any application as admin when right clicking it in the list of the start menu.

However, there is a faster way, if you know te name of the executable, such as cmd. Simply, enter the name of the executable file into the Windows Vista search bar (of the start menu) and press [CTRL]+[SHIFT]+[RETURN], and it will be started with administrative rights. I use it for cmd all the time.

Wednesday, November 07, 2007 3:10:31 PM (W. Europe Standard Time, UTC+01:00) #    Comments [0]  | 

 

Karate Dôjô München 1 e.V.#

Gestern gab es endlich mal wieder unsere Mitgliederversammlung, welche alle zwei Jahre stattfindet. Auf der letzten war ich nicht dabei, da ich damals noch nicht Mitglied im Verein war und somit war diese meine erste im Verein. In gemütlicher Runde haben wir verschiedene Themen angesprochen und einen neuen Vorstand gewählt.

Der alte Vorstand wurde mit Applaus entlassen und zwei unserer langjährigen Mitglieder sind (NACH Umzug, Hochzeit und Kind) ausgetreten, da es zeitlich nicht mehr möglich ist regelmäßig zu uns zu kommen. Auf diesem Wege möchte auch ich Jürgen und Silke und deren Nachwuchs viel Erfolg für das weitere Leben wünschen. Ich hoffe, dass wir uns noch ein paar Male sehen werden, Möglichkeiten sollte es ja genug geben.

Auch will ich dem Verein für das mir ausgesprochene Vertrauen danken. Ich werde schauen, dass ich meine Vorstandsarbeiten sorgfältig ausführe. Als ersten Schritt haben wir erst einmal die Umzug der Domaine des Vereins Karate Dojo München 1 e.V. auf meinen Server veranlasst. In den nächsten Wochen werden wir dann Schritt für Schritt die Webseite überarbeiten und zukünftig hoffentlich auch regelmäßig aktualisieren.

German | Karate | Leben
Wednesday, November 07, 2007 12:47:44 PM (W. Europe Standard Time, UTC+01:00) #    Comments [1]  | 

 

CodeRage II - will you go?#

Well, Hadi has written about it already, he was as fast as they come. And not much more can be said, than Hadi has written already. However, I just want to throw my voice in there as well. I was quiet surprised when I read about the registration fee of 150 USD for participating in the conference, if you are not using one the current products. Well, I missed CodeRage last year, because I had other things on my hands to do, but same as Hadi, I wont attend this year either.

Why? Well, for starters, I prefer real life conferences as well. I always dreamed about attending some BorCon (was not in my budget back then) or a real life CodeRage now. As far as I heard, they probably will never happen again and I have to console myself with the EuroDevCon, which is fine. However, a virtual conference just does not have this same flair and for me it is all about meeting the people in person, get to know them, talk a little about whatever one likes, go out for a nice dinner, have fun with all those guys in the lobby and maybe attending a few sessions. But sitting in front of my laptop or computer just does not cut it.

So Hadi, what are you doing end of November? Like to meet? *g*

Tuesday, November 06, 2007 2:26:18 PM (W. Europe Standard Time, UTC+01:00) #    Comments [7]  | 

 

Windows Mobile Device Center on Windows Vista hiding folders...#

I just noticed for the first time, that the Windows Mobile Device Center on Windows Vista hides some folders from your device when connected to your machine.

If you plan, for example, to upload some new ringing tones to your mobile device, you will have to place them in the \Windows\Rings folder of your device. This is, on default, a two step procedure. First, place them in some folder on your device. Next, use the File Explorer of your device and copy the files from the temporary location into the rings folder on your device.

If you want to access the Windows folder, as well as others, directly from Windows Vista, you have to check your Windows Explorer settings "Show hidden System Files."

Darn, why do they make life so difficult. They don't hide the Windows folder of my Vista installation...

Monday, November 05, 2007 11:04:14 AM (W. Europe Standard Time, UTC+01:00) #    Comments [0]  | 

 

Running 16 bit applications on Windows Vista...#

I was long-time under the impression that you cannot run 16 bit applications on Windows Vista, except when using some VM software. However, while preparing a session coming up next month, I started my VM running Windows 3.11 with Delphi 1 - just for fun - and started the compiled application on my Vista machine.

What would you expect? Some error message... no, at least not on Windows Vista 32 Bit editions. The application run just as well. However, when starting the application on Windows Vista 64 Bit, you get an error message telling you to check with the software vendor for an updated 32- or 64 Bit version of the software.

Well, it doesn't bother me really any more, as I don't use 16 Bit apps or, even worse, write any. However, I thought it is funny when reading everywhere that they will not work at all. At least that is not true all the way (yet).

Friday, November 02, 2007 1:42:51 PM (W. Europe Standard Time, UTC+01:00) #    Comments [3]  | 

 

UTF-8 and Delphi - the big Unknown...#

Looking through the logs of my blog, I have noticed a high traffic regarding UTF-8 since my post on sending UTF-8 Emails using Indy. So I thought I mention a great library for converting all sorts of string formats from and to each other. I am using the Unicode library from Ralf Junker since quiet a few years and never had any trouble with it. I comes with good updates on a regular basis. With a price tag of 60 Euros with source code (20 Euros without the source code) it is a fair (should I say cheap?) price.

Another great library he offers is his Perl RegEx library. By far the most flexible solution for Delphi applications and very close to the Perl RegEx 5.10 standard. Check it out, the price tag is very similar to that of the Unicode library (75 and 25 Euros).

Friday, November 02, 2007 10:19:34 AM (W. Europe Standard Time, UTC+01:00) #    Comments [1]  | 

 

All content © 2010, Daniel Wischnewski
On this page
Archives
Promoted Links
Blogroll OPML
My current Flickr Images
www.flickr.com
Dies ist ein Flickr Modul mit �ffentlichen Fotos und Videos von dwischnewski. Ihr eigenes Modul k�nnen Sie hier erstellen.
Recommendations
Sitemap
Special Pages
Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Theme design by Jelle Druyts