That's only about those specific ReportPro dlls, there's code in report pro that loads them if they are needed. Same as with XSharp.MacroCompiler.dll and XSharp.Rdd.dll, normally you must not reference those directly in your apps (unless you need to directly use types from there in very special cases), instead the X# runtime loads them whenn needed (when opening a dbf or macro compiling for the first time).FFF wrote: Tue Feb 18, 2025 9:47 am Re the "loaded when needed": Is that new, or somewhere documented?
Error PrintPreview b
Moderator: wriedmann
Re: Error PrintPreview b
Hi Karl,
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Re: Error PrintPreview b
Karl, Chris
Also, the language DLLs have no code, only (native) resources.
Robert
Also, the language DLLs have no code, only (native) resources.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Re: Error PrintPreview b
Hi Martin,
Glad you have it working in now! But with so many unneeded, duplicates and from different places references, you will definitely have issues in the future, especially when you will want to use a newer X# version. I suggest to do this:
- Remove all references from all libraries and the main app, except for "System" and the few ones of bBrowser and Report Pro (and FreeImageNET.dll, if you need this indeed).
- Then add only the needed ones, from the correct places. In all libraries and the app, you need to add those references (for the app properties window, References page):
"GAC" page:
-------------
XSharp.Core
XSharp.RT
XSharp.VO
VOGUIClasses
VORDDClasses
VOSystemClasses
VOWin32APILibrary
"Project" page:
-----------------
Here you add references to your own libraries in the same project. Each library/app needs different ones:
BS_Server_V4: does not need project references
BS_Util_V4: Needs a reference to BS_Server_V4
BS_report_V4: Needs references to both of the above libraries
BS_V4 (the main app/exe): Needs references to all three above libraries
It's much better to do this this way (via the Project page), instead of adding a reference directly to the libraries as dll files on disk, because it lets the IDE automatically resolve where on disk they are generated by the compiler, no matter the configuration (Debug/Release) used, or what the main project folder is.
Glad you have it working in now! But with so many unneeded, duplicates and from different places references, you will definitely have issues in the future, especially when you will want to use a newer X# version. I suggest to do this:
- Remove all references from all libraries and the main app, except for "System" and the few ones of bBrowser and Report Pro (and FreeImageNET.dll, if you need this indeed).
- Then add only the needed ones, from the correct places. In all libraries and the app, you need to add those references (for the app properties window, References page):
"GAC" page:
-------------
XSharp.Core
XSharp.RT
XSharp.VO
VOGUIClasses
VORDDClasses
VOSystemClasses
VOWin32APILibrary
"Project" page:
-----------------
Here you add references to your own libraries in the same project. Each library/app needs different ones:
BS_Server_V4: does not need project references
BS_Util_V4: Needs a reference to BS_Server_V4
BS_report_V4: Needs references to both of the above libraries
BS_V4 (the main app/exe): Needs references to all three above libraries
It's much better to do this this way (via the Project page), instead of adding a reference directly to the libraries as dll files on disk, because it lets the IDE automatically resolve where on disk they are generated by the compiler, no matter the configuration (Debug/Release) used, or what the main project folder is.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Re: Error PrintPreview b
Hello Chris
I have adapted everything as I understood it.
Unfortunately, the programme crashes again during the preview without an error message.
What is missing?
Martin
I have adapted everything as I understood it.
Unfortunately, the programme crashes again during the preview without an error message.
What is missing?
Martin
Re: Error PrintPreview b
Martin,
Your main program does not reference the ReportPro Base and ReportPro Runtime DLLs
Robert
Your main program does not reference the ReportPro Base and ReportPro Runtime DLLs
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Re: Error PrintPreview b
Hi Martin (and others),
Just to explain further the problem and solution, ReportPro (and other tools) rely on _INIT1 (or 2, or 3) which are automatically called at app startup, in order to initialize some variables or do some necessary preparation.
The way this has currently been implemented in X# under the hood, is that for each library referenced by an application, the compiler emits some special code that calls those procedures, before the FUNCTION Start() of the app is executed. But if a library is not used (referenced) directly by an app and is only used indirectly as a reference of another library, then the compiler is not aware of this when compiling the main app and does not include that library in the initialization.
Adding such libraries as references also to the main app (even if the main app does not directly need them) fixes this problem, but we are discussing also other alternative ways to implement this without needing this workaround.
Just to explain further the problem and solution, ReportPro (and other tools) rely on _INIT1 (or 2, or 3) which are automatically called at app startup, in order to initialize some variables or do some necessary preparation.
The way this has currently been implemented in X# under the hood, is that for each library referenced by an application, the compiler emits some special code that calls those procedures, before the FUNCTION Start() of the app is executed. But if a library is not used (referenced) directly by an app and is only used indirectly as a reference of another library, then the compiler is not aware of this when compiling the main app and does not include that library in the initialization.
Adding such libraries as references also to the main app (even if the main app does not directly need them) fixes this problem, but we are discussing also other alternative ways to implement this without needing this workaround.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu

