BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delphi 2006 apps not running on NT

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Non-Technical
View previous topic :: View next topic  
Author Message
Rod
Guest





PostPosted: Wed May 03, 2006 5:03 pm    Post subject: Delphi 2006 apps not running on NT Reply with quote



http://qc.borland.com/wc/qcmain.aspx?d=28718
can somebody confirm?
Back to top
Rick Carter
Guest





PostPosted: Wed May 03, 2006 6:03 pm    Post subject: Re: Delphi 2006 apps not running on NT Reply with quote



Quote:
http://qc.borland.com/wc/qcmain.aspx?d=28718
can somebody confirm?

A poorly and ambiguously worded report:
"Platform: 95, 98, 2000, NT, XP"

Windows 95 and 98 are not NT technology. Windows 2000 and XP are NT
technology, and are supported. Do we assume you and the original poster
mean NT 3.5 or NT 4.0?

Rick Carter
carterrk (AT) despammed (DOT) com
Chair, Delphi/Paradox SIG, Cincinnati PC Users Group

--- posted by geoForum on http://delphi.newswhat.com
Back to top
miab
Guest





PostPosted: Wed May 03, 2006 6:03 pm    Post subject: Re: Delphi 2006 apps not running on NT Reply with quote



Rod wrote:
Quote:
http://qc.borland.com/wc/qcmain.aspx?d=28718
can somebody confirm?

http://www.freevbcode.com/ShowCode.asp?ID=630

miab
Back to top
Dave Nottage [TeamB]
Guest





PostPosted: Wed May 03, 2006 11:14 pm    Post subject: Re: Delphi 2006 apps not running on NT Reply with quote

Rod wrote:

Quote:
http://qc.borland.com/wc/qcmain.aspx?d=28718
can somebody confirm?

Confirm that the report has almost no information?

--
Dave Nottage [TeamB]
Have questions?: http://www.catb.org/~esr/faqs/smart-questions.html
Want answers?: http://support.borland.com
Back to top
Colin Wilson
Guest





PostPosted: Thu May 04, 2006 12:14 am    Post subject: Re: Delphi 2006 apps not running on NT Reply with quote

Rod wrote:

Quote:
http://qc.borland.com/wc/qcmain.aspx?d=28718
can somebody confirm?

Yes - I ran into this one today.

Delphi 2006 apps don't work on NT4 if they contain a toolbar, because of
the new gradient stuff.

Workarounds:

1. Remove the toolbar.
2. Use Delphi 2005 instead.

--
Colin - Author of XanaNews
Back to top
Roddy Pratt
Guest





PostPosted: Thu May 04, 2006 12:14 am    Post subject: Re: Delphi 2006 apps not running on NT Reply with quote

"Colin Wilson" <colin (AT) wilsonc (DOT) demon.co.uk> wrote in message
news:44593a8c$1 (AT) newsgroups (DOT) borland.com...

Quote:
Delphi 2006 apps don't work on NT4 if they contain a toolbar, because of
the new gradient stuff.

Workarounds:

1. Remove the toolbar.
2. Use Delphi 2005 instead.


Thanks Colin - any chance you could add that as a comment on the original
report?

- Roddy
Back to top
Roddy Pratt
Guest





PostPosted: Thu May 04, 2006 12:14 am    Post subject: Re: Delphi 2006 apps not running on NT Reply with quote

"Rick Carter" <carterrk (AT) despammed (DOT) com> wrote in message
news:4458e220$1 (AT) newsgroups (DOT) borland.com...

Quote:
A poorly and ambiguously worded report:

1: Give the guy a break. English may not be his first language.

Quote:
"Platform: 95, 98, 2000, NT, XP"

Windows 95 and 98 are not NT technology. Windows 2000 and XP are NT
technology, and are supported. Do we assume you and the original poster
mean NT 3.5 or NT 4.0?

That's the only option you get, apart from Platform: ALL, AFAIK. The
available QC 'platform' options are not helpful for Delphi.

The report DOES give enough information (just) for anyone remotely
interested to follow it up. I can't verify it as I don't have NT4, but I
believe the behaviour is as designed: D2006 does not support building VCL
applications for Windows NT and 95,

I consider closing a report as "Need More Info" without either commenting on
it or even rating it to be frankly unhelpful. What information is the poor
guy supposed to provide?

And, at least he bothers to submit reports.

- Roddy
Back to top
Colin
Guest





PostPosted: Fri May 12, 2006 1:14 pm    Post subject: Re: Delphi 2006 apps not running on NT Reply with quote

OK - I've commented on the report. My comment includes source code for
a workaround.

1. The problem is that toolbars use the GradientFill function in the
msimg32 dll. This function (or dll) is not provided by NT4.

