Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: White Dragon on July 26, 2010, 12:56:08 am

Title: Building a project with C:: B and Windows SDK
Post by: White Dragon on July 26, 2010, 12:56:08 am
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?
Title: Re: Building a project with C:: B and Windows SDK
Post by: stahta01 on July 26, 2010, 01:58:53 am
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.
Title: Re: Building a project with C:: B and Windows SDK
Post by: White Dragon on July 26, 2010, 02:37:38 am
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 (http://www.codeproject.com/Articles/80082/Windows-7-How-to-display-progress-bar-on-taskbar-i.aspx)
Title: Re: Building a project with C:: B and Windows SDK
Post by: stahta01 on July 26, 2010, 03:11:40 am
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.
Title: Re: Building a project with C:: B and Windows SDK
Post by: White Dragon on July 26, 2010, 06:21:49 pm
I hope I succeed in my purpose.
If necessary, I will try to use MSVC.
Thanks for your help and support.  :D