Need cloud storage with c++ and OSX

I'm using Rad Studio 10.2.3, c++, FMXCloud 3.3.3.1
The delphi demos work after changing some event handler assignments
Pure delphi code works.
c++ with windows works.

I'm trying to find a workaround for problems using c++ code with OSX.
I made some changes to the source to stop the "can't find wininet.lib" linker error
FMX.TMSCloudBase.pas
{$IFDEF MSWINDOWS}
{$HPPEMIT ''}
{$HPPEMIT '#pragma link "wininet.lib"'}
{$HPPEMIT ''}
{$ENDIF}

FMX.TMSCloudFlickr.pas
{$IFDEF MSWINDOWS}
uses
  WinInet;
{$ENDIF}

I created a delphi form with the TTMSFMXCloudFlickr object
From my c++ code, I call a delphi function:
function TForm20.connect : Boolean;
var
  check : Boolean;
begin
  TMSFMXCloudFlickr1.App.Key := FlickrAppkey;
  TMSFMXCloudFlickr1.App.Secret := FlickrAppSecret;

  TMSFMXCloudFlickr1.PersistTokens.Key := ExtractFilePath(ParamStr(0)) + 'flickr.ini';
  TMSFMXCloudFlickr1.PersistTokens.Section := 'tokens';
  TMSFMXCloudFlickr1.LoadTokens;

  check := TMSFMXCloudFlickr1.TestTokens;
  if not check then
  begin
    TMSFMXCloudFlickr1.RefreshAccess;
    TMSFMXCloudFlickr1.DoAuth;
  end;

  Result := check
end;

It links and deploys to OSX with the above changes but crashes at TMSFMXCloudFlickr1.TestTokens; with an access address 0 error.
I have a similar problem if I try to do everything in c++, and with picasa.  I enabled detailed logging but don't see a log file in my documents directory.
I need some kind of cloud storage working with all platforms.  Any suggestions?

Hi,


I have not been able to reproduce this issue.

Can you please provide the following information so I can further investigate this?

- Does the issue also occur with the FlickrDemo application?
- Does the issue only occur on OSX or also on Windows?
- Which version of OSX are you using?
- Did you make sure to set Logging to True and LogLevel to llDetail to enable logging? And if so, does logging work on Windows?

I created a small project and posted at https://canzonatechnologies.com/Project19.zip

You'll need to make any necessary changes to avoid the "can't find wininet.lib" linker error.   My changes are described above.

It works on win32, crashes on osx Sierra

Readme.txt has version information. Add your own APPIDS.INC with flicker login.  Thanks for your help.

I think there must be something wrong with your compiler defines or target.

There is only a reference to wininet.lib when the WIN32 define is set. So, it would appear there is something with your compiler settings when compiling for macOS.

In my previous post Picasa OSX wininet.lib linker error

you responded "We have seen this issue and have fixed this. The next update will address this."

Is it fixed in release 3.3.3.1?

I see this fix will be in v3.3.3.2. We'll look to release this next week.

Thank you Bruno.  I'll retest my posted c++ code with the new version.

The update for TMS FMX Cloud Pack where this issue was fixed has been released today.

I just installed 3.3.4.0.  The wininet.lib linker error is fixed, but it still crashes at TestTokens in my c++ program running on osx.   It runs on win32.  Deployed libraries are:

bpldbrtl250.dylib
bplDbxCommonDriver250.dylib
bpldsnap250.dylib
bplfmx250.dylib
bplIndyCore250.dylib
bplIndyProtocols250.dylib
bplIndySystem250.dylib
bplrtl250.dylib
bplTMSFMXCloudPackPkgDXE11.dylib
bplTMSFMXPackPkgDXE11.dylib
bplxmlrtl250.dylib
libcgsqlite3.dylib
libcgunwind.1.0.dylib

I created a small c++ project and posted at https://canzonatechnologies.com/Project19.zip

We are currently investigating this issue and will report back as soon as possible.

I'm running out of ideas.  I tried with and without runtime libraries, and added #pragma link "TMSFMXCloudPackPkgDXE11.a"  It always crashes at TMSFMXCloudFlickr1.TestTokens
Has anyone been able to access any cloud site with c++?

Although we have now reproduced this issue we have been unable to find a solution at this time.
It's possible that the reason for the crash is a FireMonkey framework issue.

We'll have to further investigate this as soon as we have been able to allocate sufficient development time.

I created a project like the project 19 I posted earlier, but instead of using the libraries, I included all the cloud .pas files for easier tracing.  It crashes in FMX.TMSCloudCustomFlickr.pas at line 1531 sigbase := 'GET&' + UrlEncode(url) + '&'

    + string(HTTPEncode(AnsiString(encodeParams(RequestParams, '&', false))));
The call to UrlEncode goes to UrlEncodeRFC3986 and crashes there.

I'm making progress.  If I need help from Embarcadero with some Delphi issues, do I have your permission to send them my project which includes some of your source code?

Can you please indicate exactly which part(s) of the source code you would like to include?
Is the error reproducible without using TMS components?

The problem seems to be in FMX.TMSCloudCustomFlickr.pas  I would only send Embarcadero that file, files in the "uses" section, or otherwise needed to support the c++ source code:
    TMSFMXCloudFlickr1->App->Key = FlickrAppkey;
    TMSFMXCloudFlickr1->App->Secret = FlickrAppSecret;

    #if defined(TARGET_OS_MAC) || defined(_Windows)
        // windows and mac use a shared documents folder requiring a subfolder
        UnicodeString us = IncludeTrailingPathDelimiter(System::Ioutils::TPath::GetDocumentsPath());
    #else
        // ios and android setup special document folders for each app
        UnicodeString us = IncludeTrailingPathDelimiter(System::Ioutils::TPath::GetDocumentsPath());
    #endif
    us += "flickr.ini";
    TMSFMXCloudFlickr1->PersistTokens->Key = us;
    TMSFMXCloudFlickr1->PersistTokens->Section = "tokens";
    TMSFMXCloudFlickr1->LoadTokens();

    int acc = TMSFMXCloudFlickr1->TestTokens();

    if (!acc)
    {
        TMSFMXCloudFlickr1->RefreshAccess();
        TMSFMXCloudFlickr1->DoAuth();
    }

I don't have a complete list yet.

Can you please contact us by email for follow-up?

I replied to the automated email sent by the forum.  Is that the correct email to use?