The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Parsing Windows.h in VW

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Parsing Windows.h in VW Posted: Oct 13, 2004 7:38 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Parsing Windows.h in VW
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

Cincom Smalltalk support - Dave Wallen, specifically - has provided an answer to a fairly sticky problem some CST developers on Windows have - dealing with Windows API functions via the windows.h header file. There are a few problems that the DLLCC parser has with it - here's a solution with some instructions:

I played around with getting windows.h to parse. Only a few #defines were necessary in advance, and the thing now parses. The file is uploaded, but here are its contents anyway. Beware that once the parsing was completed, I was able to generate methods, but it took at least an hour on a PIII 500. I set GrowthReg. Upper Bound to 100MB, and it used it all. Also, I did not select any "macro"s for methods. I'm not sure if it works or not, but it would take forever, so I disabled the macros section. All the other sections did receive methods.

This file works on an installation with MSVC 2003. Not sure about other versions.


/*-------------------------------
 *  CincomWindows.h
 *-------------------------------
   This file was successfully parsed by VW 7.2.1 under the following conditions.
   1. Create a directory, called Include, with two subdirectories, called
      C_include and Win_include. 
   2. Copy this file to Include.
   3. Copy the entire \Microsoft Visual Studio .NET 2003\Vc7\include directory
      to C_include.
   4. Copy the entire \Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include
      to Win_include.
   5. In the Builder, enter these three directories as the include directories,
      C_include, then Win_include, then Include.
   6. In the Builder, enter this file as the only include file (CincomWindows.h).
   7. Click Parse Files, and the files are parsed.
  
   The following files were parsed, and no errors were reported. As an aside,
   this list was generated by printing to Transcript, in the method
   CPreprocessor>>include. It won't compile without AdvancedTools loaded.

   ('basetsd.h' 'cderr.h' 'cguid.h' 'CincomWindows.h'
   'commdlg.h' 'ctype.h' 'dde.h' 'ddeml.h' 'dlgs.h' 'excpt.h' 'guiddef.h' 'imm.h'
   'lzexpand.h' 'mcx.h' 'mmsystem.h' 'msxml.h' 'nb30.h' 'oaidl.h' 'objbase.h'
   'objidl.h' 'ole2.h' 'oleauto.h' 'oleidl.h' 'poppack.h' 'propidl.h' 'prsht.h'
   'pshpack1.h' 'pshpack2.h' 'pshpack4.h' 'pshpack8.h' 'reason.h' 'rpc.h' 'rpcasync.h'
   'rpcdce.h' 'rpcdcep.h' 'rpcndr.h' 'rpcnsi.h' 'rpcnsip.h' 'rpcnterr.h' 'servprov.h'
   'shellapi.h' 'stdarg.h' 'stdlib.h' 'stralign.h' 'string.h' 'tvout.h' 'unknwn.h'
   'urlmon.h' 'winbase.h' 'wincon.h' 'wincrypt.h' 'windef.h' 'windows.h' 'winefs.h'
   'winerror.h' 'wingdi.h' 'winioctl.h' 'winnetwk.h' 'winnls.h' 'winnt.h' 'winperf.h'
   'winreg.h' 'winscard.h' 'winsmcrd.h' 'winsock.h' 'winspool.h' 'winsvc.h'
   'winuser.h' 'winver.h' 'wtypes.h')

   Note: the RPC entry below is there to avoid a parsing error. The version may
         not match your installation, in which case you may need to change it to
         the value specified in the file rpcndr.h.
*/


#define WINVER 0x0500
#define _WIN32
#define NOWINRES
#define _M_IX86
#define __declspec(dllexport)
#define __RPCNDR_H_VERSION__ 475

#include "windows.h" 

So there you go. Your mileage may vary on other versions of windows.h from other revs of the OS, but the above should give you a headstart on how to proceed.

Read: Parsing Windows.h in VW

Topic: Just about to release Previous Topic   Next Topic Topic: Responsibility and Priority

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use