Your question is not entirely clear but you appear to be attempting to use Richtx32.ocx with VB6 on both Windows 7 and Windows 10 and are having (undisclosed) problems doing that.
Firstly, you don't "embed" any "function" when you compile your application, any controls or other components used must be included in the installation package or already be installed on the target machine. Historically (as in 20+ years ago) all of the components were included with Windows. That is not necessarily the case these days.
Make sure you have the latest version of Service Pack 6 for Visual Basic installed - see
Download Microsoft Visual Basic 6.0 Service Pack 6 Security Rollup Update from Official Microsoft Download Center[
^] - all the other sources I have used in the past have now been discontinued... because VB6 (aka "Classic VB") is no longer supported.
From memory you can compile on Windows 7 and run on Windows 10 but not the other way around - I say from memory, it's been 10 years since I did any of this stuff in anger. If you get errors about missing components you can use
Sysinternals Utilities - Windows Sysinternals | Microsoft Docs[
^] to work out what is missing. Remember to ensure that all OCX / DLL are registered under SysWOW64
Which leads me to the correct solution to your problem ... Do not build new applications in VB6. It is defunct, dead, no longer supported, shuffled off this mortal coil.
Use any existing VB6 applications as a "spec" or "template" or "proof of concept" and convert them to a more modern language e.g. VB.NET or C#.
During that conversion make sure that you
replace the likes of Richtx32.ocx with the built-in UI components available in .NET - do not just do a like-for-like swap. You will gain longevity for your application and far fewer headaches.