ERROR on compiling

superbabicka

Member
Licensed User
Hi, I have this errorwhen I want to compile exe -desktop application

Error compiling program.
Error message: error C51502: The best overloaded method match for 'system.Drawing.Font.Font(string, float, System.Drawing.FontStyle)' has some invalid arguments.

Is there are some old dll version Like FormLib?
I see on the forum, and I find one post for this error, but there are no explain what to do?

Please Help!
 

superbabicka

Member
Licensed User
Oh, there is bigger code, but

I send you my source of application like attachment, because there are too many images also, and db. So i think that it will be done if I send you only source code.

OK, so there are is 3 forms, one is "master" form, second is for account change after login, and third is for open application, like image on startup (with no Windows borders).
Also I use here WebBrowser.dll to manage these data from this application , directly to web server database (access), using outgoing forms, and sessions.

Actually this is Stock house application, and clients can review his data online, but administration is on some local computer with internet connection.

also I use FormLib to make image buttons better design (noBold Text, and on someone i use Tahoma font) - i think that here is the problem, but i try to rid that, and nothing. I remove FormLib library, and all flb in code, and again - nothing.

My mistake is that I work allot of time on this, and only once i compiled , and now after 10 days work, when I try to complie - app down.

thank you very much for your future help. I don't think that you don't have solution.
Thank you for your replay!

Regards for all Basic4PPC team!
 
Last edited:

superbabicka

Member
Licensed User
Oh Nooo!

I unCheck button in Dbasic -"Optimize Compiled", and I compile my app with no problem.

OK, there is some error like ActiveX"456-34-34-7-6--- some numbers", but now is easy :):sign0060:

Thanks
 

agraham

Expert
Licensed User
@agraham, do you know which line creates this code?
There are lots, it's a generic optimising compiler 'problem'. Just put a textbox on a form and set its font size to a decimal and it will give that error on optimised compilation. The C# compiler thinks "10.5" is a double while Font() wants a float but the compiler won't downcast automatically and errors without a cast.
 

superbabicka

Member
Licensed User
Thank you Erel and Agrham!
You are the best.

So, what's happen if I compile without "Optimized Compilation"... ?
Is there will be some bug in the exe, or this option is added only to make applications smaller size for PDA ans smart phones?

Anyway this is desktop version, so app size is not a problem so much.

Thanks!
 

agraham

Expert
Licensed User
So, what's happen if I compile without "Optimized Compilation"... ?
If legacy (non-optimised) compiled your application will run more slowly, no libraries will be merged with your exe and will only need .NET 1.1 on your target machine unless you are using any libraries that need .NET 2.0.

An optimised compiled app will run about three or four times faster, will have most if not all libraries merged (as long as their source is in the Libraries folder) but will need .NET 2.0 or later on the target machine.
 
Top