Comment utiliser SetDefaultPrinter dans une application console ?

J'ai essayé, sans succès :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
if not SetDefaultPrinter(PChar(MaVariableChaine)) then
if not SetDefaultPrinter(PChar(MonTableauDeChar)) then
if not SetDefaultPrinter(nil) then
if not SetDefaultPrinter('') then
Dans tous les cas, j'obtiens une EAccesViolation.

Que faut-il lui donner ?