Advertisement

11.08.2008 at 05:41AM PST, ID: 23887678
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

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

Asked by michelleyi in Windows Programming, C / C++ / C# Editors and IDEs, Microsoft Operating Systems

Tags: , , ,

Hi,
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!


Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
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 source.inc 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.
12.select "C/C++" tab.
13.select "Precompiled Headers" from the "Category" comobox.
14.select "Use Precompiled Header file (.pch)". then input "precomp.h" in the "through header:" edit box.
15.press [OK].
16.from the sources.inc, there is a line:
C_DEFINES=$(C_DEFINES) -DKERNEL_MODE -D_UNICODE -DUNICODE -DOEMCOM
-DKERNEL_MODE means define "KERNEL_MODE"
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 sources.inc.
these are "KERNEL_MODE,_UNICODE,UNICODE,OEMCOM,DEBUG,USERMODE_DRIVER"
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.
 
Loading Advertisement...
 
[+][-]11.08.2008 at 06:40PM PST, ID: 22914857

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Windows Programming, C / C++ / C# Editors and IDEs, Microsoft Operating Systems
Tags: windows ddk, printer sample code, mvc6 compile error, c++
Sign Up Now!
Solution Provided By: DanRollins
Participating Experts: 2
Solution Grade: A
 
 
[+][-]11.08.2008 at 07:41PM PST, ID: 22914996

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.09.2008 at 07:50AM PST, ID: 22916665

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.09.2008 at 03:16PM PST, ID: 22918208

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.09.2008 at 03:45PM PST, ID: 22918281

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.09.2008 at 05:38PM PST, ID: 22918631

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_Related_20080208