delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/09/20:50:36

From: Weiqi Gao <weiqigao AT a DOT crl DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: MainWndProc(HWND wnd, WORD message, WORD wParam, DWORD lParam)
Date: Sun, 09 May 1999 13:40:28 +0000
Organization: CRL Network Services
Lines: 41
Message-ID: <3735904C.68765B90@a.crl.com>
References: <Pine DOT SOL DOT 3 DOT 96 DOT 990508161011 DOT 19357B-100000 AT ux11 DOT cso DOT uiuc DOT edu> <8_2Z2.1441$mW3 DOT 11003 AT newsfeed DOT slurp DOT net> <Pine DOT SOL DOT 3 DOT 96 DOT 990508191453 DOT 10563A-100000 AT ux8 DOT cso DOT uiuc DOT edu>
NNTP-Posting-Host: a116008.stl1.as.crl.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.0.36 i586)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

miller matthew william wrote:
> 
> > > bitmaps.c:285: parse error before 'MainWndProc'
> > #include <windows.h>
> > a terse answer to a terse question, but my crystal ball is in the shop.
> windows.h is already included.  Can another solution be suggested?
> ---bitmaps.c---
> [bitmaps.c omitted.]

I assume that you are compiling this program with DJGPP + RSXNTDJ. 
(Otherwise it would be off-topic here, wouldn't it?)

The first problem is that this program appears to be a Windows (at most)
3.1 program using the Windows API. And the Windows API is fundamentally
different from the Win32 API that's in Windows 95/NT.  There are some
conversion work that needs to be done to make it a Win32 program. 
Nothing major, but quite delicate.  Microsoft has several articles on
this matter, search their web site for things like "Getting ready for
Chicago".

The WinMainProc prototype, for example, should be
LRESULT CALLBACK WinMainProc(HWND, UINT, WPARAM, LPARAM);

The second program is that this program appears to be written for a
compiler that defines "__TSC__".  Although the compiler specific code
was guarded by #ifdef/#endif pairs, the presence of only one such pair
suggests that the program was written and tested only for that
particular compiler.  And chances are good the the author used
non-standard features that's unique to that compiler elsewhere in his
code without mentally noticing it.  As a general rule, (at least the
code I've seen), projects written for one compiler usually doesn't
compile under another compiler.  (The only exception to this rule was
that I compiled a DOS program written for Borland compiler with DJGPP
once.)

Unless you want to learn the 16-bits Windows API, may I suggest that you
start from some other place (a current Win32 book, maybe?).

--
Weiqi Gao
weiqigao AT a DOT crl DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019