News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Building a project with C:: B and Windows SDK

Started by White Dragon, July 26, 2010, 12:56:08 AM

Previous topic - Next topic

White Dragon

I will try to import the library functions for Windows 7.
I would simply write the code that allows me to have a progress bar in the taskbar icon through Windows SDK.
This guide explains something.
http://www.codeproject.com/Articles/80082/Windows-7-How-to-display-progress-bar-on-taskbar-i.aspx
I downloaded the Windows SDK, I installed the libraries.
I load the libraries with C::B in this way:
Project->Build Options->Search Directories->Compiler->Add->%SDK_INCLUDE_DIR%

But when I compile a Hello World test, I take this error:
..\..\..\..\..\..\Program Files\Microsoft SDKs\Windows\v7.1\Include\specstrings.h|11|error: sal.h: No such file or directory|
..\..\..\..\..\..\Program Files\Microsoft SDKs\Windows\v7.1\Include\winnt.h|851|error: #error Must define a target architecture.|
..\..\..\..\..\..\Program Files\Microsoft SDKs\Windows\v7.1\Include\winnt.h|1202|error: pasting "(" and "__drv_nop" does not give a valid preprocessing token|
..\..\..\..\..\..\Program Files\Microsoft SDKs\Windows\v7.1\Include\winnt.h|12880|error: pasting "(" and "__drv_nop" does not give a valid preprocessing token|
..\..\..\..\..\..\Program Files\Microsoft SDKs\Windows\v7.1\Include\winnt.h|13305|error: pasting "(" and "__drv_nop" does not give a valid preprocessing token|
..\..\..\..\..\..\Program Files\Microsoft SDKs\Windows\v7.1\Include\winbase.h|2936|error: pasting "(" and "__drv_nop" does not give a valid preprocessing token|
..\..\..\..\..\..\Program Files\Microsoft SDKs\Windows\v7.1\Include\winbase.h|2939|error: pasting "(" and "__drv_nop" does not give a valid preprocessing token|
..\..\..\..\..\..\Program Files\Microsoft SDKs\Windows\v7.1\Include\winbase.h|2942|error: pasting "(" and "__drv_nop" does not give a valid preprocessing token|
..\..\..\..\..\..\Program Files\Microsoft SDKs\Windows\v7.1\Include\winbase.h|3054|error: pasting "(" and "__drv_nop" does not give a valid preprocessing token|
..\..\..\..\..\..\Program Files\Microsoft SDKs\Windows\v7.1\Include\winbase.h|3057|error: pasting "(" and "__drv_nop" does not give a valid preprocessing token|
..\..\..\..\..\..\Program Files\Microsoft SDKs\Windows\v7.1\Include\winbase.h|3060|error: pasting "(" and "__drv_nop" does not give a valid preprocessing token|

etc...

How can I do? How can I use the Windows SDK with C::B?

stahta01

I suggest using an Compiler Compatible with the Windows SDK.

Just a obvious guess from a C programmer.

You never stated the name and version of the Compiler you are using.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

White Dragon

#2
Specifically I'm using Code::Blocks version 10.5 with MingGW v5.16; GCC v3.4.5
I would simply write the code that allows me to have a progress bar in the taskbar icon through Windows SDK following for example this guide:
http://www.codeproject.com/Articles/80082/Windows-7-How-to-display-progress-bar-on-taskbar-i.aspx

stahta01

#3
I suggest using MSVC (express or Regular) if you wish to use the Windows SDK headers; you might be able to do it with MinGW GCC.
But, using the Windows SDK headers with MinGW is NOT likely to work well and easy to do.

If you wish to do it; figure out if the dll that supports the function is an C language DLL.
If yes, then read how to use MinGW with DLLs and then work on getting all the other info needed.
If no, then you are most likely going to need to used MSVC to create an wrapper to export the parts of the DLL as C functions.
The "if no" part is too far past my abilities; I can almost do the "if yes" part; but, it is a lot of work.

Wish you luck.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

White Dragon

I hope I succeed in my purpose.
If necessary, I will try to use MSVC.
Thanks for your help and support.  :D