Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Printing with Vista

robgodfreyrobgodfrey Member Posts: 4
Hope this is the right place to post this.

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 WINN64):

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;
Sign In or Register to comment.