I have a customer who needs to add custom forms to printers via code.
Windows has an API call named AddForm() under Printer Spooler functions.
This requires a structure.
I understand that ot4xb has features that are supposed to make it easier to create structures rather than using BAP.
I don't see any examples of this.
Does anyone have a sample?
Making a structure with ot4xb
Making a structure with ot4xb
The eXpress train is coming - and it has more cars.
Re: Making a structure with ot4xb
i guess you have download Source of ot4xb too.rdonnay wrote:Does anyone have a sample?
in \Source\winapi_CommonStructures.cpp you will find a lot of Structure ready to use.
as Attachment Sample EnumPrinters.zip which also show how to write own Structure.
greetings by OHR
Jimmy
Jimmy
Re: Making a structure with ot4xb
You don't need any source. What you need is a correct description of the structure. Structures in OT4XB are class objects, created this way:
This code should be at the end of the PRG. The structure object itself is created this way:
All elements can be populated after that:
If you get a pointer to an existing structure of that kind somewhere, like in a callback, do this:
The last parameter (.T.) means that a copy of the structure is used here.
Code: Select all
BEGIN STRUCTURE oMyStructureName
MEMBER UNIT _FirstPara
MEMBER HWND _hWnd
MEMBER BOOL _lWhatever
END STRUCTURE
Code: Select all
oStruct := oMyStructureName():New()
Code: Select all
oStruct:_FirstPara := 15
oStruct:_lWhatever := .T.
Code: Select all
FUNCTION MyCallBack(nStructPtr)
LOCAL oStruct := oMyStructureNAme():New():_link_(nStructPtr,.T.)
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."