From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5feb723c26279aee X-Google-Attributes: gid103376,public From: John English Subject: Re: Win32 dialogs/resource grief (longish) Date: 2000/03/02 Message-ID: <38BE69BC.18BC5895@bton.ac.uk>#1/1 X-Deja-AN: 592221784 Content-Transfer-Encoding: 7bit References: <38BC8428.901597BD@brighton.ac.uk> <38bdb710_1@news2.prserv.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@bton.ac.uk X-Trace: saturn.bton.ac.uk 952002818 17413 193.62.183.204 (2 Mar 2000 13:13:38 GMT) Organization: University of Brighton Mime-Version: 1.0 NNTP-Posting-Date: 2 Mar 2000 13:13:38 GMT Newsgroups: comp.lang.ada Date: 2000-03-02T13:13:38+00:00 List-Id: David Botton wrote: > > Actually that was not his problem. Your version of the code would also have > seen the same problem if you threw in the second dialog box. > > BTW rcl also does not compile the resource to coff correctly in that case > either (mutliple dialogs). Windres or M$ cvtres are the only options here. > > David Botton > > Jerry van Dijk wrote in message <38bdb710_1@news2.prserv.net>... > >Basically, the problem is that passing around data within the > >Win32 environment takes more care. Explaining it all would take > >more then a posting, but hopefully the code below will point in > >the right direction. As it happens, Windres seems to give me the same result. I've haven't got cvtres so I haven't tried it, but I manually converted my .rc file into about 500 lines of type declarations for DLGTEMPLATE structures, with delicate rep clauses and alignment clauses (yuk!), and everything now works perfectly. But if I can find a copy of cvtres I'll give it a try -- I don't want to have to do any more manual conversions if I can avoid it! A pox on tools that don't work... Incidentally, a funny with the DLGTEMPLATE. In Win32.WinUser, the size clause for DLGTEMPLATE says "for 'Size use 18*8" -- but when I set up my DLGTEMPLATE structure like so: type MyDlg is record Dialog : DLGTEMPLATE; -- 18 bytes Menu : WORD := 0; -- 2 bytes Class : WORD := 0; -- 2 bytes ... end record; for MyDlg use record Dialog at 0 range 0..18*8-1; Menu at 18 range 0..15; Class at 20 range 0..15; end record; Gnat complains that at least 160 bits (20 bytes) are required for Dialog, so I have to drop Menu from the rep clause (but thankfully it still works fine) -- any idea why 20 bytes are required when the size has explicitly been set to 18 bytes? Anyway, many thanks for your help, David. ----------------------------------------------------------------- John English | mailto:je@brighton.ac.uk Senior Lecturer | http://www.it.bton.ac.uk/staff/je Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS ** University of Brighton | -- see http://burks.bton.ac.uk -----------------------------------------------------------------