How to get the latest and complete com component code for windows?

  c++, gcc, go, mingw, visual-c++

I hope to use windows COM components in GO, such as IFileDialog, IFileSaveDialog, IFileOpenDialog.

I have tried the following ways:

  1. Use the vc++ compiler to compile the code and generate the .lib static library file. However, because GO uses the GCC compiler as a call bridge for the C language, and the .lib file generated by the VC++ compiler, GCC cannot be linked. fail.

  2. Use the vc++ compiler to generate .dll files, and dynamically load the .dll files through the loadLibray and getProcAddress functions in windows.h. fail. The syscall.LoadLibray and syscall.GetProcAddress functions of the GO language have the same result. They run well for the .dll files generated by the GCC compiler, but they all fail for the .dll files generated by the VC++ compiler.

  3. Use the GCC compiler to compile the code, because MinGW lacks the latest Windows com SDK, such as IID_IFileOpenDialog. fail.

Source: Windows Questions C++