The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,708 other followers

Archive for the ‘Windows Development’ Category

Using Image Encoders and Decoders in Managed GDI+ | Microsoft Docs

Posted by jpluimers on 2019/09/17

I forgot who pointed me to this, but it will be useful the next time I need to do image export/import in .NET or GDI+ [WayBackUsing Image Encoders and Decoders in Managed GDI+ | Microsoft Docs.

GDI+ has built-in encoders and decoders that support the following file types:

  • BMP
  • GIF
  • JPEG
  • PNG
  • TIFF

GDI+ also has built-in decoders that support the following file types:

  • WMF
  • EMF
  • ICON

–jeroen

Posted in Development, Software Development, Windows Development | Leave a Comment »

When an installer errors out with “Please re-run this installer as a normal user instead of”…

Posted by jpluimers on 2019/08/12

Via [WayBack] Anyone with a hint on how to work around this: … “Please re-run this installer as a normal user instead of”… – Jeroen Wiert Pluimers – Google+

This happened for instance when trying to install Source Tree 2.x on Windows (1.9.x works fine):

[Window Title]
SourceTreeSetup-2.3.1.0.exe

[Main Instruction]
Installation has failed

[Content]
Please re-run this installer as a normal user instead of “Run as Administrator”.

[Close]

The problem was by accident the machine got in a state to run commands without UAC approval, so the run dialog would already look have “This task will be created with administrative privileges”:

It was odd, as the machine didn’t have it enabled in the security policy (secpo.msc):

So I did a bit more digging, bumped into [WayBack] Why does my Run dialog say that tasks will created with administrative privileges? – The Old New Thing and had one of those #facepalm moments: Explorer had crashed, and I had started it from Process Explorer, forgetting Process Explorer had an UAC token.

The solution is easy:

  1. Logoff / Logon
  2. Verify the Windows-R shows a “normal” run:

Then you can just run the installer:

–jeroen

Posted in Batch-Files, Console (command prompt window), Development, Power User, Scripting, Software Development, The Old New Thing, Windows, Windows Development | Leave a Comment »

Using PE Flags in Delphi – twm’s blog

Posted by jpluimers on 2019/08/08

For my link archive: [WayBackUsing PE Flags in Delphi – twm’s blog with information about and links to:

The flags themselves are documented at [WayBack] IMAGE_FILE_HEADER structure (Windows)

–jeroen

Via: [WayBack] There was a discussion about using the PE flag IMAGE_FILE_LARGE_ADDRESS_AWARE… – Thomas Mueller (dummzeuch) – Google+

Posted in Delphi, Development, Software Development, Windows Development | Leave a Comment »

A COM Object Collection (IEnumVARIANT) – Delphi Tips – CJC Delphi (Cool Delphi Tips)

Posted by jpluimers on 2019/07/04

Summary of [WayBack] A COM Object Collection (IEnumVARIANT) – Delphi Tips – CJC Delphi (Cool Delphi Tips)

Question: How to implements object collection that support Visual Basic’s For Each construct ?

Answer:
In order to implements an object collection your object has to return  IEnumVariant pointer from a special property named _NewEnum.

Via: [WayBack] What interface to I need to implement to allow ForEach in VBA on a COM object written in delphi? – Stack Overflow

–jeroen

Posted in COM/DCOM/COM+, Delphi, Development, Software Development, Windows Development | Leave a Comment »

Detecting if a debugger is present is different from detecting if an IDE is present.

Posted by jpluimers on 2019/04/04

I have seen this happen in various environments: people wanting to detect if their debugger is present, but trying to detect their IDE, or vice versa.

Similar reasoning is for detecting for being running on a console, or your project having been built to run on a console.

People use these decisions, for instance to determine if their application should behave as a service, or as a regular process.

Ways to determine the various permutation points:

  • Running inside a debugger: use the [WayBackIsDebuggerPresent function (which can be true, even if Delphi DebugHook stays zero).
  • Check for the IDE: tricky; as IDEs have different behaviour over time. For Delphi, check for any TAppBuilder Window class with the [WayBack] FindWindow function.
  • Compiled for console: for Delphi check IsConsole, for .NET I could not find good information.
  • Running on a console: check if you can allocate a handle to stdout
  • Running as a service: check the hosting assembly or hosting process

Related links:

–jeroen

Posted in .NET, Delphi, Development, Software Development, Windows Development | Leave a Comment »

 
%d bloggers like this: