I have written a c++ program by using UIAutomation on windows. The libraries I have used are windows.h and Uiautomation.h. It works well. However, I want to convert the program to C program. (There is no classes). When I try to do it, I have taken an error which is error: unknown type name 'IUIAutomationElement'. Even file included libraries are enough in the cpp program, why the C version does not run? Thank you...
Asked
Active
Viewed 213 times
-2
-
1... because not all C++ code is valid C? – meowgoesthedog Dec 07 '18 at 07:38
-
@meowgoesthedog I know that.Probably you misunderstood the question or I would not ask well. – computerengineer Dec 07 '18 at 09:23
1 Answers
0
After a quick look into Microsoft doc., it is clear that IUIAutomationElement
element is a C++ class and cannot be directly used from a C program. Your own code can be plain C, but you will have to use an wrapper module in C++ that declares some extern "C"
functions. They will be callable from C and will be able to use IUIAutomationElement
.

Serge Ballesta
- 143,923
- 11
- 122
- 252