Delphi

How do I keep an embedded browser from prompting where to save a downloaded file?

馋奶兔 提交于 2019-12-30 07:32:33
问题 How to down load a file after clicking a download button programatically, and therefore not needing to know the url for the downloading file. After a file has downloaded a prompt comes up and asks if you'd like to save the file, after pressing 'yes' another prompt asks where you'd like to save the file. So, the file is downloaded first, maybe into a buffer somewhere, after the initial download, the prompts appear. So, once the button is clicked how do you capture the downloading stream and

How to implement IOTAProjectCompileNotifier of Delphi's ToolsAPI?

∥☆過路亽.° 提交于 2019-12-30 07:28:18
问题 I am using Delphi XE IDE. I create a notifier to implement IOTACompileNotifier. After install the expert in the IDE. The code works fine when I compile my project. The notifier is working for ProjectCompileStarted. The second time I compile my project, the Delphi IDE prompt: [Fatal Error] Access violation at address 21B7FBED in module 'delphicoreide150.bpl'. Read of address 00000000 Although it seems weird that I perform: var i: integer; begin i := Project.ProjectBuilder.AddCompileNotifier

Port Forwarding by Using “HNetCfg.NATUPnP” Ole Object Failed

元气小坏坏 提交于 2019-12-30 07:20:54
问题 I am using a code for forwarding a port. this code works fine on My Windows 7; but I can't use It on Windows XP. Update 1 For Problem(2012-10-17 07:32:00Z) This is my source code: uses ActiveX, oleAuto; Procedure AddUPnPEntry(Port: Integer; const Name: ShortString; LAN_IP: string); Var Nat: Variant; Ports: Variant; SavedCW: Word; Begin if NOT(LAN_IP = '127.0.0.1') then begin try Nat := CreateOleObject('HNetCfg.NATUPnP'); Ports := Nat.StaticPortMappingCollection; // Error Raized From Here!!!

How to handle File Associations from Application?

烂漫一生 提交于 2019-12-30 07:17:47
问题 I know Installers can setup File Associations for your Application during the installation process, so if you have your own File types that open with your Application, it will be setup to do that, and also the associated File will have its own icon in Windows what you define. Anyway, I would like to be able to Set/Remove the File types my Application will use, directly from the preferences form in my Application. What methods are needed to do this, I am thinking along the lines of the

Delphi CreateOleObject events

送分小仙女□ 提交于 2019-12-30 07:10:28
问题 There is a code: var myobject: OleVariant; begin myobject := CreateOleObject('SomeNamespace.SomeClass'); end; This COM object has events (for example OnClick). How should I connect to these events without importing TLB? 回答1: You are working with COM late-binding, so do you need write a lot of code to handle events. this task is not difficult if you know COM, basically do you need follow these steps. Create a new object(class) derived from TInterfacedObject that implements IDispatch implement

Problems in Showmodal after assigning to Setparent(..)

江枫思渺然 提交于 2019-12-30 07:09:59
问题 I created two application MainApps and SubApps, the SubApps has a modal type dialogbox such as login/logout form etc. and its working fine. After I attach it to the MainApps, the Modal Dialog box shows like normal box form. It behaves like "DIALOG.SHOW" instead of "DIALOG.SHOWMODAL"; I am using delphi compiler SubApps buttonclick; begin with TfrmDialog.Create(Self, dtLogout) do try iMsgResult := ShowModal; finally Free; end; if iMsgResult = mrOk then begin dmVoca.FHomeworkXMLDoc.Active :=

Delphi - Using DeviceIoControl passing IOCTL_DISK_GET_LENGTH_INFO to get flash media physical size (Not Partition)

心不动则不痛 提交于 2019-12-30 07:08:28
问题 Alright this is the result of a couple of other questions. It appears I was doing something wrong with the suggestions and at this point have come up with an error when using the suggested API to get the media size. Those new to my problem I am working at the physical disk level, not within the confines of a partition or file system. What I am doing I am trying to get the size of a flash card from the first block to the last, boot record partition space and all. While I don't need it to dump

Unexpected Thread behaviour calling Delphi DLL

∥☆過路亽.° 提交于 2019-12-30 07:05:23
问题 Continue from my other question: How do I pass and retrieve memory stream from my Application to/from DLL? I have wrote the DLL using IStream as input/output. The DLL uses IXMLDocument (which at first I thought was related to the follow problem) Tested it, and it worked well in the main UI. Problems began when I was calling the DLL from a worker thread. The DLL: library MyDLL; uses Windows, Variants, SysUtils, Classes, AxCtrls, ActiveX, XMLDoc, XMLIntf; {$R *.res} procedure Debug(V: Variant);

Unexpected Thread behaviour calling Delphi DLL

隐身守侯 提交于 2019-12-30 07:04:43
问题 Continue from my other question: How do I pass and retrieve memory stream from my Application to/from DLL? I have wrote the DLL using IStream as input/output. The DLL uses IXMLDocument (which at first I thought was related to the follow problem) Tested it, and it worked well in the main UI. Problems began when I was calling the DLL from a worker thread. The DLL: library MyDLL; uses Windows, Variants, SysUtils, Classes, AxCtrls, ActiveX, XMLDoc, XMLIntf; {$R *.res} procedure Debug(V: Variant);

Unexpected Thread behaviour calling Delphi DLL

戏子无情 提交于 2019-12-30 07:04:27
问题 Continue from my other question: How do I pass and retrieve memory stream from my Application to/from DLL? I have wrote the DLL using IStream as input/output. The DLL uses IXMLDocument (which at first I thought was related to the follow problem) Tested it, and it worked well in the main UI. Problems began when I was calling the DLL from a worker thread. The DLL: library MyDLL; uses Windows, Variants, SysUtils, Classes, AxCtrls, ActiveX, XMLDoc, XMLIntf; {$R *.res} procedure Debug(V: Variant);