Jump to content

NamoRamana

Members
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

2 Neutral

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio
  1. Was connecting to SQL server 14, creating FDConnection at run-time in a thread. Thread was running 3 queries on the same FDConnection. The program was fine in dev, but was getting this error in Prod. Following steps fixed it: - Prod machine had only default sql server driver (10.xx, I guess) that came with a new PC. Downloaded the ODBC 17 driver (and redistribution files, if needed) mentioned elsewhere. - Added following code: cnMain.DriverName := 'MSSQL'; cnMain.Params.Add('Server=' + server); cnMain.Params.Add('Database=' + db); cnMain.Params.Add('User_name=' + username); cnMain.Params.Add('Password=' + pwd); cnMain.Params.Add('MARS=Yes'); cnMain.Params.Add('OSAuthent=No'); - Even with the new driver(ODBC 17), if I remove MARS, I get the error. The FireDAC documentation says, MARS=Yes by default, but somehow it didn't work in my case. Hope someone find it useful. Thanks.
  2. NamoRamana

    WinRT API Resources

    Thank you for your inputs, @David Heffernan and @aehimself.
  3. NamoRamana

    WinRT API Resources

    Yes, I can compile our COM DLLs without UWP. I really don't have to use UWP. The reason I was exploring other options is that sometimes our components, when installed in COM+ servers, fail to perform well.. sometimes, admin has to kill dllhost on server. So I was wondering if UWP APIs can help me converting those COM components so that I don't have to rely on installing them in COM+ servers.
  4. NamoRamana

    WinRT API Resources

    Ok then..any pointers on UWP ? Can I "modernize" existing COM DLLs using UWP APIs?
  5. NamoRamana

    WinRT API Resources

    Looking at "modernize" videos, it appears that Emb is gently advocating for adoption of more of Windows 10 related changes. In this regards, I was looking at WinRT related programming in Delphi Rio. Apart from few handful components, there is not much information on how to go about utilizing WinRT APIs. As I understood WinRT is adopting positives from COM and .Net architecture.. In a layman programmer's term, I was wondering if one would to "modernize" his existing COM DLLs using WinRT APIs, where to start? Its hard to learn and adopt WinRT programming just from the bunch of header .pas files.
  6. We use MonetStr.pas library from http://www.scalabium.com/smcmtbl.htm. Simply download the zip.. Use only MoneyStr.pas from it. And call GetMoneyStr(AValue, AExpand, ALanguage, ACurrency, ACharCase);
  7. NamoRamana

    TCP File Server

    Hi, Can a TCP File Server written using TWSocketServer be effective for serving hundreds of clients? Typically, when a client connects to a TCP server, the connection lasts for bit long time and during that time, more than 100+ files, each of few MB, are served. Since ICS TCP server component is asynchronous and non-blocking, I was wondering, if any time-consuming operation on server can be implemented without threads. Any example would be appreciated.
  8. NamoRamana

    Delphi 10.3.2 - IdObjs not found

    Original code was written in Delphi 2006.. But I think, I found the solution (untested). Somewhere Remy B. wrote that IdObjs and IdSys(??!!) has been obsolete. So the changes I made to above code were like: - Removed IdObjs from "interface uses" - Derived TSyncContext from TIdSeverContext (instead of TIdContext) - And changed the constructor signature to use TIdContextThreadList interface uses IdContext, Classes, SysUtils, IdCustomTCPServer, StreamUtils, IdTCPConnection, IdYarn, IdComponent; //IdObjs, type TRequestType = (rtNone, rtGetFileList, rtGetFile, rtGetMasterHash, rtDisconnect); TResponseType = (rstNone, rstFile, rstString, rstStringList); TGetMasterHash = procedure (var AHash : string) of object; TGetFileList = procedure (var AFileList : TStrings) of object; TGetFile = procedure (const AFilename : string; var AStream : TStream) of object; TBytesSent = procedure (AByteCount : integer) of object; TSyncContext = class(TIdServerContext) private FOnGetMasterHash: TGetMasterHash; FOnGetFileList: TGetFileList; FOnGetFile: TGetFile; FOnBytesSent: TBytesSent; FBytesSentTotal : integer; protected procedure WriteResponseHeader(AResponseType : TResponseType; ASize : Int64); function ReadRequestHeader : TRequestType; procedure DoGetMasterHash; virtual; procedure DoGetFileList; virtual; procedure DoGetFile(const AFilename : string); virtual; procedure DoBytesSent(AByteCount : integer); virtual; procedure DoWork(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Int64); procedure DoWorkBegin(ASender: TObject; AWorkMode: TWorkMode; AWorkCountMax: Int64); public //constructor Create(AConnection: TIdTCPConnection; AYarn: TIdYarn; //AList: TIdThreadList = nil); override; constructor Create(AConnection: TIdTCPConnection; AYarn: TIdYarn; AList: TIdContextThreadList = nil); override;
  9. NamoRamana

    Delphi 10.3.2 - IdObjs not found

    Trying to recompile old code in Delphi 10.3.2 and getting error: 'IdObjs not found'. Also code insight shows red line under TIdThreadList. Does Delphi Rio (10.3.2) missing any indy libraries? Any indy libraries merged/renamed in later delphi versions? interface uses IdContext, Classes, SysUtils, IdCustomTCPServer, StreamUtils, IdTCPConnection, IdYarn, IdObjs, IdComponent; type TRequestType = (rtNone, rtGetFileList, rtGetFile, rtGetMasterHash, rtDisconnect); TResponseType = (rstNone, rstFile, rstString, rstStringList); TGetMasterHash = procedure (var AHash : string) of object; TGetFileList = procedure (var AFileList : TStrings) of object; TGetFile = procedure (const AFilename : string; var AStream : TStream) of object; TBytesSent = procedure (AByteCount : integer) of object; TSyncContext = class(TIdContext) private FOnGetMasterHash: TGetMasterHash; FOnGetFileList: TGetFileList; FOnGetFile: TGetFile; FOnBytesSent: TBytesSent; FBytesSentTotal : integer; protected procedure WriteResponseHeader(AResponseType : TResponseType; ASize : Int64); function ReadRequestHeader : TRequestType; procedure DoGetMasterHash; virtual; procedure DoGetFileList; virtual; procedure DoGetFile(const AFilename : string); virtual; procedure DoBytesSent(AByteCount : integer); virtual; procedure DoWork(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Integer); procedure DoWorkBegin(ASender: TObject; AWorkMode: TWorkMode; AWorkCountMax: Integer); public constructor Create(AConnection: TIdTCPConnection; AYarn: TIdYarn; AList: TIdThreadList = nil); override;
  10. NamoRamana

    Interbase - unable to start service

    When I try to start Interbase db as windows service, it throws and error: Unable to start server: unknown error. However, when I uncheck "Run as.. Windows Service", it does run in as system tray application. I have local admin priviledges on Win10 machine. Have Delphi Rio 10.3.1.
  11. NamoRamana

    COM server to MARS

    Newbie here.. We have a lot of COM+ server components ( > 30 COM dlls developed in Delphi 2006) in the present system. We are evaluating to convert them in Delphi Rio based some REST server, preferably keeping the endpoint signatures the same (to make minimum changes in a huge delphi client application). It will be a huge undertaking, apart from unicode etc related conversion (64-bit conversion will be the next step; after successful 32bit upgrade). I was wondering if MARS can ease this server migration? - in MARS, can I install multiple resources under the same server ? Idea here is that, each com server dll will act as own resource and its public methods will be the endpoints. For the better code management, is it possible to keep each resource code in its separate delphi project? how complex will be the installation of the REST server and these multiple resources, if we host them in IIS? - in current COM servers, Many of the method calls make heavy use of OleVarients as input and output paramas. Is there anything in MARS/REST that can keep those method signature same ? - in current COM env, we see some heavily used components slow down the end-user response a lot (sometimes, we have to reboot the host server). Do you think, MARS based REST service can handle a lots requests to a resource(I don't have request numbers)? Sorry for the lot of heavy questions. Your response/strategy/recommendation to tackle this upgrade will be helpful. Thank you :).
×