Jump to content

alank2

Members
  • Content Count

    115
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by alank2


  1. I am using TSslHttpCli to access a webapi that requires NTLM.  An odd thing is happening.  With their production environment, it works, but with their development environment, it doesn't.  I have tested both with curl using the --ntlm option and with curl, they both work, but with my code/ICS, only the production works.  With the development I get a "401 - Unauthorized: Access is denied due to invalid credentials." returned.  I thought it was their login in formation, but since it works with curl I have to assume there is something different in their webapi between the two environments.  Are there any settings or things I can configure in ICS to try something different?  I am setting:

     

    SslHttpCli1->ServerAuth=httpAuthNtlm;

     

    currently.

     

    I also upgraded from ICS 859 to 869 with no change in behavior.  production api still works, development api does not.


  2. That really is the question isn't it.  What I've *been doing* is using wchar_t in cppbuilder, but looking at that now, I'm wonder if that is the best approach or not.  Most of the text I work with is going to fit in 7-bit ASCII, but if wchar_t has to use surrogates to support all of Unicodes 17 planes anyway, why not just use UTF-8 which is perhaps more efficient as well anyway?

     

    I found this site which is certainly pro UTF-8:

    http://utf8everywhere.org/

     

    My question is, for modern cppbuilder development, is it better to use wchar_t or go back to char and assume it is UTF-8?  Both have the issue of variable code points possibly being one character anyway.  If so, then are the conversions to and from the UnicodeString's that VCL/FMX uses worth dealing with, or does it make more sense to just store them in a wchar_t.  So many things have to be converted to char for the outside world anyway.

     

    I know there may not be a one thought fits all on this, so I just wanted to get everyone's opinion.


  3. There are a whole list of functions here, but it seems some are depreciated and others not:

     

    https://docwiki.embarcadero.com/RADStudio/Alexandria/en/UTF-8_Conversion_Routines

     

    Many VCL/FMX properties use UnicodeString, so when working with them, if you want to convert to UTF-8 and back, what do you use?

     

    One is UTF8ToUnicodeString, but I don't see its reverse which I would have expected to possibly be UnicodeStringToUTF8 ?


  4. Thanks - after failing and returning from the succeeded function, EAX is 80040265

     

    https://www.remosoftware.com/info/how-to-fix-80040265-error-in-windows-media-player

     

    I also found this page:

     

    https://docwiki.embarcadero.com/Libraries/Alexandria/en/FMX.Media.TMediaCodecManager

     

    It shows in windows that mp4 is a registered extension in the top table, but then below it only shows avi and wmv for windows video...


  5. I created a Delphi project to try to dig into this.  Debug dcu's are on.

     

    I trace it down to this function, but if I try to trace into it first must call the PChar and then with trace into it looks like it ends up in the windows message loop so I'm not sure how to find the RenderFile method to see what is going on there.

     

    image.thumb.png.cc3b83e1e1d7b0fa82664e70afb84d14.png

     

    Some more searching and I found Winapi.DirectShow9.pas which contains information about RenderFile

     

    image.thumb.png.db88a426e436f559622ec896f000d1b7.png

     

    I tried to set a breakpoint on it, but it doesn't stop.

     

    Is there a way I can find out the HRESULT it is returning?  It looks like they are listed here:

    https://docs.microsoft.com/en-us/windows/win32/api/strmif/nf-strmif-igraphbuilder-renderfile

     

    Could AddSourceFilter have something to do with solving this?


  6. Hi Remy,

     

    10.3, Windows 10

     

    image.thumb.png.3c36048e8bf0993119fecef6873c76f1.png

     

    It plays fine when double clicked and I also tried the Ocean.mp4 from the Embarcadero VideoPlayback sample.  I even tried compiling the sample.

     

    The artifacts were when playing the AVI (the only file that would play), they looked like a failing video signal with part of the image updated, etc.  I could try another AVI to see if it plays properly, but I really want to get the MP4 playing if that is a possibility.

     

    I tried what I saw you suggest in that stackoverflow post (#include <FMX.Media.Win.hpp>), but it fails with a ton of errors and won't compile if this header is included.

     

    I appreciate the help!


  7. I get an error when I try to use a MP4 for the TMediaPlayer.  Even the VideoPlayback sample will not work.

     

    I did try to play an AVI and it doesn't error, but it doesn't play correctly either with a lot of visual artifacts.

     

    Has anyone run into this before?

     

    I found this:

    https://stackoverflow.com/questions/64844414/register-new-media-codec-in-fmx-media-player-in-c-builder

    But when I try to #include <FMX.Media.Win.hpp>, I get a ton of errors:

    [bcc32c Error] Winapi.DirectShow9.hpp(237): use of undeclared identifier 'IDirectShowStream'

    [bcc32c Error] Winapi.DirectShow9.hpp(491): no member named 'PReferenceTime' in namespace 'Winapi::Dxtypes'

    ...

     


  8. I right clicked the speed button and chose Edit Custom Style.  I replaced the background with a TRectange and set its fill to the color I want.  It works on my development system (Win10), but when I take it to a Win7 box, it does not work and the background color is not there.

     

    In the style designed it says Platform Windows 10 Desktop, but the only other option is Default.  When I select default it does not have a "SpeedButton1Style1".

     

    Any way I can set this to work on any system that runs it?


  9. I need to specify a custom header that they have a curl example for.

     

    $ curl "https://examplesite"
    -H 'Authorization: Token token=key1, btoken=key2'
    -X GET

     

    The documentation for the TNetHTTPClient says this - can I send the above "Authorization: Token token=key1, btoken=key2" as a custom header using the TNetHTTPClient component?  If so, how?

    Sending a Request with Custom Headers

    The HTTP client component and the HTTP request component both allow you to set custom headers. The custom headers that you can specify are:

    When you execute a request, the THTTPClient.Execute method of the HTTP framework combines the custom headers from the HTTP client component and the corresponding HTTP request component and adds those headers to the final request.

×