Error 6 transferring internal bitmap

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
johannasteema
Newbie
Newbie
Posts: 4
Joined: Fri Dec 16, 2016 12:00 am

Error 6 transferring internal bitmap

Post by johannasteema » Tue Jan 03, 2017 6:08 pm

I receive the following error message when the canvas for my tchart/word series is refreshed:
"Error 6 transferring internal Bitmap using BitBlt"
With an additional reference to the source code in VCLTee.TeCanvas for line 9262

This happens for the following type of project
Source code in Delphi 10.1 Berlin Update 2 and TeeChart Pro 2016.19 Source code

The project has one TWorldSeries in a TChart. The form is maximized (window state is set to wsMaximized) and the canvas is GDI+.
The issue happens if the application is run via remote desktop and I reconnect to a remote desktop session which has the application running
(Windows 7).
It only happens when I use the source code. If I link my project to the binary files it seems to work.
I have two questions;
- Are assertions turned off in the binary files or is there a different reason why the error message is not displayed when I use the binary files?
- There are old bug reports of similar issues, is there any way around it?

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Error 6 transferring internal bitmap

Post by Yeray » Wed Jan 04, 2017 1:12 pm

Hello,

I haven't been able to reproduce it using TeeChart Pro VCL/FMX v2016.19 Source Code and RAD 10.1 Berlin Update 2 in Windows 10. Here what I've done:
- I've cleaned the *tee* paths and only left this one in the "Library path" list:
"C:\Program Files (x86)\Steema Software\Steema TeeChart Pro VCL FMX Source Code 2016.19\Steema TeeChart Pro VCL FMX Source Code 2016.19\Source\VCL"
- Only tested Win32 target platform both compiling in debug and release modes.

Here the code I'm using to test it:

Code: Select all

uses Chart, TeeWorldSeries;

var Chart1: TChart;

procedure TForm1.FormCreate(Sender: TObject);
begin
  WindowState:=wsMaximized;

  Chart1:=TChart.Create(Self);
  Chart1.Parent:=Self;
  Chart1.Align:=alClient;
  Chart1.View3D:=False;
  Chart1.Legend.Visible:=False;

  Chart1.AddSeries(TWorldSeries).FillSampleValues;
end;
Do you see anything missing?
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

johannasteema
Newbie
Newbie
Posts: 4
Joined: Fri Dec 16, 2016 12:00 am

Re: Error 6 transferring internal bitmap

Post by johannasteema » Wed Jan 04, 2017 1:44 pm

Hello,

Thank you for the reply and for investigating the issue.
I tested your code and I can now see that the problem only happens for the Win64 target platform. If I run your code for Win32 it works without error message, but for Win64 I get the error message as soon as I reconnect to my remote desktop session.

Best Regards,
Johanna

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Error 6 transferring internal bitmap

Post by Yeray » Thu Jan 05, 2017 8:20 am

Hello Johanna,

I can't reproduce the problem with Win64 either.
testWorld.zip
(1.15 KiB) Downloaded 532 times
I'm moving the .exe to the remote machine, accessing it with remote desktop, running the .exe, [optionally, closing the remote desktop], reaccessing it with remote desktop. And I can see the application running without problems.
mstsc_2017-01-05_09-18-50.png
mstsc_2017-01-05_09-18-50.png (285.47 KiB) Viewed 10061 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

johannasteema
Newbie
Newbie
Posts: 4
Joined: Fri Dec 16, 2016 12:00 am

Re: Error 6 transferring internal bitmap

Post by johannasteema » Thu Jan 05, 2017 9:13 am

Error 6 from Windows 7 machine.png
Error 6 from Windows 7 machine.png (133.62 KiB) Viewed 10063 times
Hello,

I downloaded your attached code, added the Win64 platform, the search path to the source code and an output directory.
I can reproduce the error, but only on Windows 7 machines. It seems to work if I run the same exe on a Windows 10 machine.

Best Regards
Johanna

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Error 6 transferring internal bitmap

Post by Yeray » Thu Jan 05, 2017 1:18 pm

Hello Johanna,

I reproduced the error now, with a Windows 7 x64 virtual machine.
You don't even need to use remote desktop to reproduce the problem. Just logout through "Switch user" option and login back.
I'm also reproducing the problem without having the window maximized and targeting Win32 platform.

Still investigating...
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

johannasteema
Newbie
Newbie
Posts: 4
Joined: Fri Dec 16, 2016 12:00 am

Re: Error 6 transferring internal bitmap

Post by johannasteema » Thu Jan 05, 2017 1:30 pm

Hi Yeray, thanks for the update.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Error 6 transferring internal bitmap

Post by Yeray » Thu Jan 05, 2017 3:12 pm

Hello Johanna,
Yeray wrote:I'm also reproducing the problem without having the window maximized
I think I reproduced it without having the window maximized but I can't now.

The error code 6 seems to indicate the Handler was invalid in the last call:
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx

And the last call was:

Code: Select all

    BitBlt( ACanvas.Handle,ALeft,ATop,
            FBitmap.Width,
            FBitmap.Height,
            FBitmap.Canvas.Handle,0,0,SRCCOPY);
So I guess the action of switching the windows session may be reassigning the handlers and this causes this assertion failure.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply