A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
Hello @technoway ,
Thanks for reaching out.
Since your question touches on the licensing aspects of redistributing DLLs as well as technical approaches, I would like to offer some thoughts based on Microsoft documentation that might help guide your next steps.
1. Regarding the redistribution of richedit20.dll
From what I gather, your guess about the Office or Microsoft 365 DLL being non-redistributable seems to be correct. Generally, under Microsoft licensing terms, you are only permitted to redistribute files that are explicitly listed in the official "Distributable Code" list (historically known as the REDIST list).
I recently reviewed the latest Distributable Code list for Visual Studio 2022. You can find it online at Distributable Code Files for Visual Studio 2022 or check the Redist.txt file located in the \Licenses\1033\ folder of your Visual Studio installation. It appears that neither richedit20.dll (which is part of the Office suite) nor msftedit.dll (which is an underlying OS component) is included in that list.
According to the general guidance on Determining which DLLs to redistribute, if a file is not on the approved list, it typically cannot be shipped with your application. Trying to bundle the Office DLL might lead to licensing compliance issues, so I would suggest avoiding that route.
2. Are there better approaches for C/C++?
Your Direct2D approach is actually very sound because it is essentially doing what the modern controls do under the hood. If you are already close to finishing and performance is your top priority, you might just want to polish it up and wrap it in a reusable class.
However, if you are looking for an alternative that saves you from reinventing the wheel (handling selection, scrolling, etc.), you might want to explore the following options:
- Option A: XAML Islands and WinUI 3 If you would like a built-in solution that handles color emojis, touch, and modern interactions flawlessly, you might want to look into using a modern
RichEditBoxvia XAML Islands. This technology allows you to host WinRT XAML controls inside your classic Win32 C++ application. - Option B: Enhancing the system
msftedit.dllIf you prefer to stick with the classic Win32 control,msftedit.dll(specifically theRICHEDIT50Wclass) on recent versions of Windows does seem to have some level of support for DirectWrite color fonts. You might be able to achieve color emoji rendering by sending theEM_SETCHARFORMATmessage to specify a font capable of color (like "Segoe UI Emoji").
I hope these links provide some helpful context for your project. If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.
Thank you.