ActivateEx on Xojo 2015 - problems and solutions

I testedActivate(ExtraData)on Xojo 2015R1 Mac and Windows.Note: No Ex required after Activate on Xojo.

I first made sure the ExtraData string was UTF8.

The problem on Windows:- for strings of 3 characters or less, all characters appear garbled in the Dashboard (2 characters shown)- for strings of 4 or more ASCII characters, the first character appears garbled in the Dashboard- for strings of 4 or more accented characters, everything is garbled in the Dashboard

The problem on Mac:- in all input cases listed above, nothing is shown in the Dashboard

My solution, for Mac and Windows:

Change the input parameter of the TurboActivate/Activate MethodFROMExtraData As StringTOExtraDataIn As String

Add the following lines before the Declares:

#if TargetWin32 Dim ExtraData As WString ExtraData = ExtraDataIn #else Dim ExtraData As CString ExtraData = ExtraDataIn #endif

There may be other solutions...

We already do this in the RealBasic.rbp example:

  #if TargetWin32    Declare Function ActivateEx Lib TALibrary (ByRef options As ACTIVATE_OPTIONS_W) As Int32    Dim options As ACTIVATE_OPTIONS_W    options.nLength = 8    options.sExtraData = ExtraData  #else    Declare Function ActivateEx Lib TALibrary (ByRef options As ACTIVATE_OPTIONS) As Int32    Dim options As ACTIVATE_OPTIONS    options.nLength = 8    options.sExtraData = ExtraData  #endif  Dim ret As Int32 = ActivateEx(options)

Notice "ACTIVATE_OPTIONS_W" uses a WString, and ACTIVATE_OPTIONS uses CString.

Are you using the latest version?

Thanks for the reply,

You asked:"Are you using the latest version?"

Yes, I downloaded version 3.4.6 and I can see the code you quoted. However, my fix code is to be placed before the code you quoted. My fix affects the "ExtractData" string before it gets assigned to the options structure.

Yesterday I tested it in Xojo 2015 R1 only. A few minutes ago I tested with RealBasic 2011R3, using a freshly extracted version of the demo file (in case I had made changes); I see the same problem, and the same proposed solutions fixes it.