No announcement yet.

CreateWindow and PBCC

  • Filter
  • Time
  • Show
Clear All
new posts

  • CreateWindow and PBCC

    Attempting to compile some code with PBCC V5 which compiles OK with PBCC V4, I get an error in COMMCTRL.INC when it tries to reference the function CreateWindow which is declared inside WIN32API.INC conditionally thus:

    #IF %DEF(%CCWIN)
        FUNCTION CreateWindow....
    My source code has not changed. I can't find a reference to %CCWIN in the help. Have I missed something?

  • #2
    Yes, need to search in he include for comments ...

    In the in the header comments it says:
    ' If you are using the PowerBASIC Console Compiler for Windows, several of
    ' the GDI functions have been commented out so that the code will not be
    ' added to your programs. If you need to access these functions you will
    ' need to add the line:
    ' %CCWIN = 1
    ' Before the #INCLUDE "WIN32API.INC" line. This will re-enable those calls
    ' for your PB/CC application.
    [ /QUOTE]
    Rick Angell


    • #3
      Thank you Mr Angell.

      This is an "own goal" in fact - the V4.03 PBWIN32.INC also has the note about %CCWIN. (although curiously the V4.3 header has:

      Last Update: 21 February 2005
      whereas the V5.0 header has:

      Last Update: 27 January 2005
      Of course these dates could make perfect sense if the V4.03 development branched the WIN32API.INC file on 21st February 2005! But I digress...)

      So my V4.03 compiler must have been set up to use another version of the WIN32API.INC file, and compiled my "wrong" source code without a murmur.
      Last edited by Chris Holbrook; 17 Oct 2008, 04:24 AM. Reason: version numbers


      • #4
        Hi Chris,

        If you use CreateWindowEx instead of the older CreateWindow, which, if memory serves, is macro'ed to CreateWindowEx anyway, at least hello, world type apps compile 'as is' with CC5. I just tried it to see if anything changed in that regard with CC5 because that is what I had found with CC4 and windows gui programs. Of course, you'll get a console too!


        • #5
          Originally posted by Fred Harris View Post
          If you use CreateWindowEx instead of the older CreateWindow
          Thanks for the info. In fact it was COMMCTRL.INC which was using CreateWindow, probably best if I don't change it.