Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #12975 > unrolled thread

DocumentProperties and DevMode structure

Started byKrystian <softb@softb.pl>
First post2020-05-04 06:56 -0700
Last post2020-05-06 21:27 +0200
Articles 4 — 3 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  DocumentProperties and DevMode structure Krystian <softb@softb.pl> - 2020-05-04 06:56 -0700
    Re: DocumentProperties and DevMode structure Gianluca72 <gianluca.pinoli@proximacentauri.it> - 2020-05-04 09:18 -0700
    Re: DocumentProperties and DevMode structure Krystian <softb@softb.pl> - 2020-05-05 01:01 -0700
    Re: DocumentProperties and DevMode structure "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-05-06 21:27 +0200

#12975 — DocumentProperties and DevMode structure

FromKrystian <softb@softb.pl>
Date2020-05-04 06:56 -0700
SubjectDocumentProperties and DevMode structure
Message-ID<ba949ab5-b2cb-4947-b998-f93ba14f176c@googlegroups.com>
Hi,

How may i modify an element of the devmode structure :

1 - determine the size of structure
ile:=DocumentProperties(SELF:hWnd, hptr, PSZ(SELF:drukarka:Device), NULL, NULL, 0)

ptrmem := MemAlloc(ile)

2 - copy actual printer parameters to the allocated memory

DocumentProperties(SELF:hWnd, hptr, PSZ(SELF:drukarka:Device), ptrmem, NULL, DM_OUT_BUFFER)

3 - i would like to switch to duplex printing - but i do not know, how to update the structure

? ptrmem ? dmDuplex := DMDUP_VERTICAL

DocumentProperties(SELF:hWnd, hptr, PSZ(SELF:drukarka:Device), ptrmem, ptrmem, _OR(DM_IN_BUFFER, DM_OUT_BUFFER))

i will be grateful for any help
Krystian

[toc] | [next] | [standalone]


#12976

FromGianluca72 <gianluca.pinoli@proximacentauri.it>
Date2020-05-04 09:18 -0700
Message-ID<8f61ee49-64dd-44d1-ba24-63f193c00b0d@googlegroups.com>
In reply to#12975
Hi Kyystian,
this is some code from an old project where i used _WINDEVMODE changing the paper orientation.
I hope it can point you in the right direction.

*******************************************************************
METHOD Init() CLASS PrintDiscount
LOCAL StructDevMode AS _WINDEVMODE
LOCAL sPRINTER AS STRING

	sPRINTER := AllTrim(ETILASERIniFS:GetString("Discount","Printer"))
	IF !Empty(sPRINTER)
		oPRNDev := PrintingDevice{sPRINTER}
	ELSE	
		oPRNDev := PrintingDevice{}
	ENDIF
	StructDevMode := oPRNDev:GETDEVMODE()
	StructDevMode.dmOrientation := DMORIENT_LANDSCAPE

	oPRNDev:UPDATEDEVMODE()
	
	SUPER:Init("Etichette", oPRNDev)
***********************************************************************

Regards
Gianluca

[toc] | [prev] | [next] | [standalone]


#12977

FromKrystian <softb@softb.pl>
Date2020-05-05 01:01 -0700
Message-ID<49924c33-8acc-4532-958e-19820829e0fe@googlegroups.com>
In reply to#12975
W dniu poniedziałek, 4 maja 2020 15:56:10 UTC+2 użytkownik Krystian napisał:
> Hi,
> 
> How may i modify an element of the devmode structure :
> 
> 1 - determine the size of structure
> ile:=DocumentProperties(SELF:hWnd, hptr, PSZ(SELF:drukarka:Device), NULL, NULL, 0)
> 
> ptrmem := MemAlloc(ile)
> 
> 2 - copy actual printer parameters to the allocated memory
> 
> DocumentProperties(SELF:hWnd, hptr, PSZ(SELF:drukarka:Device), ptrmem, NULL, DM_OUT_BUFFER)
> 
> 3 - i would like to switch to duplex printing - but i do not know, how to update the structure
> 
> ? ptrmem ? dmDuplex := DMDUP_VERTICAL
> 
> DocumentProperties(SELF:hWnd, hptr, PSZ(SELF:drukarka:Device), ptrmem, ptrmem, _OR(DM_IN_BUFFER, DM_OUT_BUFFER))
> 
> i will be grateful for any help
> Krystian

Hi Gianluca,

Thanks for Your engagement and advice but, it is pity, it does not work. Only paper size, height, width and orientation may be affected by the method UpdateDevmode from class PrintingDevice. I do not understand, why the another properties can not be effectively changed.

With thanks and regard
Krystian

[toc] | [prev] | [next] | [standalone]


#12978

From"Urs Eggmann" <Urs.Eggmann@shinternet.ch>
Date2020-05-06 21:27 +0200
Message-ID<hhghefF6uugU1@mid.individual.net>
In reply to#12975
Hi Krystian,

Nice to hear from you again.
My provider does not allow to post binaries, see your mail there is a 
AEF....
Regards
Urs


"Krystian" <softb@softb.pl> schrieb im Newsbeitrag
news:ba949ab5-b2cb-4947-b998-f93ba14f176c@googlegroups.com...
> Hi,
>
> How may i modify an element of the devmode structure :
>
> 1 - determine the size of structure
> ile:=DocumentProperties(SELF:hWnd, hptr, PSZ(SELF:drukarka:Device), NULL,
> NULL, 0)
>
> ptrmem := MemAlloc(ile)
>
> 2 - copy actual printer parameters to the allocated memory
>
> DocumentProperties(SELF:hWnd, hptr, PSZ(SELF:drukarka:Device), ptrmem,
> NULL, DM_OUT_BUFFER)
>
> 3 - i would like to switch to duplex printing - but i do not know, how to
> update the structure
>
> ? ptrmem ? dmDuplex := DMDUP_VERTICAL
>
> DocumentProperties(SELF:hWnd, hptr, PSZ(SELF:drukarka:Device), ptrmem,
> ptrmem, _OR(DM_IN_BUFFER, DM_OUT_BUFFER))
>
> i will be grateful for any help
> Krystian

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web