Author Topic: Where are MSwindows hdrs comming from?  (Read 3320 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Where are MSwindows hdrs comming from?
« on: January 24, 2007, 05:18:58 pm »
When I make a new project and use windows variables, where are they comming from.

For example, I make a stub pluging from the wizard and included the following lines:

Code
void stub::OnAttach()
{
// do whatever initialization you need for your plugin
// NOTE: after this function, the inherited member variable
// m_IsAttached will be TRUE...
// You should check for it in other functions, because if it
// is FALSE, it means that the application did *not* "load"
// (see: does not need) this plugin...

    int testing = VK_SHIFT;

}


It compiles fine. But how? VK_SHIFT is defined in winuser.h in the mingw includes. But I never used a #include for it.

How does this work?
« Last Edit: January 24, 2007, 05:22:57 pm by Pecan »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Where are MSwindows hdrs comming from?
« Reply #1 on: January 25, 2007, 09:57:51 am »
wxWidgets includes windows.h?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Where are MSwindows hdrs comming from?
« Reply #2 on: January 25, 2007, 12:18:40 pm »
wxWidgets includes windows.h?

Yes, wxWidgets include windows.h; wxWidgets includes msw/wrapwin.h which includes <windows.h>

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 Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Where are MSwindows hdrs comming from?
« Reply #3 on: January 25, 2007, 03:37:29 pm »
Thanks, then they came in from the precompiled headers for wx263.

arst was using 2.8.0 with my 2.6.3 project .cbp. Does this mean that it was *not* using 2.8.0 precompiled headers, or does something else need to be done for 2.8.0.

Inserting "#include <windows.h>" solved the problem. But I don't understand why it was necessary. Any clues?

Hello,

I've been downloading the KeyMacs 0.3.5 plugin. I've been lacking
macro support in CB. But... when compiling in CB (3521), I receive
a bunch of preprocessor errors, see below.

They all relate to Windows preprocessor symbols, so they are
nowhere defined, neither in CB source folder nor in wxWidgets one.

How should this be compiled?

Thanks,
Arst


:: === KeyMacs-MSW-plugin, default ===
D:\Proj\Ext\CB\src\plugins\contrib\KeyMacs\MSWrunmacro.cpp:35: error: `VK_SHIFT' was not declared in this scope
D:\Proj\Ext\CB\src\plugins\contrib\KeyMacs\MSWrunmacro.cpp:35: error: `MapVirtualKey' was not declared in this scope
D:\Proj\Ext\CB\src\plugins\contrib\KeyMacs\MSWrunmacro.cpp:36: error: `VK_CONTROL' was not declared in this scope
D:\Proj\Ext\CB\src\plugins\contrib\KeyMacs\MSWrunmacro.cpp:37: error: `VK_MENU' was not declared in this scope
....
D:\Proj\Ext\CB\src\plugins\contrib\KeyMacs\MSWrunmacro.cpp:298: error: `byte' was not declared in this scope
D:\Proj\Ext\CB\src\plugins\contrib\KeyMacs\MSWrunmacro.cpp:298: error: expected `)' before "scCode"
:: More errors follow but not being shown.
:: Edit the max errors limit in compiler options...
:: === Build finished: 50 errors, 0 warnings ===
« Last Edit: January 25, 2007, 03:39:53 pm by Pecan »