Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Delphi XE2, CreateBrushIndirect incompatible type

Posted on 2011-09-19
1
Medium Priority
?
1,166 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 2000 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

885 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