DelphiFAQ Home Search:
General :: Programming :: Delphi :: .NET
Starting in .NET or already familiar but having a question? You might find it answered here!

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

hInstance is no longer defined in Delphi 8 .NET

Question:

It seems that the global variable hInstance is no longer defined in .NET. How do I obtain the instance handle now?

Answer:

HInstance provides a unique instance handle for the application or library. It indicates the handle for a module.
You need to add unit WINUTILS to your uses clause to make the following code work:

h := SysInit.hInstance; // Delphi 2-7
 
 
uses WinUtils; .. h := Borland.Vcl.WinUtils.hInstance(); // Delphi 8

Generated 0:01:24 on Oct 21, 2017