Solved

Delphi XE2, CreateBrushIndirect incompatible type

Posted on 2011-09-19
1
1,145 Views
Last Modified: 2016-10-03
Hi

I installed Delphi XE2 and try to compile an old project. Now I have the following problem:

In the old project there is code like

procedure JustAsample;
var
  Data: PEMRCreateBrushIndirect;
  xx : int64;
begin
  xx := CreateBrushIndirect(Data^.lb);
end;

the compiler now says: "incompatible type tagLogBrush and tagLogBrush32." Same error it doesn't matter if I compile 3bit or 64bit.

The CreateBrushIndirect-procedure is definied in winapi.windows-unit and I really can see that there are different types. Is that a bug from that unit and how can I solve it?

Thanks for your help, Peter
0
Comment
Question by:formi
1 Comment
 
LVL 4

Accepted Solution

by:
rotem156 earned 500 total points
ID: 36563779
It takes a TLogBrush structure as an argument and returns a handle to a brush (HBRUSH).

procedure JustAsample;
var
  Data: TLogBrush;
  xx :  HBRUSH;
begin
  xx := CreateBrushIndirect(Data);
end;

Open in new window

0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question