Newsgroups: comp.lang.smalltalk,comp.os.ms-windows.programmer.win32,comp.os.ms-windows.programmer.controls
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel-eecis!netnews.com!howland.erols.net!news-peer.gsl.net!news.gsl.net!portc01.blue.aol.com!newsstand.cit.cornell.edu!news.acsu.buffalo.edu!news.drenet.dnd.ca!crc-news.doc.ca!nott!emr1!jagrant
From: jagrant@emr1.NRCan.gc.ca (John Grant)
Subject: Re: Retrieving Strings from DEVNAMES
Message-ID: <DyzoEp.KAy@emr1.NRCan.gc.ca>
Organization: Natural Resources Canada, Ottawa
References: <32592BBA.332A@privbiz.com>
Date: Wed, 9 Oct 1996 03:30:25 GMT
Lines: 23
Xref: glinda.oz.cs.cmu.edu comp.lang.smalltalk:44647 comp.os.ms-windows.programmer.win32:61250 comp.os.ms-windows.programmer.controls:19624

In article <32592BBA.332A@privbiz.com> Sclark@privbiz.com writes:
>I'm a Smalltalker who's done no Windows programming, and I have a simple
>question for anyone with experience with the Win32 common print dialog.
>I'm calling the Windows PrintDlg function from Smalltalk in order to
>obtain and subsequently pass to a Crystal Reports API function the
>user's printer and print options selections.  The Win32 SDK defines the
>wDriverOffset, wDeviceOffset and wOutputOffset members as offsets into
>DEVNAMES of strings defining these attributes, which is what I need. 
>However, the offsets appear to point to addresses greater than the size
>of the structure.  I'm sure there's a simple trick here that I'm
>missing...

	LPDEVNAMES devnames=(LPDEVNAMES)GlobalLock(pd.hDevNames);

	LPSTR driver=(LPSTR)devnames + devnames->wDriverOffset;
	LPSTR device=(LPSTR)devnames + devnames->wDeviceOffset;
	LPSTR port  =(LPSTR)devnames + devnames->wOutputOffset;

        GlobalUnlock(pd.hDevNames);
-- 
John A. Grant       * I speak only for myself *            jagrant@nrcan.gc.ca
Airborne Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here.
