Jump to content

Problem with Vista and printing

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
AncientGardener

AncientGardener

    Newbie

  • Members
  • Pip
  • 2 posts
I have some applications developed using Visual C and they use the same printing module. However, it does not seem to work when running under Vista.

Could this be that I need to add something like WIN64 to the following code :

enum PlatForm {WINNT, WIN95, WIN32S};

#if defined (WIN32)
#define IS_WIN32 TRUE
#else
#define IS_WIN32 FALSE
#endif
#define IS_WINNT IS_WIN32 && (BOOL)(GetVersion() < 0x80000000)
#define IS_WIN32S IS_WIN32 && (BOOL)(!(IS_WINNT) && (LOBYTE(LOWORD(GetVersion()))<4))
#define IS_WIN95 (BOOL)(!(IS_WINNT) && !(IS_WIN32S)) && IS_WIN32

Depending on which platform is used I then do different things (so would I need to have a separate case for WIN64):

DEVCAPS MyDevCaps;
MyDevCaps.wCurPlatForm = (IS_WINNT) ? WINNT : ((IS_WIN95) ? WIN95 : WIN32S);

// For example, getting paper sizes, etc
switch (MyDevCaps.wCurPlatForm){
case WIN32S:{
TCHAR szAllDevices[4096];
LPTSTR szPtr;
GetProfileString("devices", NULL, "", szAllDevices,sizeof(szAllDevices));
szPtr = szAllDevices;
while (*szPtr){
SendDlgItemMessage(hDlg, PRN_PRINTERLIST,
LB_ADDSTRING, 0, (LPARAM) ((LPTSTR) szPtr));
szPtr += strlen (szPtr) +1;
}
InitMyDevStruct(hDlg, 0);
DumpPaperInfo( hDlg, PRN_CAPLIST);
}
break;



#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
You could check Microsoft's reference on the Windows API. Every function, structure, etc. have a note on which versions it's supported, and which library it's in.