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.
From novice to tech pro — start learning today.