Advertisement Jump to content
Sign in to follow this  
erm1

Building a header file from libraries

This topic is 1799 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

 
Hello there folks,
 
I was wondering if anyone might know how I can auto create
 
a readable header .h file from the following files.
 
I am thinking it should be possible and should look better than the original .h file.
 
As, I want developers to be able to add the functionality to there code, 'for free' but They are going to need a .h file.
 
So, how should I attempt this ? 
 
These are the files I want to generate the header file from : 
 
m_model.dll
m_model.exp
m_model.ilk
m_model.lib
m_model.pdb
 
Many Thanks in advance,
Edited by erm1

Share this post


Link to post
Share on other sites
Advertisement

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?

Share this post


Link to post
Share on other sites

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.

Edited by erm1

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!