Solved

How I can use NT DDK PACKET driver with VC++ ?

Posted on 1998-08-15
2
448 Views
Last Modified: 2012-08-13
I've built the packet driver from ddk/network/packet directory, I've
got a packet32.dll, packet32.lib etc..., the testapp.c works fine. But
when I build my project in VC++ (with MFC) I get "unresolved external
symbol _PacketOpenAdapter" (obviusly for all packet functions), but
I've linked the library packet32.lib and I've put the 'extern "C"' in
all function prototypes in packet32.h, but it still don't work.

Anybody can help me ? How I can use packet32.lib under VC++ 4.2 ?

I've used packet driver that come with MSDN of August 1996, I don't
know if newer version works, anyone knows ?

Regards.
0
Comment
Question by:b2s2
2 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1170387
I'm not familiar with this.  But I guess what is happening is that this is C code and you are trying to call it from C++ by adding the extern "C", is that right?

The problem might be calling convention.  In C++ the standard call calling convention.  As well as the extern "C", you might need to add a declaration that indicates the calling convention as well.  An incorrect calling convetions will obviously cause run-time errors, but it can cause link errors as well, because the standard call (VC's default) calling convention  decorates the name by adding an underscrore to the start and appending a "@XX to the end where the XX is the byte size fo the parameters.  
0
 
LVL 4

Accepted Solution

by:
agreen earned 100 total points
ID: 1170388
Let me suggest you a very simple way to build your project. The BUILD utility makes the build.log file per project. You can find this file in the Driver,DLL and TESTAPP directories.

Carefully copy the compiler switches and preprocessor definitions to the Project/Settings/ C/C++, linker switches to the Project/Settings/Link, put the <ddk path>\inc and <ddk path>\src\network\inc directories to the Tools/Options/Directories and your project's ready.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now