Hi,
I'm having trouble encoding .fit message fields that contain text.
I've also noticed that the C# EncodeDemo example fails for the same reason that my app fails.
Here's the C# code from EncodeDemo.cs that's raising an exception:
UserProfileMesg myUserProfile = new UserProfileMesg();
myUserProfile.SetGender(Gender.Female);
float myWeight = 63.1F;
myUserProfile.SetWeight(myWeight);
myUserProfile.SetAge(99);
myUserProfile.SetFriendlyName(Encoding.UTF8.GetBytes("TestUser"));
// +++> This last line throws an exception !!!
Here's the exception text:
System.InvalidCastException: Unable to cast object of type
'System.Byte[]' to type 'System.IConvertible'.
This problem also exists when trying to invoke the SetOpponentName() method for a 'Session' message.
I'm running MS Visual Studio 2010 with FIT SDK v9.02.
Please help.
Thanks,
skigrinder