Compile error when build Win DDK printer sample code -- oemuni in MVC6

I'm new in printer driver programming and want to learn through debugging through some printer sample codes in Win DDK. I crossed by BeyondWu's solution posted years ago regarding compile oemuni in MVC6, and following the instructions.

 And got following compiler errors:

--------------------Configuration: OEMUNI - Win32 Debug--------------------
c:\winddk\6001.18001\src\print\oemdll\oemuni\ddihook.cpp(56) : fatal error C1083: Cannot open precompiled header file: 'OEMUNI.pch': No such file or directory

My environment is: Win XP, WDK 6001.18001 and MVC6. I named the project "oemuni".
I notice that the sample code of "oemuni" has been changed in WDK 6001.18001,  since there's no "umode" subdirectory exist in this version.

Any idea how to fix it?
Thanks in advance!

I use the "oemuni" sample under ddk folder, please follow me;)
1. Create a New "Win32 Dynamic-Link Library "project.
2. Input a name(any string) into the "Project Name" edit box.
3. Press [OK], then select "a simple dll project", I think you also can select "an empty dll project", but I've tested it.
4. press [finish].
5. delete all files from the left project window.
6. copy all files from the "oemuni" subfolder into current project folder.
7. add all files into current project.(I assume you know how to do it).
8. open file.
9. if there is a line "PRECOMPILED_CXX=1", it means using precompile head.
10. select "xxx files" from the left workspace window.
11. press right button of mouse, in the popup menu, select "settings..." item. "C/C++" tab. "Precompiled Headers" from the "Category" comobox. "Use Precompiled Header file (.pch)". then input "precomp.h" in the "through header:" edit box. [OK].
16.from the, there is a line:
so open the setting dialogbox again(refer item 10), then select "C/C++" tab, and select General from "Category" comobox, in the "Preprocessor definitions:" edit box, input all the symbol copy from the
the USERMODE_DRIVER comes from the file "sources" under the umode subfolder.
17.still in the "C/C++" tab, select the "Preprocessor" from the "Category" comobox, input your ddk's include dir into the "Aditional include directories:" edit box.
for me, it is "F:\WINDDK\inc"
18.there is a line "DLLBASE=0x70000000", so you need to open the setting dialogbox again, select "Link" tab. then select "Output" from the "Category" comobox, input the "0x70000000" into the "Base Address:" editbox.
19.there is also a def in the umode folder. so please add this file into your project.
20.for this sample, the "precomp.h" file is a precompiled header file, but for VC's IDE we need a .cpp to use it.
so please create a new .cpp file and insert the line "#include "precomp.h" into the cpp file, then add this cpp file into your project, then select the cpp file in the left workspce window, press right button, in the popup menu, select "setting..." item, select "Precompiled Headers:" from the "catagory" comobox, then select the "Create precompiled header ...", then input the "precomp.h" into the following "Through header" edit box.

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

In project / settings / C/C++ / (Catagory:  Precompiled headers)
choose Automatic use of precompikled headers.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
michelleyiAuthor Commented:
Hello DanRollins,
Thanks for your help. The setting you suggested does help get rid of the error. But now I got other compiling errors:
c:\winddk\6001.18001\inc\api\bcrypt.h(112) : error C2485: 'align' : unrecognized extended attribute
c:\winddk\6001.18001\inc\api\bcrypt.h(112) : error C2059: syntax error : '('
c:\winddk\6001.18001\inc\api\bcrypt.h(118) : error C2485: 'align' : unrecognized extended attribute
c:\winddk\6001.18001\inc\api\bcrypt.h(118) : error C2059: syntax error : '('

The following is code snippet from line 111 of bcrypt.h.
Do you think is the compiler verion of MVC++ 6 is too old to recognize the keyword of "pack" in #pragma?
It also complains:
c:\winddk\6001.18001\inc\api\wingdi.h(4341) : warning C4068: unknown pragma
and its corresponding code is:
#pragma deprecated (UpdateICMRegKeyA)

Thanks again for your help, and look forward to hear more advice from you,
#pragma pack(push, BCRYPT_OBJECT_ALIGNMENT)
    ULONG   cbOID;
    PUCHAR  pbOID;
    ULONG       dwOIDCount;

Open in new window

michelleyiAuthor Commented:
I used MVS 2005 instead of MVC6, the above compile errors disappeared.

Thanks DanRollins for your help,
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Just a little "heads up" for future questions:
   What's the right grade to give?
In general, if a comment answers the question, then it's worth an A.  No big deal this time, but something to think about for the future.
-- Dan
michelleyiAuthor Commented:
Hello DanRollins,
I'm new in this site, so not that familiar the grading system. I have requested to change the grade, hope the grade will get adjust to A.
Thanks again for your help.

Grade changed.
EE Moderator
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.