Runtime Error 217 - TRVCamera

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
Post Reply
darvin
Posts: 24
Joined: Mon Jan 02, 2023 8:41 pm

Runtime Error 217 - TRVCamera

Post by darvin »

Hi,

I am using Delphi Alexandria 11.2 and RVMedia 9.3. I started a new Windows 32bit FMX project with some GUI elements. Compiled and started. Then I dropped the TRVCamera object, compiled again and the program stopped with "Runtime Error 217". It seems that the units fmxMRVMediaSource and fmxMRVCamera are responsible for this.

Starting in Debug/ Mode does not help - the error message comes right at the beginning before Application.Initialize.

Strange sidenote: the Demo projects work as expected with no error message.

Any suggestions?
darvin
Posts: 24
Joined: Mon Jan 02, 2023 8:41 pm

Re: Runtime Error 217 - TRVCamera

Post by darvin »

More strange behaviour

Added the fmxRVCamera unit to a new FMX project (Windows 32bits) and ran into the same error @start: Runtime Error 217

Does anyone have a clue on this?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Runtime Error 217 - TRVCamera

Post by Sergey Tkachenko »

If demo projects work, there must be some difference it them. Maybe your project is compiled with runtime packages? Try to turn off (menu Project | Options, page Packages | Runtime packages, turn off "Link with runtime packages".

I think some exception happens before the Delphi exception system is initialized (in SysUtils unit), somewhere in initialization section of some RVMedia unit.
Probably third-party exception loggers, such as madExcept (https://www.madshi.net/) may provide information allowing to find the reason for this problem.
darvin
Posts: 24
Joined: Mon Jan 02, 2023 8:41 pm

Re: Runtime Error 217 - TRVCamera

Post by darvin »

Thank you for these hints. I compared the project options between the working demo and a new project with a TRVCamera dropped on the canvas. There was no difference, neither were the runtime packages linked as you mentioned.

An interesting detail:
compiling the project under Windows 64bits works with no Runtime Error - but when I compile and start as a Windows 32bits program I get this error.

You have an idea?


UPDATE:
I searched for the initialization section and found some libraries to be loaded, mainly:
  • wininet.dll
  • ddraw.dll
  • uxtheme.dll
  • jpeg62_32.dll
  • IJL15.DLL
While the first three are located in C:\Windows\System32 and C:\Windows\SysWOW64, the latter two are totally missing.
darvin
Posts: 24
Joined: Mon Jan 02, 2023 8:41 pm

Re: Runtime Error 217 - TRVCamera

Post by darvin »

Update:

I analyzed the project by using your madExcept unit. It showed that the failure is in unit fmxMRVCamView: ERangeError
I have set a breakpoint in the initialization section, it seems that the original problem is in this command:

Code: Select all

Screen_Cursors[crSRV_MOVE_LEFT] := LoadCursor(HInstance, 'CURLEFT');
it seems that this unit is not able to load the resource file fmxMRVCamViewFM.res in Windows 32bits FMX env.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Runtime Error 217 - TRVCamera

Post by Sergey Tkachenko »

It's my fault, I forgot to remove this experimental code from the release :(
Please change all calls of for FireMonkey, from {$IFDEF FIREMONKEY} to {$ELSE} to

Code: Select all

  Screen_Cursors[crSRV_MOVE_LEFT] := crArrow;
  Screen_Cursors[crSRV_MOVE_RIGHT] := crArrow;
  Screen_Cursors[crSRV_MOVE_UP] := crArrow;
  Screen_Cursors[crSRV_MOVE_DOWN] := crArrow;
  Screen_Cursors[crSRV_MOVE_LEFTDOWN] := crArrow;
  Screen_Cursors[crSRV_MOVE_LEFTUP] := crArrow;
  Screen_Cursors[crSRV_MOVE_RIGHTDOWN] := crArrow;
  Screen_Cursors[crSRV_MOVE_RIGHTUP] := crArrow;
  Screen_Cursors[crSRV_MOVE_CENTER] := crArrow;
  Screen_Cursors[crSRV_MOVE_STOP] := crArrow;
FireMonkey does not support custom cursors.
darvin
Posts: 24
Joined: Mon Jan 02, 2023 8:41 pm

Re: Runtime Error 217 - TRVCamera

Post by darvin »

Changed the code according to your suggestion - and it worked!
Thank you for your quick reply!
Post Reply