2. The solution then is to write your own msimg32 containing just the
GradientFill function. You can then deploy this dll to your
application's directory on your NT4 machine, and voila!

3. So I've written my own version of the DLL (see below), and tested
it successfully on NT4 machines.

4. It's important that this DLL doesn't get confused or muddled with
the genuine Microsoft version. For this readon it should *only* be
deplyed to your application's directory, and only to NT4 computers.

Colin

Here's that DLL. I'm posting this with Google, so I hope it comes out
OK...

library MSImg32;

uses
Windows;

{$R *.res}

(*============================================================================*
| function GradientFill
|
|
|
| The contents of this file are subject to the Mozilla Public License
|
| Version 1.1 (the "License"); you may not use this file except in
|
| compliance with the License. You may obtain a copy of the License at
|
| http://www.mozilla.org/MPL/
|
|
|
| Software distributed under the License is distributed on an "AS IS"
basis, |
| WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License |
| for the specific language governing rights and limitations under the
|
| License.
|
|
|
| Copyright © Colin Wilson 2006 All Rights Reserved
|
|
|
| Implement a subset of the Windows GradientFill function, sufficient
to |
| support Delphi 2006 applications.
|
|
|
| 1. It only support rectangles, not triangles.
|
| 2. It only supports a single rectangle
|
|
|
| Hence, NumVertex must be 2, defining the two opposite corners of the
|
| Rectangle.
|
|
|
| NumMesh must be 1, with the mesh containing either TGradientRect (0,
1), |
| or TGradientRect (1, 0)
|
|
|
| Mode must be either GRADIENT_FILL_RECT_H or GRADIENT_FILL_RECT_V
|

*============================================================================*)

function GradientFill(DC: HDC; Vertex: PTriVertex; NumVertex: ULONG;
Mesh: Pointer; NumMesh, Mode: ULONG): BOOL; stdcall;
var
x1, y1, x2, y2, i : Integer;
v1, v2 : PTriVertex;
r1, g1, b1 : COLOR16;
r2, g2, b2 : COLOR16;
oldPen : HPEN;
oldColor : TColorRef;
gr : PGradientRect;

function FadeShade (c1, c2 : COLOR16; n, minN, maxN : Integer) :
Byte;
var
i1, i2 : Integer;
begin
Dec (n, minN);
Dec (maxN, minN);
i1 := c1;
i2 := c2;

Dec (i2, i1);
result := (i1 + (i2 * n) div maxN) shr 8;
end;

procedure UseColor (color : TColorRef);
begin
if color <> oldColor then
begin
if oldPen = $ffffffff then
oldPen := SelectObject (dc, CreatePen (PS_SOLID, 1, color))
else
DeleteObject (SelectObject (dc, CreatePen (PS_SOLID, 1,
color)));

oldColor := color
end
end;

procedure Swap (var a, b : Integer);
var
t : Integer;
begin
t := a;
a := b;
b := t;
end;

begin
result := True;
if (NumVertex <> 2) or (NumMesh <> 1) or ((mode <>
GRADIENT_FILL_RECT_H) and (mode <> GRADIENT_FILL_RECT_V)) then
Exit;

gr := PGradientRect (Mesh);

v1 := Vertex;
Inc (v1, gr^.UpperLeft);

v2 := Vertex;
Inc (v2, gr^.LowerRight);

x1 := v1^.x;
y1 := v1^.y;
x2 := v2^.x;
y2 := v2^.y;

r1 := v1^.Red;
g1 := v1^.Green;
b1 := v1^.Blue;

r2 := v2^.Red;
g2 := v2^.Green;
b2 := v2^.Blue;

if y2 < y1 then
begin
i := y2;
y2 := y1;
y1 := i
end;

if x2 < x1 then
begin
i := x2;
x2 := x1;
x1 := i
end;

oldColor := $ffffffff;
oldPen := $ffffffff;
try
if mode = GRADIENT_FILL_RECT_V then
for i := y1 to y2 do
begin
UseColor (RGB (FadeShade (r1, r2, i, y1, y2), FadeShade (g1,
g2, i, y1, y2), FadeShade (b1, b2, i, y1, y2)));

MoveToEx (dc, x1, i, Nil);
LineTo (dc, x2, i);
end
else
for i := x1 to x2 do
begin
UseColor (RGB (FadeShade (r1, r2, i, x1, x2), FadeShade (g1,
g2, i, x1, x2), FadeShade (b1, b2, i, x1, x2)));

MoveToEx (dc, i, y1, Nil);
LineTo (dc, i, y2);
end
finally
if oldPen <> $ffffffff then
DeleteObject (SelectObject (dc, oldPen))
end
end;

exports GradientFill;

begin
end.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Non-Technical All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.