Dears,
I'm building cosumized dll using unidrv model (oemdll
example).
I used SetPrinterData and GetPrinterData in the UI dll it
worked fine, GetPrinterData also worked fine in the
customizaion dll of the graphics engine.

I'm faceing a problem I tried to use SetPrinterData, or
EngSetPrinterData, both return code 5, i guess this means
access violation.

the code is:
dwResult = SetPrinterData(pdev->hPrinter,
STDSTR_FONTDATASIZE,
REG_DWORD,
(PBYTE) &FontSize,
sizeof(DWORD));
where FontSize is a DWORD and STDSTR_FONTDATASIZE is
defined as follows:
#define STDSTR_FONTDATASIZE TEXT("FontDataSize")
hPrinter is stored when the driver received the EnablePDEV
call, and it worked in GetPrinterData.

Please if any body knows what is going around please
advise.

Best regards,
-Amer Malas.

Re: Problem using EngSetPrinterData in user-mode by vipin

vipin
Wed Jun 23 09:05:30 CDT 2004

Your hPrinter doesn't have the access rights to do SetPRinterData. :(


"Amer Malas" <malas@sedco-online.com> wrote in message
news:1ff4001c458ee$40cd65c0$a301280a@phx.gbl...
> Dears,
> I'm building cosumized dll using unidrv model (oemdll
> example).
> I used SetPrinterData and GetPrinterData in the UI dll it
> worked fine, GetPrinterData also worked fine in the
> customizaion dll of the graphics engine.
>
> I'm faceing a problem I tried to use SetPrinterData, or
> EngSetPrinterData, both return code 5, i guess this means
> access violation.
>
> the code is:
> dwResult = SetPrinterData(pdev->hPrinter,
> STDSTR_FONTDATASIZE,
> REG_DWORD,
> (PBYTE) &FontSize,
> sizeof(DWORD));
> where FontSize is a DWORD and STDSTR_FONTDATASIZE is
> defined as follows:
> #define STDSTR_FONTDATASIZE TEXT("FontDataSize")
> hPrinter is stored when the driver received the EnablePDEV
> call, and it worked in GetPrinterData.
>
> Please if any body knows what is going around please
> advise.
>
> Best regards,
> -Amer Malas.
>



Re: Problem using EngSetPrinterData in user-mode by Ivan

Ivan
Thu Jun 24 04:19:53 CDT 2004

Amer,

I have faced such the problem only when I try to set the printer data from
UNI dll (rendering plug-in). From UI plug-in there is no problem to set or
get the printer data. So I've come to a conclusion that it's common to set
the configuration in UI plug-in and then only to read it from UNI plug-in
(through EngGetPrinterData) .

___________________________________________
Best regards,
Ivan Dimitrov

ProSyst Bulgaria, Inc.
http://www.prosyst.com i_dimitrov@prosyst.bg
"Amer Malas" <malas@sedco-online.com> wrote in message
news:1ff4001c458ee$40cd65c0$a301280a@phx.gbl...
> Dears,
> I'm building cosumized dll using unidrv model (oemdll
> example).
> I used SetPrinterData and GetPrinterData in the UI dll it
> worked fine, GetPrinterData also worked fine in the
> customizaion dll of the graphics engine.
>
> I'm faceing a problem I tried to use SetPrinterData, or
> EngSetPrinterData, both return code 5, i guess this means
> access violation.
>
> the code is:
> dwResult = SetPrinterData(pdev->hPrinter,
> STDSTR_FONTDATASIZE,
> REG_DWORD,
> (PBYTE) &FontSize,
> sizeof(DWORD));
> where FontSize is a DWORD and STDSTR_FONTDATASIZE is
> defined as follows:
> #define STDSTR_FONTDATASIZE TEXT("FontDataSize")
> hPrinter is stored when the driver received the EnablePDEV
> call, and it worked in GetPrinterData.
>
> Please if any body knows what is going around please
> advise.
>
> Best regards,
> -Amer Malas.
>