Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ERROR: AV's and IWButton.picture.data: the parameter is incorrect
#1
Hi Guys,

After much developing, today it was finally time to have multi users testing the multiform application. A number of errors came up, mostly "Access Violation" but also many of them relating to IWButton1.picture.data:

Error reading IWButton1.Picture.Data: System Error.  Code: 87. The parameter is incorrect .
In the errorllog the last executed line is: System.Classes.HandleException (Line 11150, "System.Classes.pas" + 5) + $47

Access Violation errors shown was (last executed line from the errorlog):

AV: System.Classes.TList.Get (Line 4927, "System.Classes.pas" + 3) + $3
AV: Vcl.Graphics.DeselectBitmap$qqrp9HBITMAP__ (Line 7155, "Vcl.Graphics.pas" + 6) + $A
AV: IWContainer.TIWContainerImplementation.get_IWComponentsCount (Line 713, "IWContainer.pas" + 0) + $0
AV: System.@FillChar$qqrpvic (Line 12064, "System.pas" + 3) + $0

I have ServerController properties set as follows:
Cominitialization = ciMultiThreaded
Cookieoptions.UseCookies = true
Cookieoptions.SessionCookies = true
Sessionoptions.UniqueUrl = true
Showstartparams = true

Can anybody tell me what is wrong, and if possible explaining why it happens and what to do to try to resolve the problems, please.

Regards
Soren

Added after post: I forgot to mention that during development time, even with multiple session in tabs in the browser, I have not had ANY of the above errors. It is as if they are multiuser related in some way, but as I do not know, I am just guessing. And I have tested both on my development machine (using Cassini) and after uploading to server, running it as a SA HTTP.SYS service. Both locally and server based at the same time, and using both Edge ans IE11 at the same time.

Could it be access to the location on the server ? If it is looking for the wwwroot dir in the location of the exe-file, should the users have rights to access that directory ?
Reply
#2
IntraWeb's TIWButton doesn't have a Picture property. So I believe this is not a standard TIWButton control, is it?
Reply
#3
Hi Alexandre,

No it's a IwImage with an OnClick event and the image loaded is one of the standard delphi glyps, that is, a bmp file. With only one image though, not as the originals where there was a an active and an inactive image in the same file.

Regards
Soren
Reply
#4
My recommendations regarding it:

1) * NEVER * (and I can't stress it enough) use Bitmaps in anything that might be related with the web. Convert your images to PNG files and replace your bitmaps by these new files.

2) A TIWImageFile is a better option than TIWImage. You need to save your PNG files externally in wwwroot folder if you decide to go through that route. This is the best option for several reasons: (a) IW doesn't need to load/process/convert/save to HDD your image *every time a form is being rendered*, and (b) the browser cache will be able to properly cache the image and will render it much faster

3) If you decide to keep using TIWImage, check the property"PreProcessImage" to TRUE which reduces the memory and CPU usage to render the form

I'll see if I can recreate this, but certainly doing like (2) above will eliminate the problem completely

BTW, can you please tell me your exact version number?
Reply
#5
I have recently made a small app for an image photomontage. The photography in the form of bmp,jpg,gif,png is uploaded by a user to the app, then converted to bmp, and TIWImage is assigned the bmp. This is the only way I can draw on TIWImage as it contains bmp. The TIWImage OutputType is set to ioJPEG. version 15.1.5. All works all right. However, setting PreProcessImage to TRUE makes the photography disappeare from the image and so the app does not work.

For a static photography I use TIWImage with jpg or png loaded at design time and it works, but when I do extensive TIWimage canvas work, I need to load the photography at run time from file to TIWImage or otherwise TIWImage is empty.

I suppose there must be a bug, what Soren have noticed.

The lack of proper updated manual is also an issue.
Reply
#6
Bitmaps in Delphi are not thread safe. If you create/manipulate Bitmaps at runtime you can eventually find a problem. IW has some special code to handle it and avoid this problem but still, if your code is dealing directly with bitmaps you need to lock the canvas before manipulating it and unlock the bitmap canvas after doing it. I'm not exactly sure how you are dealing with it and Soren provided very few details. So It is impossible to tell more.

Regarding your report:

Browsers don't know bitmaps. Bitmap is mostly a Windows thing (although Linux and others can also handle it). Browsers know PNG, JPG, GIF among other graphic types. If you are using BMP you are forcing IW to convert them at run time to any other of the known extensions.

PreProcessImage should work as long as you are setting the bitmap using TIWImage.Picture property. If you are doing anything other than that it won't work for you. It is an optimization option which is supposed to work with regular use of TIWImage, not to handle every possible use case (including changing the bitmap directly)
Reply
#7
Soren, I don't know the details of your problem. Are you loading this image at runtime via code? How many users were active at that time? What's your IW version?
Reply
#8
Hi Alexandre,

I'm not manipulating the IWImage picture property at run time. I have around 20-25 small IwImages (20x20px) loaded with a Bitmap image, and equipped with an OnClick event. Serves as a "speedbutton" as in VCL Delphi. ALL images are loaded at design time, and are part of the dfm file as a large number of Hex values. Again as it is in VCL. All 20-25 images are one and the same. A small "magnifying glass" image, symbolizing a search option. So only one image used.

I will change the image to a png and reload all the IwImages, and set their preProcessImage property, to begin with and try that to see if I still get problems and if, I'll try with the other option proposed (IwImageFile with a copy of the image in the wwwroot folder).

My setup is: A SA HTTP.SYS program installed on a Server and started as a service. During development I use it locally on my development machine with the execute option set true, using Edge (the company chosen browser), testing all by my self as only one user. No problem there. When I want to publish it, I compile it with execute set false, and copy it onto the server, and start the service. I then start Edge and start the application using the url of the service. Again it is only me and I have no problems.

The problem started when we were 3-4 users at the same time. Whether trying the same or different forms, we all experiences the problems with AV and picture.data error described above.

Notice: I'm not (deliberately, or as far as I know) using threads. My application is in a way like a traditional VLC application, with a menu creating a form on entry and releasing it at exit, maybe calling other forms, like the search form when clicking a search image, but all nicely releasing their created form, in the same order as they were created. Only in the Search option, am I "jumping" through 2-3 forms, carefully releasing each one right after it has created the next. When the final form is released, the release takes the user back to the original screen. As I said, like a traditional VLC application.

My application is management application, only running on company intranet. It is used by administrative HQ staff to prepare and handle data in SQL tables, where the primary registration of activity is done by a Win32 program running on a number of remote devices placed around in the world. These are communicating with the SQL server through a Webservice, which is another IW HTTP.SYS application, wrapped in a Service shell, as SOAP webservice. It does not have any GUI and all access to SQL tables, are done through ADO DBConnection and ADOStoredProc.

When you ask "What's your IW session", I'm not sure exactly what you mean.

Regards
Soren
Reply
#9
[quote pid='5237' dateline='1581142623']

When you ask "What's your IW session", I'm not sure exactly what you mean.

Regards
Soren
[/quote]
You are asked about your intraweb version number to find a bug.
Reply
#10
Thanks MrSpock :-)

My IW version is 15.1.12 running on Delphi 10.3.2 with upgrades...

Regards
Soren
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)