I've created a little debug console widget for my windows store app, and I want to be able to log stuff to it before its template is applied, so I am attempting to create a vector of entries logged to it and then dump them into the widget when the template
is applied. All the code-behind works fine when I store them as one long string, but that's not quite sophisticated enough, so I want a vector of entries. I can't seem to get the type signature and visibility of the associated classes correct though.
This is as few errors as I've gotten, and the error I'm currently getting is
Error 11 error C2440: 'return' : cannot convert from 'Thing::Consolel::PreinitEntry' to 'Platform::Object ^' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\collection.h 801 1 Thing
public enum class CSym {
END,
LF,
INFO,
ERR,
INVALID
};
public ref class Consolel sealed : public Windows::UI::Xaml::Controls::Control
{
public:
Consolel();
void OnApplyTemplate() override;
void RegisterDependencyProperties();
internal:
Consolel^ operator << (Platform::String^ str);
Consolel^ operator << (Platform::Object^ obj);
Consolel^ operator << (CSym sym);
Consolel^ operator << (DWORD hr);
Consolel^ operator << (double d);
Consolel^ operator << (int i);
Consolel^ operator << (unsigned int i);
Consolel^ operator << (UINT64 i);
static enum class PreinitEntryType {
SYM,
STRING
};
private:
Windows::UI::Xaml::Controls::ScrollViewer^ m_scroller;
Windows::UI::Xaml::Controls::TextBlock^ m_textBlock;
Windows::UI::Core::CoreDispatcher^ m_coreDispatcher;
void AsyncAppend(Platform::String^ str);
void AsyncAppend(CSym sym);
value class PreinitEntry {
public:
PreinitEntryType typ;
Platform::String^ str;
Thing::CSym sym;
};
Platform::Collections::Vector<PreinitEntry>^ m_preinit;
};
I then try to insert things into the vector like this (which the compiler seems okay with, but I'm still not sure it's correct):
PreinitEntry ent = { PreinitEntryType::SYM, nullptr, sym};
m_preinit->Append(ent);