- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I try to use GetDefaultPrinter, it fails. Am I doing something wrong? I am using CVF6.6B in W2K SP3. When I run:
I get the error:
forrtl: severe(157): Program Exception ? access violation
Puzzled again
Alan
nLen = len(DefaultPrinterName) call GetDefaultPrinter(DefaultPrinterName, nLen)
I get the error:
forrtl: severe(157): Program Exception ? access violation
Puzzled again
Alan
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need LOC(nLen)::
LPDWORD arguments are not translated with REFERENCE attribute -- they require an explicit LOC. Steve, do you happen to know why? (My guess is "for backward compatibility").
Jugoslav
BOOL GetDefaultPrinter( LPTSTR pszBuffer, // printer name buffer LPDWORD pcchBuffer // size of name buffer );
LPDWORD arguments are not translated with REFERENCE attribute -- they require an explicit LOC. Steve, do you happen to know why? (My guess is "for backward compatibility").
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think this was just an oversight. We added REFERENCE and IGNORE_LOC to a lot of arguments, but it was done on a more or less manual basis. We'll need to revisit this the next time we do a "refresh" of the definitions.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jugoslav,
Many thanks - I must remember that pesky LOC for LPDWORD. Steve, could you get the forum system to put some soft returns in lines as long as Jugoslav's? It's a pain to read and/or print.
Alan
Many thanks - I must remember that pesky LOC for LPDWORD. Steve, could you get the forum system to put some soft returns in lines as long as Jugoslav's? It's a pain to read and/or print.
Alan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It was my error -- I forgot the terminating {/pre}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I edited the message. Supposedly, sometime in the mysterious future, you'll be able to edit your own posts for some time after posting.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just got this crash with 9.1 as well. Loc(nLen) fixed it.
nigel
nigel

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page