Jump to content

ertank

Members
  • Content Count

    231
  • Joined

  • Last visited

Everything posted by ertank

  1. ertank

    MyDAC : Unknown column error

    I am using UniDAC and there is TUniConnection.Options.KeepDesignConnected parameter. I expect MyDAC to have a similar parameter. I didn't understand why this is a problem since you have a single database and necessary columns added in it.
  2. ertank

    ICS V9.1 Highlights

    Is this a different server than http://svn.overbyte.be:8443/svn/
  3. ertank

    MyDAC : Unknown column error

    I don't use MySQL. But, I would use same letter case as the table column name. I would double check that design-time and run-time actually uses the same server, database, table Edit: Reading your problem again, it feels you added a column in TMyTable but not in your database table.
  4. I am not sure if below approach is suitable for you. type FieldList = TArray<TField>; PFieldList = ^FieldList; procedure FindAllFields(DataSet: TDataSet; Fields: PFieldList; const FieldNames: TArray<string>; const RaiseExceptionForMissingFields: Boolean = True); var I: Integer; begin Assert(Length(Fields^) = Length(FieldNames), 'Fields count <> FieldNames count!'); for I := Low(Fields^) to High(Fields^) do begin Fields^[I] := DataSet.FindField(FieldNames[I]); if (Fields^[I] = nil) and RaiseExceptionForMissingFields then raise Exception.Create('Missing field dataset "' + FieldNames[I] + '"'); end; end; procedure TForm1.Button1Click(Sender: TObject); var LFieldList: FieldList; begin SetLength(LFieldList, 4); // Below will raise an exception because of the last empty field name and RaiseExceptionForMissingFields=True FindAllFields(VirtualTable1, @LFieldList, ['a', 'b', 'c', '']); //... end; This would require you to remember Indexes for your fieldnames. Not very convenient if you are to have a lot of fields and do different calculations or such with them.
  5. Check out MadExcept. It can check for frozen main thread and auto restart.
  6. license.embarcadero.com gives error in the installer.
  7. For me license servers are still down.
  8. ertank

    SAX parser

    I own a commercial license and used SAX parsing in OXml. You might want to check out https://github.com/ashumkin/OXML This is an old version. Though license allows you to use it in commercial applications under certain conditions and it might work for you.
  9. As per documentation TStringHelper.ToUpper uses locale specific case conversion. As per documentation UpperCase or SameText uses 7-bit ASCII conversion. Only letters between 'a' and 'z' are converted to uppercase. Since you are using ToUpper, uppercase of 'This' in Turkish locale is 'THİS' (upper case I letter with dot at top). Moreover, lower case for 'THIS' in Turkish locale is 'thıs' (small caps i letter without dot at top). I cannot remember off my mind right now but there are other languages where some characters small and upper cases do not follow ASCII type of conversion.
  10. ertank

    Install failed older sdk

    Hello, I am using Delphi 10.4.2 I have a project that I developed about three years ago for a specific Android 5.1.1 device built in China. I do not remember what Delphi version I was using at that development time three years ago. Today, I need to do some modifications to that project. There is no problem compiling. When I try to debug run, I get error "Failure INSTALL_FAILED_OLDER_SDK" at deployment phase. When I check for min supported Android version is listed as Android 5.1 here https://docwiki.embarcadero.com/RADStudio/Sydney/en/Android_Devices_Supported_for_Application_Development I do not know if anything changed for Delphi 10.4.2 as I could not find a specific documentation about it. Is there anything I can do to fix this problem? Thanks & Regards, Ertan
  11. ertank

    Install failed older sdk

    Hi, I did find a solution but I cannot remember what was it now. You can try updating libraries to defaults
  12. Hello, I am using Delphi 11.3. Using the stock WSDL Importer tool and https://pb.diyalogo.com.tr/PostboxService.svc URL produce below remarks in the unit which does not compile // Cannot unwrap: // - More than one strictly out element was found I would like to learn if it is possible to generate unit usable with Delphi. If yes, how can I do that? Any help is appreciated. Thanks & Regards, Ertan
  13. ertank

    Help needed for importing a WSDL

    Using suggested modification and unit compiles. I will see if it works once I receive working username and password. Thank you.
  14. Hello, I need to convert a C# project into Delphi. This project is using a C++ DLL and passing a struct named Members to the DLL. I could not make same size record in Delphi. There is a 4 byte difference and Delphi is smaller. The Members struct has more than 80 string variables, one enum type and three other structs. These three other struct sizes are exactly match to Delphi conversions. They all have StructLayout as Sequential defined. But, Members struct has no StructLayout at all. Actually, it was defined as Sequential before but now that code is remarked. There are only MarshalAs for strings like below [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string StartRNo; I searched on the web and I think I should convert above to Delphi as following StartRNo: Array[0..31] of AnsiChar; This Delphi definition give me exact size for three other structs. They have only string variables. DLL function calls are CharSet.Ansi for all, but the only one using the Members struct is defined as CharSet.Unicode. If I am to use Char instead of AnsiChar on Delphi side for strings (just for the Members record), difference is a lot more like double. I am unable to figure why there is a 4 byte difference and how to make both C# Members struct and Delphi record identical. Any help is appreciated. Thanks & Regards, Ertan
  15. ertank

    C# struct to Delphi conversion help

    Even if I make it identical C# enum with Delphi enum, There is still one byte difference in total struct vs record comparison. I check even the last item offset in C# struct matches to Delphi and this last item size also matches on both C# and Delphi. It must be that C# has one byte more at the very bottom of its struct. @FPiette advise to add it at the end of Delphi record as a dummy variable and I can do that. I wonder if I absolutely need it? If I do need it, I wonder if there is another way of handling that in newer Delphi versions like a compiler directive {$MINENUMSIZE 4}? Thanks.
  16. ertank

    C# struct to Delphi conversion help

    I used x86 target on C# project and Delphi side is also 32bit application. Using your offset function revealed some differences. C# struct "Members" has following remarked offsets (Layout is indeed commented in the project code. I removed remark for testing and this didn't change total struct size) //[StructLayout(LayoutKind.Sequential)] public struct Members { public Tags ResponsedTag; // Offset 0 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string StartRNo; // Offset 4 // continues and ends as following public GrupDF02 groupDF02; public GrupDF41 groupDF41; public GrupDF6F groupDF6F; } However, Delphi record has following offsets. I intentionally didn't use packed record as I am completely unsure of the C# side. TMembers = record ResponsedTag: TTags; // Offset 0 StartRNo: Array[0..31] of AnsiChar; // Offset 1 // continues and ends as following groupDF02: TGrupDF02; groupDF41: TGrupDF41; groupDF6F: TGrupDF6F; end; Tags is an enum and takes up 4 bytes in C# but 1 byte in Delphi. That explains 3 bytes difference. I'm not sure about the reason of this difference. These last three item's sizes on C# and Delphi are the same. When I compare the very last item "groupDF6F" offsets, the difference is still 3 bytes. So, I could not find a reason for total difference of 4 bytes. I don't know how I can modify Delphi to match C# just for this enum difference. I could not find where this remaining 1 byte difference is coming from.
  17. ertank

    Problem with JSON library "SuperObjects"

    I do not know about Superobjects but Delphi standard json library can do following uses System.JSON, System.Generics.Collections; procedure TForm1.Button1Click(Sender: TObject); const JsonText = '{ "splash.annually": "normal" }'; var Json: TJSONValue; begin Json := TJSONObject.ParseJSONValue(JsonText, False, False); if Json <> nil then begin if Json.FindValue('["splash.annually"]') <> nil then begin ShowMessage(Json.FindValue('["splash.annually"]').AsType<string>); end; Json.Free(); end; end;
  18. ertank

    Importing WSDL

    You should report this error. Delphi 11.3 also has it.
  19. It does not work for me. I've very likely bitten by this bug numerous times but I didn't know the reason until now.
  20. Hello, I am trying to figure out a way to use two Veriban SOAP web services in a single project. These web services both are named same as IIntegrationService in imported WSDL units. http://efaturatransfertest.veriban.com.tr/IntegrationService.svc?wsdl http://earsivtransfertest.veriban.com.tr/IntegrationService.svc?wsdl For anyone interested, Veriban publicly make it available test user and password. Same for both webservices above. Username: TESTER@VRBN Password: Vtest*2020* If I build two separate VCL applications each using one of these services WSDL imported unit, everything is fine and works. But, If I rename WSDL imported units like VeribanEInvoiceIntegrationService.pas and VeribanEArchiveInvoiceIntegrationService.pas and put these files in uses section of a single VCL project. Login method runs fine for both of them. But VeribanEArchiveInvoiceIntegrationService.pas one gives me access violation for below method. My final goal is to use these services both in a single Windows Service project which currently gets same AV exception. It did not help to have wrapper classes for each service in a separate unit. http://earsivtransfertest.veriban.com.tr/IntegrationService.svc method GetSalesInvoiceUUIDListWithCustomerWithDate I make sure that I refer to each unit interface when casting THTTPRIO as below var RIO: THTTPRIO; WS: VeribanEArchiveInvoiceIntegrationService.IIntegrationService; LResponse: VeribanEArchiveInvoiceIntegrationService.ArrayOfString; begin ... WS := (RIO as VeribanEArchiveInvoiceIntegrationService.IIntegrationService); ... LResponse := WS.GetSalesInvoiceUUIDListWithCustomerWithDate(FSessionCode, LStartDate, LEndDate); // AV here My questions are: - Is there anything that I am missing which leads to AV? - Is it possible to use both of these services in a single project? Thanks & Regards, Ertan P.S. I attached AV call stack just in case.
  21. Yes, I now see that both web services are defined using the same GUID by WSDL importer. Their methods are different, things they do are different but both has identical name and GUIDs. After manually changing one of them to use a different GUID everything worked just fine in a single project. Thank you. P.S. I already build two separate DLLs and released them. They are working OK. But this GUID is something I will check for the future.
  22. I do not see that GUID information in WSDL or in imported unit. Do you know where can I find it?
  23. Hello, I am using v8.71 of ICS. There is a device connecting to my application and sending some data. So, I basically wait for a connection and communicate with that device both ways. Occationally, TWSocketClient.OnDataAvailable event triggers even if there is no data ( aka GetRcvdCount = -1) I just wonder if this is normal and what might be possible reasons? Thanks & Regards, Ertan
  24. Hello, There are some chain requests triggered from clients. Some requests among them takes time processing on the server side. I should send a response to client fast. Server side operations are not relevant to the response. Since, MARS is handling each request in a separate thread, I also created a custom thread for this time consuming operation and process it. My problem is, database context is removed as soon as response is sent and its thread is destroyed. Any further database operations from that point in my custom thread results in access violation. Is there a way that I can get a database connection from MARS database pool for my own custom threads independent of requests? Thanks & Regards, Ertan
  25. Hello, I have a company that would like to send me some data over a webhook. They want me to provide them access information for an x-api-key header. I know that MARS uses Authorization header for secure access. I am not sure if it is possible to support x-api-key header for a specific use case. Any help is appreciated. Thanks & Regards, Ertan
×