Link imports by name (C++/Visual Studio) -
i have few nt imports want use in program, problem unable use them without going though lengthly process of downloading , setting wdk use 2 functions. prefer not use getmodulehandle , getprocaddress.
i know in vb6 can manually define imported functions dlls this:
private declare function ntfunction lib "ntdll.dll" (function arguments) type
is there similar can c++ in visual studio without having headers/libs?
you don't want use getprocaddress
, that's vb6 declare function
(and .net p/invoke) does.
you need complete prototype, can recreate enough of header file documentation.
the import library little more difficult, there tools create import libraries .dll.
if create .def file, can use lib.exe
tool comes visual c++ (and available free download part of windows sdk), see building import library
here more information.
mingw comes tool automating creation of .def file: http://www.mingw.org/wiki/createimportlibraries (the import library creates usable gcc, .def file useful making vc++ import library described above).
here's tool might help: http://www.codeproject.com/kb/tips/impdef.aspx
Comments
Post a Comment