WordPress database error: [INSERT, UPDATE command denied to user '51213-2'@'10.10.20.25' for table 'wp_options']
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_transient_doing_cron', '1715239636.6021420955657958984375', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)


Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/feed-rss2.php on line 8
WPDev – Jonathan ANTOINE's thoughts http://www.jonathanantoine.com Yet another blog about... Sat, 25 Jul 2015 10:12:26 +0000 en-US hourly 1 https://wordpress.org/?v=5.5.3 WinRT exceptions : how to know what the hexadecimal error code means http://www.jonathanantoine.com/2015/07/25/winrt-exceptions-how-to-know-what-the-hexadecimal-error-code-means/ http://www.jonathanantoine.com/2015/07/25/winrt-exceptions-how-to-know-what-the-hexadecimal-error-code-means/#comments Sat, 25 Jul 2015 10:11:08 +0000 http://www.jonathanantoine.com/?p=1542 When working with the WinRT SDK you somethimes get exceptions from it with only an hexadecimal code to help you understand what the error is. Often, when you look for it on Google/Bing, you end with no help and no way to fix the error. There is a way to know the associated error message !

I am talking about this kind of error messages : β€œException thrown at 0x77694598 (KernelBase.dll) in MonAppli.Windows.exe: 0x40080201: WinRT originate error (parameters: 0x80072F19, 0x00000067, 0x0519EE60).” I looked for every hexadecomal code without success.
Excception

To get the message associated with this error, follow this procedure :

  • Activat the native debugger : in the properties of your project, is at the end of the debug tab.
  • Launch your app with the debugger attached and produced the exception.
  • Copy the third hexadecimal code in the exception Windows (0x0519EE60 here).
  • Click on Break.
  • Open the “Memory 1” Windows. It’s only available in Debug mode in this menu : “Debug > Windows > Memory > Memory 1”
  • Paste the value in the adress text box and press the enter key
  • The description is available at the right πŸ™‚

exception2

]]>
http://www.jonathanantoine.com/2015/07/25/winrt-exceptions-how-to-know-what-the-hexadecimal-error-code-means/feed/ 1
Windows Phone : localize your App name http://www.jonathanantoine.com/2013/12/27/windows-phone-localize-your-app-name/ http://www.jonathanantoine.com/2013/12/27/windows-phone-localize-your-app-name/#comments Fri, 27 Dec 2013 17:27:10 +0000 http://www.jonathanantoine.com/?p=1522 When you build a Windows Phone App, you for sure take some time to translate it in several language. By default there is no easy way to translate the app name but you can do it. Here is a quick “how-to” !

  1. Download this project and add it to your solution : http://code.msdn.microsoft.com/wpapps/Language-Neutral-Resource-5894846e.
  2. Edit the string table in the AppResLib.rc file to set your app name, etc.
  3. Build this project and copy the resulting dll in your WP project. This will be the default values (neutral language)
  4. Change the values in the AppResLib.rc file for a specific language (for example french) and build again the project.
  5. Rename the resulting dll to AppResLib.dll.040c.mui and copy it at the root of the WP project, next to the dll. The “04OC” is specific to “French” and should be set to the value matching the target language. A full list is here : http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx
  6. Do it again for as much language you want
  7. Select all the *.mui files and the AppResLib.dll file and set their build type to content in the properties Windows.
  8. Update your WMAppManifest.xml file and set the app name to this value : @AppResLib.dll,-100 . The value will then be taken for your file, depending of the user language, at the offset 100 in the string table.

reslLib

manifest

Not really obvious but this works fine πŸ™‚

If you want to see this feature in action, it will soon be available in our last app “Say it With Flowers” !

PS: the whole procedure is describe in depth on MSDN but I am sure you love this recap πŸ™‚

PS2: the localized app name won’t be displayed on the Store page because of a bug in the Store : http://blog.webrox.fr/?p=61

]]>
http://www.jonathanantoine.com/2013/12/27/windows-phone-localize-your-app-name/feed/ 2
WP Toolkit : Adding a item in the SelectedItems collection of a LongListMultiSelector actually adds 2… http://www.jonathanantoine.com/2013/04/18/wp-toolkit-adding-a-item-in-the-selecteditems-collection-of-a-longlistmultiselector-actually-adds-2/ http://www.jonathanantoine.com/2013/04/18/wp-toolkit-adding-a-item-in-the-selecteditems-collection-of-a-longlistmultiselector-actually-adds-2/#comments Thu, 18 Apr 2013 08:57:28 +0000 http://www.jonathanantoine.com/?p=1392 A quick blog post about a bug I encountered today with the LongListMultiSelector : adding 2 items in its SelectedItem property actually adds 2 items (twice the same) in the SelectedItem collection.

This is quite boring because it also raises the SelectionChanged event twice and can mess up your business logic.

Let’s see how to fix this temporary (I hope!) issue :

The problem is that the LongListMultiSelector listen to the changes(add/remove/replace/clear) in it’s SelectedItem collection so we can’t use it directly.

The solution is to ‘fake’ an user selection using the LongListMultiSelectorItem which is the container of each item.

So instead of writing this code :
[csharp]
foreach (var item in LongListMultiSelector.ItemsSource)
{
//LongListMultiSelector.SelectedItems.Add(item);
}
[/csharp]

you have to write this code :
[csharp]
foreach (var item in LongListMultiSelector.ItemsSource)
{
var container = LongListMultiSelector.ContainerFromItem(item)
as LongListMultiSelectorItem;
if (container != null) container.IsSelected = true;
}
[/csharp]

]]>
http://www.jonathanantoine.com/2013/04/18/wp-toolkit-adding-a-item-in-the-selecteditems-collection-of-a-longlistmultiselector-actually-adds-2/feed/ 3
[WPDev] CustomMessageBox + OnNavigatedTo + Navigate = Exception ! http://www.jonathanantoine.com/2013/04/08/wpdev-custommessagebox-onnavigatedto-navigate-exception/ Mon, 08 Apr 2013 09:27:01 +0000 http://www.jonathanantoine.com/?p=1381 CustomMessageBoxThe Windows Phone Toolkit is really useful.

Yesterday, while I was updating my ConsoTracker app, I met a strange bug using the CustomMessageBox : it was raising a nullReference exception.

Let’s see what was the issue and how to “fix” it.

What I was trying to do was this simple scenario :

  1. Ask the use if he wants to review my app in the OnNavigatedTo event using a CustomMessageBox
  2. If he answers ‘no’, navigate to another page.
  3. If it answers ‘yes’, show the marketplace review task.

As I like playing with tasks, I was using this code :
[csharp]
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
var mBox = new CustomMessageBox
{
Title = "Do you want to… ",
Message = " … click on yes ?",
LeftButtonContent = "Yes",
RightButtonContent = "No"
};
var result = await ShowAsync(mBox);
NavigationService.Navigate(new Uri("/OtherPage.xaml", UriKind.RelativeOrAbsolute));
}

public static async Task<CustomMessageBoxResult> ShowAsync(CustomMessageBox box)
{
var taskCompletionSource = new TaskCompletionSource<CustomMessageBoxResult>();
box.Dismissed += (a, b) => taskCompletionSource.TrySetResult(b.Result);

try { box.Show(); }
catch (Exception exception) { taskCompletionSource.TrySetException(exception); }

return await taskCompletionSource.Task;
}
[/csharp]

This code was throwing an exception. To fix it, I downloaded the source of the Windows Phone Toolkit and I saw that at the end of the dismissal animation, it was trying to access the “Popup” object which was null : BOUM !

So… how did I fix it ? Simply by waiting for the popup to be unloaded instead of using directly the Dismissed event of the CustomMessageBox :
[csharp]
public static async Task<CustomMessageBoxResult> ShowAsync(CustomMessageBox box)
{
var taskCompletionSource = new TaskCompletionSource<CustomMessageBoxResult>();
var result = CustomMessageBoxResult.None;

//Only store the result here.
box.Dismissed += (a, b) => result = b.Result;

//Use this event to set the result.
box.Unloaded += (_, __) => taskCompletionSource.TrySetResult(result);

try { box.Show(); }
catch (Exception exception) { taskCompletionSource.TrySetException(exception); }

return await taskCompletionSource.Task;
}
[/csharp]

I hope it will save you some time too πŸ™‚

]]>