Delphi

Setting up File associations

北战南征 提交于 2020-02-07 05:46:29
问题 I am trying to get Windows to recognise my program's File extensions but without much luck, as usual. This is what I am doing, please advise where or what I am doing wrong - I think I might have the registry locations or naming set incorrectly: Sample Names MyProg.exe = The name of the program. %InstallPath% = Where the program will be installed. .ext1 = 1st File Extension. .ext2 = 2nd File Extension. .ext3 = 3rd File Extension. Registry Locations (where I have added to) HKEY_CLASSES_ROOT\

Delphi 获取Https网页内容的另外一种方法

ⅰ亾dé卋堺 提交于 2020-02-07 01:22:47
Delphi 获取Https网页内容的另外一种方法,一般我们都是用indy获取,下面这个代码不是用indy获取 function GetWebPage(const Url: string): string; var Session, HttpFile: HINTERNET; szSizeBuffer: Pointer; dwLengthSizeBuffer: DWord; dwReserved: DWord; dwFileSize: DWord; dwBytesRead: DWord; Contents: PChar; begin Session := InternetOpen('', 0, niL, niL, 0); HttpFile := InternetOpenUrl(Session, PChar(Url), niL, 0, 0, 0); dwLengthSizeBuffer := 1024; HttpQueryInfo(HttpFile, 5, szSizeBuffer, dwLengthSizeBuffer, dwReserved); GetMem(Contents, dwFileSize); InternetReadFile(HttpFile, Contents, dwFileSize, dwBytesRead); InternetCloseHandle

onBeforeBrowse event in Delphi Chromium component

…衆ロ難τιáo~ 提交于 2020-02-07 00:00:30
问题 I'm trying to use following procedure in Delphi XE2 with Chromium component (version 306): procedure TForm1.Chromium1BeforeBrowse(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; navType: TCefHandlerNavtype; isRedirect: Boolean; out Result: Boolean); but it's not working. Delphi doesn't recognize onBeforeBrowse event. Chromium seems to be correctly installed, samples are working, and I'm trying to add onBeforeBrowse event handling in GuiClient

Calling REST Web API using Delphi

巧了我就是萌 提交于 2020-02-06 07:03:50
问题 I have an ASP.NET MVC Web API and I need to call it using Delphi 6. I am trying to use the Indy components (version 9.0.18), I am using the TIdHttp component. I am using the REST methods, like POST to add, PUT to update and DELETE to delete the records. I got successfully adding, updating and getting my records, but I couldn't get successfully to call the DELETE method. It raises an error "HTTP/1.1 400 Bad Request". I tried to debug the Web API, but it appers that the request didn't come,

Calling REST Web API using Delphi

别等时光非礼了梦想. 提交于 2020-02-06 07:02:07
问题 I have an ASP.NET MVC Web API and I need to call it using Delphi 6. I am trying to use the Indy components (version 9.0.18), I am using the TIdHttp component. I am using the REST methods, like POST to add, PUT to update and DELETE to delete the records. I got successfully adding, updating and getting my records, but I couldn't get successfully to call the DELETE method. It raises an error "HTTP/1.1 400 Bad Request". I tried to debug the Web API, but it appers that the request didn't come,

Sonarqube Delphi plugin

家住魔仙堡 提交于 2020-02-06 04:27:29
问题 I have scoured the web looking for the Sonar Delphi plugin 0.2 (sonar-delphi-plugin-0.2-SNAPSHOT.jar). Since the shutdown of codehaus, it seems this plugin is not available anywhere else? http://snapshots.repository.codehaus.org/org/codehaus/sonar-plugins/sonar-delphi-plugin/0.2-SNAPSHOT/ There is several references to this URL, but I cannot find this plugin anywhere else. Does someone please know where I can download it, or possibly has it available to share? 回答1: The plugin was abandoned

“Text exceeds memo capacity” error

☆樱花仙子☆ 提交于 2020-02-06 04:21:06
问题 I have a TMemo in which I tried to load text but I get this error: "Text exceeds memo capacity". The code is this: Memo1.Lines.LoadFromFile(s) What is the limit for TMemo under Delphi 7/Win 7? I knew there was a 64KB limit but under Win95/98. Note: This error is a screenshot sent by a user. I can successfully load large files (5-10 MB). Update: I got a new bug report this time at this line: procedure TCLog.Add (s: string; Cl: TColor); begin SelStart:= Length(Text); SelAttributes.Color:= Cl; S

Delphi 7, Windows 7, event handler, re-entrent code

不想你离开。 提交于 2020-02-06 02:56:33
问题 I've got some very old code (15+yr) that used to run ok, on older slower machines with older software versions. It doesn't work so well now because if fails a race condition. This is a general question: tell me why I should have known and expected the failure in this code, so that I can recognise the pattern in other code: procedure TMainform.portset(iComNumber:word); begin windows.outputdebugstring(pchar('portset ' + inttostr(icomnumber))); with mainform.comport do try if open then open :=

Delphi开发能力自我评测

♀尐吖头ヾ 提交于 2020-02-05 15:08:46
转载至 : http://www.delphifans.com/infoview/Article_4628.html (注:以下内容都是作者个人的学习经验和体会,仅代表个人观点。针对Win32下的Delphi程序开发而言,部分内容或思想也可适用于其它工具或平台下的软件开发。) 在程序员的求职资料中,用得最泛滥的词可能是“熟悉”和“精通”了。评价一个程序员的综合能力并不容易,下面的文字试图以Delphi程序开发为例定义一种描述程序员开发能力的方法。 一、学习阶段划分。 根据我个人的经验,Delphi程序设计分为以下几个阶段: 1、 熟悉阶段。 这一阶段指从未接触过Delphi的人,刚开始学习到初步掌握Delphi的语法、可视化编程、面向对象编程的概念、Delphi IDE开发环境、基本代码编写、程序结构的过程。 熟悉阶段结束后,学习者应该可以编写简单的程序,同时对整个Delphi开发环境有一定的了解,但还不能从事开发工作。 根据学习者是否有编写其它语言代码的经验、是否接触过面向对象编程等因素,这一过程可能需要数天到数十天的时间。 2、 入门阶段。 在熟悉Delphi后,入门的标志是学习者可以有目的地利用Delphi强大的可视化开发环境、结合一些常规的代码编写技术,编制一些小型的程序,或是完成简单的数据库应用。同时,还应掌握基本的程序调试方法。 入门后,程序员可以从事简单的开发工作

Unmarshalling Error

余生颓废 提交于 2020-02-05 01:30:29
问题 I have a pretty abnormal(IMHO) error that it's being raised whenever I try do a request to a SOAP service: Unmarshalling Error: unexpected element (uri:"http://www.domain.com/ws/servicename/", local:"dummyArg"). Expected elements are <{}dummyArg> The method that I'm calling has is defined as: function GetData(const dummyArg: WideString): Array_Of_Data; stdcall; I have little experience with SOAP therefore I'm this [ ] close to lose my mind, I couldn't find any useful information on this. Feel