Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 10/19/21 in Posts

  1. Wil van Antwerpen

    Delphi and the new Apple M1 CPU

    Hi, One note about Rosetta. Apple has switched CPU platforms several times. If the past predicts anything then Rosetta will be part of macOS for about 2 releases of macOS and disappear. It's designed to assist in migrating from one platform to another, not intended to stick around forever.
  2. OK, how much are you going to pay for such a filter then? 😉
  3. Uwe Raabe

    Editor freezes on Add Field short cut

    This bug was introduced in V15.0.11 when local variables started to detect generic types. Fixed in V15.0.47, which is now available for download.
  4. Uwe Raabe

    Editor freezes on Add Field short cut

    I can indeed reproduce that here. Investigating...
  5. Wil van Antwerpen

    Delphi and the new Apple M1 CPU

    Neither is going to happen, at least not from VMware or from Apple. VMware in particular has been very clear about this. For example here: https://blogs.vmware.com/teamfusion/2021/04/fusion-on-apple-silicon-progress-update.html but it is not just that one article. The Product Manager has mentioned it many times. They actually looked into it and have decided on not going there. Who knows if there's a skunk works in house version that is capable of doing exactly that. But there has been no hints in that direction, the "not going to happen" signals have been much stronger. Yes there is a Windows insider version running ARM and it runs well. The problem is that Microsoft does not provide licenses for that and so far there are no indications that they ever will. Windows on Arm only works with OEM hardware suppliers and apple isn't one of them. It is mostly (exclusively?) bundled with laptops having a Snapdragon processor. One could run on a VM with a Windows insider build, but that's not exactly production ready.
  6. Fr0sT.Brutal

    Reinstalling Delphi 10.4 after PC Crashed

    Had successful experience with freeware DriveXML. And I also transferred W7 from one PC to completely another with built-in Windows tool Angus mentioned
  7. eivindbakkestuen

    Stay on top of the new release EntityDAC for RAD Studio 11 Alexandria

    This particular group is not for announcements, please read the forum rules... you did it right before. 🙂
  8. Remy Lebeau

    update indy to use tls 1.2 in c++builder 6?

    Why not just install the latest Indy in C++Builder 6? No, not directly. Nor should you be trying to. What you should do instead is let the caller pass in its own function pointer(s), which your DLL then remembers, and can then call from inside its own OnWork event handler(s). For example, the following uses a little-known trick for assigning a standalone procedure as a VCL event handler, while also passing a user-defined parameter to it. There are other ways this could be implemented, but this is the most straight-forward way I can think of right now for your scenario: // HEADER #ifndef MY_DLL_H #define MY_DLL_H #ifdef __cplusplus extern "C" { #endif #ifdef BUILDING_DLL #define EXPORT __declspec(dllexport) #else #define EXPORT __declspec(dllimport) #endif enum OnWorkMode { WorkReading, WorkWriting }; typedef void (*OnWorkBeginFunc)(OnWorkMode AWorkMode, __int64 AWorkCountMax); typedef void (*OnWorkEndFunc)(OnWorkMode AWorkMode); typedef void (*OnWorkFunc)(OnWorkMode AWorkMode, __int64 AWorkCount); EXPORT char* getdata(const char *url, OnWorkBeginFunc onWorkBegin, OnWorkEndFunc onWorkEnd, OnWorkFunc onWork); EXPORT void freedata(char *data); #ifdef __cplusplus } #endif #endif // SOURCE #define BUILDING_DLL #include "mydll.h" static void __fastcall MyOnWorkBeginHandler(void *ASelf, TObject *ASender, TWorkMode AWorkMode, __int64 AWorkCountMax) { OnWorkBeginFunc func = static_cast<OnWorkBeginFunc*>(ASelf); func(AWorkMode, AWorkCountMax); } static void __fastcall MyOnWorkEndHandler(void *ASelf, TObject *ASender, TWorkMode AWorkMode) { OnWorkEndFunc *func = static_cast<OnWorkEndFunc*>(ASelf); func(AWorkMode); } static void __fastcall MyOnWorkHandler(void *ASelf, TObject *ASender, TWorkMode AWorkMode, __int64 AWorkCount) { OnWorkFunc *func = static_cast<OnWorkFunc*>(ASelf); func(AWorkMode, AWorkCount); } template <typename EventType, typename FuncType, typename HandlerType> static EventType makeEventHandler(FuncType *func, HandlerType *handler) { TMethod m; m.Data = func; m.Code = handler; return reinterpret_cast<EventType&>(m); /* alternatively: EventType evt; TMethod &m = reinterpret_cast<TMethod&>(evt); m.Data = func; m.Code = handler; return evt; */ } static bool sslPathSet = false; char* getdata(const char *url, OnWorkBeginFunc onWorkBegin, OnWorkEndFunc onWorkEnd, OnWorkFunc onWork) { char *result = NULL; try { if (!sslPathSet) { sslPathSet = true; IdOpenSSLSetLibPath(ExtractFilePath(ParamStr(0))); } TIdHTTP *http = new TIdHTTP; try { if (onWorkBegin) http->OnWorkBegin = makeEventHandler<TWorkBeginEvent>(onWorkBegin, &MyOnWorkBeginHandler); if (onWorkEnd) http->OnWorkEnd = makeEventHandler<TWorkEndEvent>(onWorkEnd, &MyOnWorkEndHandler); if (onWork) http->OnWork = makeEventHandler<TWorkEvent>(onWork, &MyOnWorkHandler); TIdSSLIOHandlerSocketOpenSSL *SSL = new TIdSSLIOHandlerSocketOpenSSL(http); SSL->SSLOptions->SSLVersions = TIdSSLVersions() << sslvTLSv1 << sslvTLSv1_1 << sslvTLSv1_2; http->IOHandler = SSL; http->ReadTimeout = 10000; UTF8String s = http->Get(url); result = new char[s.Length()+1]; memcpy(result, s.c_str(), s.Length()+1); } __finally { delete http; } } catch (...) { return NULL; } return result; } void freedata(char *data) { delete[] data; } And then you C++Builder 6 code can use it like this: #include "mydll.h" #pragma comment(lib, "mydll.lib") // or add the .lib file to your project void OnWorkBegin(OnWorkMode AWorkMode, __int64 AWorkCountMax) { //... } void OnWorkEnd(OnWorkMode AWorkMode) { //... } void OnWork(OnWorkMode AWorkMode, __int64 AWorkCount) { //... } char *data = getdata("url", &OnWorkBegin, &OnWorkEnd, &OnWork); if (data) { // ... freedata(data); } Yes, because System::String is an alias for System::UnicodeString in CB10.3, but is an alias for System::AnsiString in BCB6. Thus, you were indeed trying to pass a wchar_t* pointer to strcpy() rather than a char* pointer.
  9. Fr0sT.Brutal

    SQL date problem

    Good luck running on US machines
  10. FPiette

    Reinstalling Delphi 10.4 after PC Crashed

    Did you reinstalled the same Delphi version that you had before and for which you have a license key? By the way, you should have a backup of your system and restore that backup. That way all your software would be still installed and registered. Now, once your system is up and running again with all important and costly software reinstalled, you'll start to backup it regularly. I suggest you use a tool like Macrium Reflect to create images and rescue disk. Of course you need [removable] disk with same capacity.
  11. mvanrijnen

    SQL date problem

    FDQuery2.SQL.Add('Select * from Projects'); FDQuery2.SQL.Add('WHERE MyDateTime>=:MyDateFrom'); FDQuery2.SQL.Add(' AND MyDateTime<:MyDateTill'); FDQuery2.SQL.Add('ORDER BY MyDateTime'); FDQuery2.Params.ParamByName('MyDateFrom').AsDate := StrToDate('03/10/2021')); FDQuery2.Params.ParamByName('MyDateTill').AsDate := IncDay(StrToDate('03/10/2021')); FDQuery2.Open; please keep forum in english.
  12. Carlo Barazzetta

    Delphi compatibility with Windows 11?

    At the moment I've resolved in this way the bad painting of DbGrid: procedure TForm1.DbGridDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var LDbGrid: TDbGrid; begin LDbGrid := Sender as TDbGrid; //Resolve bad painting of selected cell in Windows 11 if not StyleServices.Enabled or (StyleServices.IsSystemStyle) then begin if ((gdSelected in State) and (gdFocused in State)) or ((gdSelected in State) and (dgRowSelect in LDbGrid.Options) and LDbGrid.Focused) then LDbGrid.Canvas.Brush.Color := clHighlight; LDbGrid.DefaultDrawColumnCell(Rect, DataCol, Column, State); end; end;
×