Original Post
Hello, I have a problem that has BEEN DRIVING ME CRAZY for months!! And the problem has to do with using a specific win32 function but my compiler telling me that function doesn't exist even when I import the correct library. Now I know of the reasons why I should not use dev c++, but this compile error happens across the board( codeBlocks, vc++ ).
I am trying to explore(code) the windows task manager BUT like many aspects of win32 when I try to use a specific win32 function, structure or constant my compiler tells me it doesn't recognise that function/structure/constant.
I seem to run into this problem(I have correct win32 code but it will not compile because X is not recognised by the compiler) alot & I am aware that msdn displays what libraries are required (to be imported) to use X function & I import the correct library but I either get a compiler error saying "comdef.h: No such file or directory" OR "ITaskService() undeclared(first use of this function)".
What do I need to do to get my compiler to recognise a win32 function, structure or constant?
Do I need to link to the absolute path of comdef.h, for example, #import ?? Do I need to define a specific version of windows before importing windows.h, for example, #define _WIN32_WINNT 0x0502 (although I have tried this already with no success). I am using Windows 7 64 bit.
An example is trying to compile the example code from msdn for using the Windows Task Manager, I copy & paste the c++ code exactly from msdn, paste into my IDE( devc++ ) & try to compile. And I get the errors:
I am trying to explore(code) the windows task manager BUT like many aspects of win32 when I try to use a specific win32 function, structure or constant my compiler tells me it doesn't recognise that function/structure/constant.
I seem to run into this problem(I have correct win32 code but it will not compile because X is not recognised by the compiler) alot & I am aware that msdn displays what libraries are required (to be imported) to use X function & I import the correct library but I either get a compiler error saying "comdef.h: No such file or directory" OR "ITaskService() undeclared(first use of this function)".
What do I need to do to get my compiler to recognise a win32 function, structure or constant?
Do I need to link to the absolute path of comdef.h, for example, #import
An example is trying to compile the example code from msdn for using the Windows Task Manager, I copy & paste the c++ code exactly from msdn, paste into my IDE( devc++ ) & try to compile. And I get the errors:
Quote:
- "comdef.h: No such file or directory"
- "wincreddef.h: No such file or directory"
- "taskschd.h: No such file or directory"
- "ITaskService() undeclared(first use of this function)".
-.....