Avatar billede nolle_k Nybegynder
13. april 2000 - 11:01 Der er 3 kommentarer og
1 løsning

DVTARGETDEVICE ????

Er der nogen, der kende til DVTARGETDEVICE?? For eksempel hvordan man fylder denne struct ud eller om der findes en funktion, der kan gøre det for en ved hjælp af den HDC????

//Nolle_K
Avatar billede michaelprehn Nybegynder
13. april 2000 - 13:15 #1
Hjælper dette klip fra Visual C++ help?:

DVTARGETDEVICE
Use the DVTARGETDEVICE structure to specify information about the target device for which data is being composed. DVTARGETDEVICE contains enough information about a Windows target device so a handle to a device context (hDC) can be created using the Windows CreateDC function.
typedef struct tagDVTARGETDEVICE
{
    DWORD tdSize;
    WORD  tdDriverNameOffset;
    WORD  tdDeviceNameOffset;
    WORD  tdPortNameOffset;
    WORD  tdExtDevmodeOffset;
    BYTE  tdData[1];
}DVTARGETDEVICE;

Members
tdSize
Size, in bytes, of the DVTARGETDEVICE structure. The initial size is included so the structure can be copied more easily.
tdDriverNameOffset
Offset, in bytes, from the beginning of the structure to the device driver name, which is stored as a NULL-terminated string in the tdData buffer.
tdDeviceNameOffset
Offset, in bytes, from the beginning of the structure to the device name, which is stored as a NULL-terminated string in the tdData buffer. This value can be zero to indicate no device name.
tdPortNameOffset
Offset, in bytes, from the beginning of the structure to the port name, which is stored as a NULL-terminated string in the tdData buffer. This value can be zero to indicate no port name.
tdExtDevmodeOffset
Offset, in bytes, from the beginning of the structure to the DEVMODE structure retrieved by calling ExtDeviceMode.
tdData
Aray of bytes containing data for the target device. It is not necessary to include empty strings in tdData (for names where the offset value is zero).
Remarks
Some OLE 1 client applications incorrectly construct target devices by allocating too few bytes in the DEVMODE structure for the OLETARGETDEVICE. They typically only supply the number of bytes in the DEVMODE.dmSize member. The number of bytes to be allocated should be the sum of DEVMODE.dmSize + DEVMODE.dmDriverExtra. When a call is made to the CreateDC function with an incorrect target device, the printer driver tries to access the additional bytes and unpredictable results can occur. To protect against a crash and make the additional bytes available, OLE pads the size of OLE 2 target devices created from OLE 1 target devices.

Avatar billede nolle_k Nybegynder
13. april 2000 - 13:20 #2
Har selv et print af det!! Men du er velkommen til at forklare mig hvordan fanden alt det volapyk skal forståes!! Hvis der så bare var et eksempel!!
Ellers tak du!!

//Nolle_K
Avatar billede kh@ingenioer Nybegynder
14. april 2000 - 14:16 #3
ER du ved at lave en ny de´vice driver eller hvad?
Kan du ikke fortælle lidt om i, hvilken sammenhæng du er stødt på det?
Avatar billede nolle_k Nybegynder
14. april 2000 - 14:45 #4
Det er i forbindelse med et kald til interfacet IViewObject's metode Draw! Men jeg har faktisk fundet ud af hvordan det gøres men det hjalp overhovedet ikke! Soory
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester