From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

exe using ddk

Hello everybody,
I am new to this forum. At present I've started to use the microsoft ddk. Can anybody suggest me how can I build exe using ddk.
I am trying with the function "GdiGetSpoolFileHandle" but it gives me error:
"Linking...
example.obj : error LNK2001: unresolved external symbol "void * __stdcall GdiGetSpoolFileHandle(unsigned short *,struct _devicemodeW *,unsigned short *)" (?GdiGetSpoolFileHandle@@YGPAXPAGPAU_devicemodeW@@0@Z)
Debug/example.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe."

Can anybody help me out....
Also I dont know how can I integrate ddk with my VC++ .net 2006.....

Thanks to all or you in advanced.

Regards,
chris.
0 Kudos
Message 1 of 3
(7,514 Views)
The ddk that this forum is for is a ddk for boards manufactured by National Instruments. You need to find a microsoft forum.
Message 2 of 3
(7,504 Views)
Hi Chris

i dont know much about your error, but i know a method which has worked for me:

first you should have a main.c file. which has to have a function like this:


#include <windows.h>
#include <basetyps.h>
#include <windowsx.h>
#include <initguid.h>
#include <dbt.h>
// todo : some headers

int WINAPI
WinMain (
    HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR     lpszCmdLine,
    int       nCmdShow
)
{
//todo
}

then you should have two files to build the project:

1. "makefile"

#
# DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source
# file to this component.  This file merely indirects to the real make file
# that is shared by all the driver components of the Windows NT DDK
#

!INCLUDE $(NTMAKEENV)\makefile.def


2. "sources"

TARGETNAME=TODO
TARGETTYPE=PROGRAM
USE_MSVCRT=1

UMTYPE=windows
UMENTRY=winmain
UMBASE=0x1000000

_NT_TARGET_VERSION = 0x0501

TARGETLIBS=\
        $(SDK_LIB_PATH)\kernel32.lib    \
        $(SDK_LIB_PATH)\user32.lib      \
        $(SDK_LIB_PATH)\gdi32.lib       \
        $(SDK_LIB_PATH)\comctl32.lib    \
        $(SDK_LIB_PATH)\cfgmgr32.lib    \
        $(SDK_LIB_PATH)\setupapi.lib

#INCLUDES=C:\WinDDK\6000\inc;..\inc;..\..\inc

SOURCES=main.c

Then you can use "make" or "build" commands to build the project

I think it should work

Regards

Erfan Azarkhish

0 Kudos
Message 3 of 3
(7,489 Views)