-2

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...

computerengineer
  • 109
  • 1
  • 2
  • 8

1 Answers1

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