Solved

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

Posted on 1998-08-15
2
452 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at 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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

808 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