Delphi

Callback from Delphi DLL to C# - only works in idle winform or using app.doevents?

随声附和 提交于 2020-01-05 08:09:48
问题 I give up, I have to write and ask; I'm using an unmanaged DLL written in Delphi, which asynchronously invokes a (parameterless) callback passed to it whenever an event occurs in the hardware it is developed to monitor. What I do in C# is I keep a static reference to a created delegate, which is then passed as parameter to the start method on the Delphi side. This tells the DLL to notify me using the callback, whenever there is new data to fetch, using a GetData method. All works fine, real

Callback from Delphi DLL to C# - only works in idle winform or using app.doevents?

别等时光非礼了梦想. 提交于 2020-01-05 08:09:28
问题 I give up, I have to write and ask; I'm using an unmanaged DLL written in Delphi, which asynchronously invokes a (parameterless) callback passed to it whenever an event occurs in the hardware it is developed to monitor. What I do in C# is I keep a static reference to a created delegate, which is then passed as parameter to the start method on the Delphi side. This tells the DLL to notify me using the callback, whenever there is new data to fetch, using a GetData method. All works fine, real

FDPhysFBDriverLink behaving weirdly with VendorLib Path

蓝咒 提交于 2020-01-05 07:52:31
问题 I'm starting my first application with FireDAC and Firebird 3.0 and I'm having this weird problem with FDPhysFBDriverLink . Setting it up requires you to set VendorHome and VendorLib to get the driver link working... When I set them, the driver keeps adding "\bin\" to the end of my VendorHome path. For example: In runtime my application FDPhysFBDriverLink 's properties are set like this: FDPhysFBDriverLink.VendorHome := ExtractFilePath(Application.ExeName); FDPhysFBDriverLink.VendorLib :=

How to properly access a VARCHAR(MAX) parameter value of a FireDAC dataset when getting “data too large for variable” error?

☆樱花仙子☆ 提交于 2020-01-05 07:42:53
问题 Our application updates and accesses data using SQL Server 2014. I have a table of which the last column ('Contents') is created as VARCHAR(MAX) . We are using Delphi XE8, and are using a FireDAC TFDQuery component to update this column. ..... FDquery.ParamByName('Contents').AsString:=Contents; FDquery.ExecSQL; When running this update, I get the following error: Exception raised with message [FireDAC][Phys][ODBC]-345. Data too large for variable [CONTENTS]. Max len = [8002], actual len =

Mocking interfaces in DUnit with Delphi-Mocks and Spring4D

自古美人都是妖i 提交于 2020-01-05 07:42:12
问题 So, I am getting Access Violation error when try to Mock 2-nd composite interface, below examples of code with using Delphi-Mocks and Spring4D frameworks unit u_DB; type TDBObject = class public property ID: TGUID; end; TDBCRM = class(TDBObject) public property SOME_FIELD: TSomeType; end; unit i_dmServer; type {$M+} IdmServer = interface ['{A4475441-9651-4956-8310-16FB710EAE5E}'] function GetServiceConnection: TServiceConnection; function GetCurrentUser(): TUser; end; unit d_ServerWrapper;

TurboPower B-Tree Filer and Delphi XE2 - Anyone done it?

穿精又带淫゛_ 提交于 2020-01-05 07:27:47
问题 I might be the last guy on the planet relying on B-Tree Filer but I made the jump from Delphi 2007 to XE2. After getting over all the AnsiChar and PAnsiChar issues, the code now crashes with a Range Check with zero items on a page. Is anyone successfully running B-Tree Filer under Delphi XE2? If so, how'd ya do it? :) Update Range check error here: procedure IsamUnPack(var Page : IsamPage; KeyL : Word); var I, K, S : Word; P : Array [0..0] Of Byte absolute Page; {Real bounds [0..65535]} begin

TurboPower B-Tree Filer and Delphi XE2 - Anyone done it?

感情迁移 提交于 2020-01-05 07:27:11
问题 I might be the last guy on the planet relying on B-Tree Filer but I made the jump from Delphi 2007 to XE2. After getting over all the AnsiChar and PAnsiChar issues, the code now crashes with a Range Check with zero items on a page. Is anyone successfully running B-Tree Filer under Delphi XE2? If so, how'd ya do it? :) Update Range check error here: procedure IsamUnPack(var Page : IsamPage; KeyL : Word); var I, K, S : Word; P : Array [0..0] Of Byte absolute Page; {Real bounds [0..65535]} begin

How to Play mp3 file from memory in delphi?

给你一囗甜甜゛ 提交于 2020-01-05 07:25:21
问题 I am downloading a mp3 file from the internet to memory using InternetReadFile. This works great, I can dump the file on disk and then play it, but I want to play the file without dumping it on disk. Is there a library i can use to achieve this functionality ? Some docs on how to use the library would be useful too. Thanks in advance. 回答1: You can use the BASS Delphi audio library On the other side, search for "MP3" on the 3D Buzz site. They have a very good series of video tutorials that

Do I have to worry about integer values assigned to TList become invalid?

南笙酒味 提交于 2020-01-05 07:17:26
问题 Lets say I have the following procedure, I have the following questions marked as Q1, Q2, and so on in the comments of the code: var winHandle: THandle; ... // At this point, assume aList is empty. winHandle := FindWindow(...); aList.Add(Pointer(winHandle)); // Now THandle(aList[0]) = winHandle. // After this point, variable `winHandle` will go out of scope thus become invalid, so: // Q1: Do I have to worry about that the value of THandle(aList[0]) // will be erased in the memory thus become

Do I have to worry about integer values assigned to TList become invalid?

别等时光非礼了梦想. 提交于 2020-01-05 07:17:08
问题 Lets say I have the following procedure, I have the following questions marked as Q1, Q2, and so on in the comments of the code: var winHandle: THandle; ... // At this point, assume aList is empty. winHandle := FindWindow(...); aList.Add(Pointer(winHandle)); // Now THandle(aList[0]) = winHandle. // After this point, variable `winHandle` will go out of scope thus become invalid, so: // Q1: Do I have to worry about that the value of THandle(aList[0]) // will be erased in the memory thus become