I've been testing some D2006 code using Rave reports on a virtual machine and have found the app hangs when I generate a PDF report if there is no printer installed. The hang occurs here:
exception message : The application seems to be frozen.
main thread ($108):
005c5e62 +106 MyApp.exe RpRPTF SimpleTextWidth
006198f7 +31b MyApp.exe RpMemo TMemoBuf.GetLine
0061a44a +086 MyApp.exe RpMemo TMemoBuf.MemoLinesLeft
005cba28 +014 MyApp.exe RpBase TBaseReport.MemoLines
00672e8e +072 MyApp.exe MyAppReports PrintReportParagraph
00677f73 +acb MyApp.exe MyAppReports PrintSummaryReportBody
0066b208 +010 MyApp.exe MyAppMainForm TMainForm.RvSystemSummaryReportPrint
005c6f35 +015 MyApp.exe RpBase TBaseReport.PrintEvent
005c8066 +03a MyApp.exe RpBase TBaseReport.Execute
0060a299 +125 MyApp.exe RpSystem TRvSystem.GenerateReport
0060a52a +07e MyApp.exe RpSystem TRvSystem.Execute
0067d364 +0ac MyApp.exe MyAppReports DoPrintSummaryReport
0067d64d +1d5 MyApp.exe MyAppReports ProduceReports
0066e966 +1e6 MyApp.exe MyAppProcessing ProcessMyAppData
0066ab9b +0d7 MyApp.exe MyAppMainForm TMainForm.DoProcessData
and no doubt is something to do with a page width of zero confusing the code that is calculating how many lines it can fit across the page or some such.
The thing is I'm writing a PDF - not printing - so I can't see why not having a printer should trip this code up (Acrobat Reader is installed). If I install a printer it behaves. Why do I need a printer installed (the app could be installed on a workstation without a printer installed - having an error message that says: "You can't generate a PDF report unless you install printer" seems a bit clunky) ?
This is a long-standing bug in Rave Reports. It has to do with no default printer being installed. I'll look for links to old Borland/CodeGear forum posts (CodeNewsFast doesn't seem to be responding right now). There was a problem with it making an assumption about a printer being present. I don't know if it's been fixed in the most recent versions of Rave. (D2006 was quite a while back.)
If I remember correctly, the solution was to install the text driver to a "mock" printer. This allows Rave to continue to function.
Related
Every time I try to do anything with Code Analysis, Visual Studio crashes. The event viewer shows the crash is caused by an invalid window-splitter size.
Stacktrace:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentOutOfRangeException
at System.Windows.Forms.SplitContainer.set_SplitterDistance(Int32)
at Microsoft.VisualStudio.CodeAnalysis.AdvancedRuleSetEdit.LoadHelpPaneSizeString(System.String)
at Microsoft.VisualStudio.CodeAnalysis.AdvancedRuleSetEdit.LoadHelpPaneSettings()
at Microsoft.VisualStudio.CodeAnalysis.AdvancedRuleSetEdit.SplitterResized(System.Object, System.EventArgs)
at System.Windows.Forms.Control.OnResize(System.EventArgs)
at System.Windows.Forms.Control.OnSizeChanged(System.EventArgs)
at System.Windows.Forms.Control.UpdateBounds(Int32, Int32, Int32, Int32, Int32, Int32)
at System.Windows.Forms.Control.UpdateBounds()
at System.Windows.Forms.Control.WmWindowPosChanged(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ContainerControl.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.SplitContainer.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)
Procmon shows this value is stored in the private registry bin file.
Deleting the window settings for Code Analysis fixes the cause of the crash. You may need to do this every time you close Visual Studio.
Export from the private registry bin:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\vs2019\Software\Microsoft\VisualStudio\16.0_ad070b97\CodeAnalysis]
"RuleSetMRUList"=""
"RuleSelectionControl_Settings"="True,True,True,7,2,0,True,0;True;0.385#1;False;0.160#2;True;0.429#3;False;0.160#4;False;0.100#5;True;0.186#6;False;0.150#7;False;0.150#"
"RuleSetEditorHelpPaneSize"="573,573"
If you are running into this, to resolve:
// put your instance id in the next line instead of ad070b97
cd C:\Users\Administrator\AppData\Local\Microsoft\VisualStudio\16.0_ad070b97
reg load HKLM\vs2019 privateregistry.bin
reg delete HKLM\vs2019\Software\Microsoft\VisualStudio\16.0_ad070b97\CodeAnalysis /v RuleSetEditorHelpPaneSize
reg unload HKLM\vs2019
Fixed in latest VS 2019 versions
This is caused by the scaling options for your display. (the part that makes text and icons larger.)
Reset your scaling to 100% and it will show the window. There are other control in vs that cause issues as well, but this one crashes it. If it's larger then 100, various parts of vs 2017 don't work. This crashes it, forms designer complains, and an error message shows up in the Solutions properties page. (not project properties)
Seems Microsoft never got around to testing or fixing this.
Test it to confirm.
Does anyone know how to use _set_invalid_parameter_handler with Delphi XE7 or later? See MSDN Article
Oops, it seems I should probably have given more context. I'm trying to load a C DLL that wraps a Matlab-based DLL. This worked before when I was using Delphi 2007, but fails now with XE7. I get these messages in the Event Log:
Module Load: RunChecker.dll. No Debug Info. Base Address: $10000000. Process myapp.exe (12304)
Module Load: libRunChecker.dll. No Debug Info. Base Address: $02A30000. Process myapp.exe (12304)
Module Load: mclmcrrt7_17.dll. No Debug Info. Base Address: $02A40000. Process myapp.exe (12304)
Module Load: PSAPI.DLL. No Debug Info. Base Address: $75420000. Process myapp.exe (12304)
Debug Output:
Invalid parameter passed to C runtime function.
Process myapp.exe (12304)
Debug Output:
Invalid parameter passed to C runtime function.
Process myapp.exe (12304)
Debug Output:
Invalid parameter passed to C runtime function.
Process myapp.exe (12304)
Debug Output:
Invalid parameter passed to C runtime function.
Process myapp.exe (12304)
Debug Output:
Invalid parameter passed to C runtime function.
Process myapp.exe (12304)
Debug Output:
Invalid parameter passed to C runtime function.
Process myapp.exe (12304)
Thread Start: Thread ID: 7192. Process myapp.exe (12304)
I'm trying to figure out what is causing these errors, and my search led to the above, but perhaps it is wrong? But I'm trying to get some insight into where the failure is introduced. Any thoughts/suggestions most appreciated!
_set_invalid_parameter_handler is part of the MSVC runtime. It's not something that you call directly from Delphi code because your Delphi code doesn't link to the MSVC runtime.
If you do wish to call _set_invalid_parameter_handler you should do so from the code that links to the MSVC runtime. In your case that would be your C DLL.
All that said, almost certainly the problem relates to the Char and PChar types. In Delphi 2007 they are aliases to AnsiChar and PAnsiChar respectively. In Delphi 2009 and later they are aliases to WideChar and PWideChar respectively.
Recently I have lost some of my debug functionality in Delphi 2007.
Specifically, the Watch List Window is completely disable as are all but a
few of the Watch List's popup menu items. The only menu items that are
enabled are
Add Group...
Show Column Headers
Stay on Top
Dockable
This is the case in the ide and the program running or not running
Breakpoints work as does tooltip expressions at breakpoint.
In Tools | Options , Code completion, Error Insight, Block Completion and
Code Template Completion are unchecked, all other options are checked.
In Tools | Options, Debugger Options are set Integrated Debugging and
Automatically close files implicitly...' checked , all others unchecked.
In Project | Options (Compiler), Optimization unchecked All Debugging
section items checked with exception of 'definitions only'
Conditional Defines are DEBUG;madExcept
When a breakpoint is hit, the Watch List windows shows 'Evaluating...' for
each Watch Name. BTW, the watch names were entered some time ago when all
debugging features were working.
After a period of attempted debugging while at a breakpoint (stopped), the
Run button on toolbar becomes disabled and I have to click 'Run | Program
Reset' on the menu at which time madExcept
throws the following exception from the IDE:
date/time : 2014-09-28, 09:08:17, 855ms
computer name : JOHNTAYLOR-LAP
user name : JT <admin>
registered owner : Microsoft / Microsoft
operating system : Windows 7 x64 build 7600
system language : English
system up time : 10 days 22 hours
program up time : 3 days
processors : 8x Intel(R) Core(TM) i7 CPU Q 840 # 1.87GHz
physical memory : 7944/16308 MB (free/total)
free disk space : (C:) 83.99 GB
display mode : 1024x768, 32 bit
process id : $2994
allocated memory : 354.77 MB
command line : "C:\CodeGear RAD Studio\CodeGear\RAD Studio\5.0\bin\bds.exe" -np
executable : bds.exe
current module : madExcept_.bpl
exec. date/time : 2007-12-11 15:04
version : 11.0.2902.10471
compiled with : Delphi 2006/07
madExcept version : 4.0.6
callstack crc : $f8d6ff12, $83616f26, $cd9b05a3
exception number : 1
exception class : EListError
exception message : List index out of bounds (0).
main thread ($325c):
20032558 +03c rtl100.bpl Classes 3525 +3 TInterfaceList.Put
2087a8f4 +008 dbkdebugide100.bpl Debug 6414 +1 TThread.RemoveNotifier
20aa3b13 +043 coreide100.bpl WatchWin 1543 +1 TWatchWindow.EvaluteComplete
20878cf9 +0fd dbkdebugide100.bpl Debug 5564 +12 TThread.EvalComplete
20877660 +02c dbkdebugide100.bpl Debug 4871 +2 TDbkApiEvent.Send
208784c8 +024 dbkdebugide100.bpl Debug 5300 +2 TDebugKernel.apiComplete
2013a81a +012 vcl100.bpl Controls 4039 +1 TControl.ScreenToClient
209b6b21 +065 coreide100.bpl EditorControl 6744 +3 TCustomEditControl.WMNCHitTest
7759e74d +078 ntdll.dll RtlAnsiStringToUnicodeString
76977b0a +016 USER32.dll CallWindowProcA
20885499 +039 dbkdebugide100.bpl Debug 11455 +3 TDebugger.DBKWndProc
20040e4c +014 rtl100.bpl Classes 11583 +8 StdWndProc
7696810d +00a USER32.dll DispatchMessageA
Can anyone help me get this straightened out ? This started suddenly about
a month ago and not pursuant to any new component installation that I am
aware of.
I had the same problem in BDS2006. And I found a very simple solution that worked for me. Open your project desktop-file (.dsk). Go to the watches section. I just removed some unwanted watches (don't forget to adjust the count), started Delphi again and my watches and menu-items were enabled.
I am trying to compare the performance of a specific F# benchmark running on .NET and Mono 2.10.2 (Windows 7, 64-bit). I took the Spectral-Norm benchmark from the Benchmarks Game followed the traditional SO advice of using System.Diagnostics.StopWatch for benchmarking C# and added the lines 4, 89-90, and 93-95 at this link. I compiled this code in Visual Studio 2010 (For runtime 4.0, not client profile, any CPU, with optimize code and tail calls turned on). The compiled code runs just fine on .NET (including inside VS), but when I run the .exe on Mono with "mono shootout_spectralnorm.exe" I get the following error (repeated in the fssnip.net link):
Unhandled Exception: System.TypeInitializationException: An exception was thrown
by the type initializer for System.Diagnostics.Stopwatch ---> System.InvalidPro
gramException: Invalid IL code in System.Diagnostics.Stopwatch:.cctor (): method
body is empty.
--- End of inner exception stack trace ---
at Program.main (System.String[] args) [0x00000] in <filename unknown>:0
The strange thing is, when I remove the lines I had added (lines 4, 89-90, and 93-95, which relate to the timing part of the benchmark), the error goes away on Mono, and it acts just like it does on MS .NET. This is just baffling me. I set all of the referenced assemblies in VS to be copied locally, so they should be visible to Mono, but there could be some precedence issue with different assemblies in the GAC that have the same name as the ones in the local folder. Has anyone encountered this issue or a similar one, especially on Windows Mono? If so, or if you think you know how this problem could be fixed, I hope you can help me resolve it.
Reference Assemblies do not (often) have code - they are API signatures only (enough info for the compiler to reference them at design-time/compile-time). You need to copy the runtime assemblies, not the reference assemblies, in order to run it. (You'll often find the runtime assemblies in the GAC.)
Here are measurements for FSharp-2.0.0.0 spectral-norm #2 (Intel Q6600 quad-core, MS Vista 32 bit)
fsc CPU s Elapsed s
500 0.281 0.337
3000 4.883 1.453
5500 15.85 4.212
2.10.2 CPU s Elapsed s
500 0.343 2.222
3000 4.836 3.361
5500 15.912 6.153
C:/Mono-2.10.2/bin/mono.exe C:/FSharp-2.0.0.0/bin/fsc.exe --platform:x86
--optimize+ --out:spectralnorm.exe spectralnorm.fsharpmono-2.fs
C:/Mono-2.10.2/bin/mono.exe --gc=sgen spectralnorm.exe 5500
Now the benchmarks game spectral-norm on MS Vista demo, includes F# on Mono.
Hi
I'm working on some legacy code - ATL ActiveX used as "installer" downloads files from the server for later installation.
There is a "progress bar window" that works fine.
The problem is when I start another instance of the ActiveX in the same process (Windows XP IE7), the progress bar is not installed for the second instance.
::CreateWindowEx(0L, PROGRESS_CLASS, EMPTY_STRING, WS_CHILD | WS_VISIBLE, X, (2*Y)-m_nProgHeight, nWidth - 2*X, m_nProgHeight, m_hWnd, NULL, _Module.GetModuleInstance(), NULL);
So I'm getting error 1407 CLASS_NOT_REGISTERED.
The only place where I find some code related to the registration is in DLLMain (this is also my concern)) For attach case:
WNDCLASS wc;
memset(&wc,0,sizeof(wc));
::GetClassInfo(hInstance, "#32770", &wc);
wc.lpszClassName = "XXXXXWindow";
RegisterClass(&wc);
Thank you
OK, what I found is:
- When IE started it loads two comctl32.dll - version 5.xxx and version 6.xxxxx.
Some how after the first instance of activeX finished it's run (deployment) I see that only version 6.xxxx of comctl32.dll left loaded.
Adding InitCommonControlsEx() did not helped, since for the second run the dll was already unloaded, that actually caused the crash of IE.
When I added explicitly LoadLibrary(comctl32.dll) it solved the issue.
If anyone knows what could cause the unload of version 5.xxxx please comment here.
Thank you.