Author Topic: Building a project with C:: B and Windows SDK  (Read 13922 times)

Offline White Dragon

  • Single posting newcomer
  • *
  • Posts: 3
Building a project with C:: B and Windows SDK
« 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?
« Last Edit: July 26, 2010, 03:04:35 am by White Dragon »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
Re: Building a project with C:: B and Windows SDK
« Reply #1 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline White Dragon

  • Single posting newcomer
  • *
  • Posts: 3
Re: Building a project with C:: B and Windows SDK
« Reply #2 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
« Last Edit: July 26, 2010, 03:05:33 am by White Dragon »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
Re: Building a project with C:: B and Windows SDK
« Reply #3 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.
« Last Edit: July 26, 2010, 05:05:11 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline White Dragon

  • Single posting newcomer
  • *
  • Posts: 3
Re: Building a project with C:: B and Windows SDK
« Reply #4 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