'_RemotableHandle' type error when trying to use ActiveX in Qt
-
We have an internal ActiveX COM control (written in C++) that I'm trying to use in the new Qt app. Note that we've successfully used it in regular C++ and also in WinForms (.NET) windows applications and it works.
I used dumpcpp to generate .h/.cpp files, which worked without any issue but the code won't compile because of missing _RemotableHandle definition. I do see a forward declaration for it though, actually its in the header file twice (but only declaration):
struct _RemotableHandle;
Spent some time on google and it looks like this is a COM type used for HWND. How do I fix this error? I don't see anyone else having this issue, maybe I'm doing something wrong?
-
"I'm using dumpcpp to generate .h/.cpp files for mstscax.dll, but in the .h file, only the declaration of the struct _RemotableHandle is present. Have you found a solution for this?"
-
"I'm using dumpcpp to generate .h/.cpp files for mstscax.dll, but in the .h file, only the declaration of the struct _RemotableHandle is present. Have you found a solution for this?"
@Gao-xiangyang
通过查看
echo '#import "mstscax.dll" named_guids' > import.cpp
cl.exe /c /nologo .\import.cpp
midl.exe .\mstscax.idl /header mstscax.h /iid mstscax_i.c
dumpcpp .\mstscax.tlbBy comparing the mstscax.idl file with the .h file generated by dumpcpp, it was found that dumpcpp has issues with handling typedefs, for example:
in .idl file
typedef [public] _RemotableHandle* wireHWND; typedef union tag__MIDL_IWinTypes_0009 { long hInproc; long hRemote; } __MIDL_IWinTypes_0009; typedef struct tag_RemotableHandle { long fContext; __MIDL_IWinTypes_0009 u; } _RemotableHandle;
dumpcpp.exe output .h file
// The struct tag_RemotableHandle is declared twice. struct tag_RemotableHandle; struct tag_RemotableHandle;