Closed zurrutik closed 5 years ago
Sorry, it is actually said in the video that when you change the idl instead of modifying the original .h/.cpp a new .h/.cpp is created inside Generated Files/Sources folder and it is your responsibility to merge with the original .h/.cpp
My apologies!!
Just came here to say you're not alone 🙂. At 32:55 I didn't hear anything about needing to manually copy & paste code out of Generated Files\Sources. Booo.
Hi,
I have Visual Studio Community 2017 Preview(2) with the cppwinrt extension and I am able to run the PhotoEditor without a problem, but according to https://www.youtube.com/watch?v=nOFNc2uTmGs if I change the .idl( e.g. by adding a new property in Photo.idl ) when I recompile I should be able to see that property declaration/definition in Photo.h and Photo.cpp but unfortunately nothing is done and therefore I get a compilation error
projects\cppwinrt-photo-editor-sample\photoeditor\generated files\winrt\photoeditor.h(690): error C2039: 'MyProperty': is not a member of 'winrt::PhotoEditor::implementation::Photo' (compiling source file Photo.cpp)
Photo.idl
namespace PhotoEditor { ….. Single Intensity; Int32 MyProperty; <- This is what I added
What is the point of declaring the property in the .idl file if it doesnt generate the necessary code in the .h/.cpp?? I would've expected the build to add the following:
Photo.h
int32_t MyProperty(); void MyProperty(int32_t value);
Photo.cpp
int32_t Photo::MyProperty() { throw hresult_not_implemented(); }
void Photo::MyProperty(int32_t / value /) { throw hresult_not_implemented(); }