delphi-prism

How to hide the mainform and still run the program?

心不动则不痛 提交于 2020-01-02 08:09:55
问题 I want to run my program with the icon showing in the system tray but without the mainform showing from the start. Edit: lMainForm := new MainForm; lMainForm.ShowInTaskbar := true; Application.Run(lMainForm); Didn't work. As soon as Application.Run is executed, mainform is displayed along with the icon in the system tray. 回答1: The problem you have at the moment is that you are calling the Application.Run overload that takes the main form as a parameter. This will show the main form which you

How do I fix Delphi Prism ASP.NET error: “Parser Error Message: 'Oxygene' is not a supported language”

a 夏天 提交于 2020-01-01 19:00:50
问题 I have written an ASP.NET web application (not site) in Delphi Prism. Everything works fine on my devlopment machine, but when I install it on a test server I get the following error: Server Error in '/MyApp' Application. Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: 'Oxygene' is not a supported language.

How can I pass a Delphi string to a Prism DLL?

 ̄綄美尐妖づ 提交于 2019-12-28 06:24:17
问题 We try to pass a string from a native Delphi program to a Delphi Prism DLL. We have no problem passing integers, but strings are mismatched in the DLL. We saw Robert Love's code snippet in response to another question, but there is no code for the native Delphi program. How can we pass strings from Delphi to a Delphi Prism DLL? 回答1: The best way would be to use WideString. For several reasons. It is Unicode and works before D2009 It's memory is managed in ole32.dll, so no dependency on either

How to use Unmanaged Exports in Delphi

淺唱寂寞╮ 提交于 2019-12-12 18:55:04
问题 I'm making a project in C# and I want to use Unmanaged Exports and later to use it in Delphi. So can anyone explain me, how does Unmanaged Exports works, then how to use/import in Delphi. I'm using Visual Studio 2010 Express, on Windows 7 64 bit 回答1: The best description I've heard for unmanaged exports is "reverse PInvoke". These are limited to scalar types, but let you consume managed assemblies from native code without the overhead of COM Interop. I haven't tried it, but you can do this in

Replacement for TStringList in Delphi Prism.

天大地大妈咪最大 提交于 2019-12-12 11:23:35
问题 I am migrating an application written in Delphi 2007 .Net to Delphi Prism, which is the best option to replace the TStringList and TStrings class? Thanks in advance. Bye. 回答1: Just use the built in List types in the .NET framework, or the StringCollection. The easiest are the generic lists: List<String> But StringCollection has a few bits that the List does not have; you can read a bit about that in this thread. The advantage of using built-in .NET Framework classes, is that there is plenty

Writing/Reading User-Defined settings in app.config file

谁都会走 提交于 2019-12-12 04:46:28
问题 I am trying to read and write into app.config file of user-settings. I found a snippet of a code for working with confige file. I finally got it compiling and running, but it absolutely seems to be doing nothing to the App.config file. Here is the code: Method MainForm1.Button1.Click(sender: System.Object; e: System.EventArgs); var config : System.Configuration.Configuration; begin config:=ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings.Add(

Why timer (system.windows.forms.timer) won't start?

限于喜欢 提交于 2019-12-12 04:43:14
问题 Within a user-defined class, I have a timer and it just won't start when I Timer.Enabled. User-Defined Class: TSerialIndicator = public class private method TxTimerEvent(Sender:System.Object; e:System.EventArgs); public Txlight:Label; Txtimer:System.Windows.Forms.Timer; constructor(mform:Form); method Transmit; method Receive; end; Here is the constructor: constructor TSerialIndicator(mform:Form); begin TxLight := new Label; TxLight.AutoSize := false; TxLight.BorderStyle := BorderStyle

How to call function CreateProcess in Delphi Prism?

为君一笑 提交于 2019-12-12 01:29:53
问题 I wrote function CreateProcess( lpApplicationName:String; lpCommandLine:String; lpProcessAttributes:IntPtr; lpThreadAttributes:IntPtr; bInheritHandles:Boolean; dwCreationFlags:Int32; lpEnvironment:IntPtr; lpCurrentDirectory:IntPtr; lpStartupInfo:STARTUPINFO; lpProcessInformation:ProcessInfo):Boolean; external 'kernel32.dll'; but VStudio said "Semicolon" expected - after external and " "end" expected" after 'kernel32.dll'; Can you help me to load and call a function please? 回答1: Why don't you

Why does ShowDialog always return DialogResult.Cancel?

徘徊边缘 提交于 2019-12-10 13:39:04
问题 I have a custom made dialog winform. On it I have a label, textbox and 2 buttons (OK and Cancel). It also declares and defines overloaded execute methods for passing different parameter list. Dialog Winform is called as follows: var theDialog := new InputMsgBox; if theInputB.Execute('Awesome StackOverflow','Enter Text?',s,var s) = DialogResult.OK then begin Invalidate; SetText(s); end; Dialog Winform execute is defined as follow: method InputMsgBox.Execute(Title, theMessage, defaultanswer

Delphi Prism getting Unknown Identifier “DllImport” error

匆匆过客 提交于 2019-12-10 11:44:35
问题 I'm trying to call Window's SendMessage method in Delphi Prism, I've declared the class as follow: type MyUtils = public static class private [DllImport("user32.dll", CharSet := CharSet.Auto)] method SendMessage(hWnd:IntPtr; Msg:UInt32; wParam:IntPtr; lParam:IntPtr):IntPtr; external; protected public end; When I tried to compile, I get the error Unknown identifier "DllImport" I used this as an example, How to call function CreateProcess in Delphi Prism? and the syntax looks the same. Is there