News:

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

Main Menu

Where are MSwindows hdrs comming from?

Started by Pecan, January 24, 2007, 05:18:58 PM

Previous topic - Next topic

Pecan

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:


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?

thomas

"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

stahta01

Quote from: thomas on January 25, 2007, 09:57:51 AM
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++.
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]

Pecan

#3
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?

Quote from: arst on January 24, 2007, 09:44:15 AM
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 ===