Possibly error message when starting program with missing included DLL
- ArneOrtlinghaus
- Posts: 413
- Joined: Tue Nov 10, 2015 7:48 am
- Location: Italy
Possibly error message when starting program with missing included DLL
Robert,
thank you for the information. Nice to know how much the compiler does. In older times every type had to be exact what was requested in the original function and now the compiler makes all the transformations/castings that are necessary.
thank you for the information. Nice to know how much the compiler does. In older times every type had to be exact what was requested in the original function and now the compiler makes all the transformations/castings that are necessary.
Possibly error message when starting program with missing included DLL
Arne,
All this stuff is done by the guys at Microsoft.
Robert
Although I really would want to take the credit for this, that would be too much honour.ArneOrtlinghaus wrote:Robert,
thank you for the information. Nice to know how much the compiler does. In older times every type had to be exact what was requested in the original function and now the compiler makes all the transformations/castings that are necessary.
All this stuff is done by the guys at Microsoft.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Possibly error message when starting program with missing included DLL
Hi Robert,
I have tried this, but it does not even compiles:
My Application is called ProdPlan.exe, and uses the namespace ProdPlan.
I have now tried to do that in a small sample, but have the same behavior: The code is the following:
Where is my error, please?
Thank you very much!
Wolfgang
I have tried this, but it does not even compiles:
Code: Select all
error XS0234: The type or namespace name 'exe' does not exist in the namespace 'ProdPlan' (are you missing an assembly reference?) 15,2 Start.prg ProdPlan
I have now tried to do that in a small sample, but have the same behavior: The code is the following:
Code: Select all
try
ProdPlan.exe.Functions.Start()
catch oEx as Exception
.....
Thank you very much!
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Possibly error message when starting program with missing included DLL
Wolfgang,
This app is for the Core dialect. The namespace rules are different in the core dialect. The class is now simply named "Functions".
So you need to call Functions.Start()
But since you have an argument in Start() for the commandline arguments, you also need this argument in the Start() method and you need to pass that argument along.
And then, after you fix the missing parameters in your call to OutPut() <g> everything will work.
Robert
This app is for the Core dialect. The namespace rules are different in the core dialect. The class is now simply named "Functions".
So you need to call Functions.Start()
But since you have an argument in Start() for the commandline arguments, you also need this argument in the Start() method and you need to pass that argument along.
And then, after you fix the missing parameters in your call to OutPut() <g> everything will work.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Possibly error message when starting program with missing included DLL
Hi Robert,
it works now with this code:
For anyone interested please see the attached sample:
I have tried to inherit the startup window from a class in an external DLL and the copied the exe without the DLL to a random folder, and effectively I can see the correct error (and it is written to the disk).
Wolfgang
it works now with this code:
Code: Select all
Functions.Start()
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Possibly error message when starting program with missing included DLL
Hi Robert,
yes, after fixing the error with the Start() call I have seen (and fixed) also the errors in my Output call.
It works now:
Thank you very much!
Wolfgang
yes, after fixing the error with the Start() call I have seen (and fixed) also the errors in my Output call.
It works now:
Code: Select all
An unhandled exception has occurred
===================================
Exception: Die Datei oder Assembly "rdm.WinFormsLib, Version=1.0.0.1, Culture=neutral, PublicKeyToken=37b41ccb897b15ad" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
Callstack:
bei Functions.Start()
bei XStartupCode.Start() in C:XSharpXIDEProjectsPublicProjectsApplicationsStartupExceptionTesterPrgStart.prg:Zeile 18.
===================================
Press any to close the application
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Possibly error message when starting program with missing included DLL
Hi Robert,
another thing: I have now implemented that in my production planning software, and on compile I receive the following warning:
This application uses another lib that uses the same namespace.
Is the only solution to change the namespace of the library?
Thank you very much!
Wolfgang
another thing: I have now implemented that in my production planning software, and on compile I receive the following warning:
Code: Select all
warning XS0436: The type 'Functions' in '' conflicts with the imported type 'Functions' in 'ProdPlanGUILib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''. 15,2 Start.prg ProdPlan
Is the only solution to change the namespace of the library?
Thank you very much!
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Possibly error message when starting program with missing included DLL
Hi Robert,
another thing: when using a namespace, the compiler option must include it:
Wolfgang
P.S. maybe I will include that and a link to this discussion on the wiki....
another thing: when using a namespace, the compiler option must include it:
Code: Select all
-main:ProdPlan.XStartupCode
P.S. maybe I will include that and a link to this discussion on the wiki....
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Re: Possibly error message when starting program with missing included DLL
Hi Robert,
I'm back to this topic for a migrated application, and unfortunately I have some problems with it.
What is the default namespace for a migrated application that does not has any namespace indication with it?
On the line
in my StartupCode class I see the error
that may be connected to the default namespace.
Removing the "Functions." part fixed that for me.
But adding
to the compiler options gave me
So I think this is also namespace related.
Wolfgang
I'm back to this topic for a migrated application, and unfortunately I have some problems with it.
What is the default namespace for a migrated application that does not has any namespace indication with it?
On the line
Code: Select all
Functions.Start()
Code: Select all
error XS0117: 'XSharp.RDD.Functions' does not contain a definition for 'Start' 16,2 Start.prg DictEdit.XStartupCode:Start
Removing the "Functions." part fixed that for me.
But adding
Code: Select all
-main:DictEdit.XStartupCode
Code: Select all
error XS1555: Could not find 'DictEdit.XStartupCode' specified for Start function
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Re: Possibly error message when starting program with missing included DLL
Wolfgang,
When you migrate a VO app with the name DictEdit, then the generated Assembly name by the Exporter is DictEdit.EXE and the Default Namespace is also DictEdit
Please note that this default namespace is only used with:
- when you enable the option "Prefix classes with Default Namespace". In that case, the class Foo becomes DictEdit.Foo
- when you create files inside Visual Studio. A new class "Class1" will be generated as DictEdit.Class1.
When the new class file is in a folder "Test" then VS generates code for the class as DictEdit.Test.Class1.
The functions class in a migrated application is derived from the assembly name and not from the default namespace.
When the assembly name is DictEdit.Exe, then the name of the functions class is DictEdit.Exe.Functions
When the assembly name is DictEdit.Dll, then the name of the functions class is DictEdit.Functions
The compiler automatically adds a using DictEdit.Exe.Functions inside each of the programs in your app (assuming DictEdit.Exe is your assembly name).
So there is no need to prefix the code with Functions. If you do want to prefix then I would recommend to use the full name: DictEdit.Exe.Functions.Start()
Robert
When you migrate a VO app with the name DictEdit, then the generated Assembly name by the Exporter is DictEdit.EXE and the Default Namespace is also DictEdit
Please note that this default namespace is only used with:
- when you enable the option "Prefix classes with Default Namespace". In that case, the class Foo becomes DictEdit.Foo
- when you create files inside Visual Studio. A new class "Class1" will be generated as DictEdit.Class1.
When the new class file is in a folder "Test" then VS generates code for the class as DictEdit.Test.Class1.
The functions class in a migrated application is derived from the assembly name and not from the default namespace.
When the assembly name is DictEdit.Exe, then the name of the functions class is DictEdit.Exe.Functions
When the assembly name is DictEdit.Dll, then the name of the functions class is DictEdit.Functions
The compiler automatically adds a using DictEdit.Exe.Functions inside each of the programs in your app (assuming DictEdit.Exe is your assembly name).
So there is no need to prefix the code with Functions. If you do want to prefix then I would recommend to use the full name: DictEdit.Exe.Functions.Start()
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu