Use a DLL without a header file

Is there anyway I can find the parameters and or return value of a function in a dll without the header file.  I want to use a dll and don't have access to the header file of library file.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Well, yes and no. You can find out the names of the functions the DLL exports by using DUMPBIN (Visual C++) or a similar tool--unfortunately there's no information stored in the DLL about what parameters its functions take or what their return values are (unless the DLL in question is actually a COM component, in which case you access it in a completely different way in any case).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
of course, you use loadlibrary. you need to know the name of the function , but you should know that anyway...
you use loadlibrary and save the HMODULE. the use GetProcAddress pass it the hmodule and the name of the function exactlly (maybe also try an alias if this returns NULL, check all returns before you use any pointers) you can create a pointer to the function like so
let's say the function returns long and take two integer parameters:
typedef long (WINAPI *_MyDllFunction)(int,int);
_MyDllFunction MyDllFunction;
set MyDllFunction = (_MyDllFunction)GetProcAddress(hmodulehere,"MyDllFunction");
assuming the address was returned correctlly you call it as normal:
somelong = MyDllFunction(5,5);
thats all.
i read your question wrong, but it can apply after you get the answer ;o\
dirtywermAuthor Commented:
Yeah, i figured there wasn't any way to do it. Its not a com component.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.