Building a header file from libraries
I'm confused, hang on. You want to generate a .h file that would then allow someone to statically link against m_model.dll? Where did m_model.dll come from? Do you not have the original .h file?
"...and should look better than the original .h file..."
Better in what way?
HI,
I built the m_model dll from my exe but the h file is really long winded and needs lots of tidying up so I was wondering if there is a way to auto generate an h file but it looks like there is no way to do this.
A better way of doing this would be to use ATL I suppose I shall tidy up the exiting h file.
Yeah, you can utilize a combination of dumpbin & dbghelp to do this (and possibly other tools such as libtool). **IF** your DLL is well formed (by that I mean, has a purely functional interface - i.e. you are not able to access member variables in your DLL classes/structs; and you have properly exported the ctors and all objects are allocated on the heap from within the DLL - no stack allocation allowed!), then it will work. Chances are though, your DLL is probably NOT well formed, and so the code that is generated is likely to be horribly broken. If you have the original headers, and you just want to clean them up, then it's best to take this as an opportunity to refactor your headers. It is the safest and easiest option.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms679291(v=vs.85).aspx
Part of me would like you to try and then report back here how it went, but I'm gonna agree with the general advice of the others: Don't do it, just refactor your header. :)