Lost Password?


Go Back   CodeCall Programming Forum > Software Development > C and C++

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-29-2008, 06:35 AM
AncientGardener AncientGardener is offline
Newbie
 
Join Date: Jan 2008
Posts: 2
Rep Power: 0
AncientGardener is on a distinguished road
Default Problem with Vista and printing

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 :

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;

Last edited by Jordan; 01-29-2008 at 07:29 AM. Reason: Added code tags
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 01-29-2008, 08:12 AM
v0id's Avatar   
v0id v0id is offline
Retired
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,654
Last Blog:
CherryPy(thon)
Rep Power: 29
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default

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.
__________________
05-03-2007 - 11-13-2008
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -5. The time now is 11:03 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 101%


Complete - Celebrate!

Ads