I would like to create a dll (lets call it newHD.dll) that imports functions from an existing dll (called hd.dll).
I have been reading literature on creating dlls but most of what I have found explains how to create a single dll that exports functions, and the end-application which imports them.
Is it possible to write in newHD.c something like:
where functionA() belongs to hd.dll? And is then exported from newHD.dll? Or is there some other way of doing this?
My intention is to create this newHD.dll that encompasses the functions from hd.dll and also exports a few additional functions (not included in hd.dll) which I need to use for callbacks.
Though it's really possible by creating .def file of slightly different syntax, I cannot see any sense in practicing this approach. In no way this eliminates the need in hd.dll itself. So, what is your main idea behind this?
The main reason I want to work with a dll is because I need to work with LabVIEW. I want to create a library node in LabVIEW and call the dll functions from there, but some of the functions in hd.dll take function pointers as parameters. The function pointers I need to pass point to my user-defined functions which are not defined in hd.dll.
From what I understand I could then implement callbacks since the user-defined functions I need would be contained in newHD.dll.
Sorry, but I still cannot get the origins of your problem. Maybe your explanation is not clear enough. You definitely may create your newHD.dll with any functions you need. And your dll may import from any dll including hd.dll, as well as function implemented in hd.dll can accept a function pointer implemented anywhere including any other dll or main exe. Maybe your vision of the dependencies is somewhat overcomplicated?
The main reason I want to work with a dll is because I need to work with LabVIEW.
I don't know what LabVIEW is and how this need stipulates creation of a dll. But I definitely know what dlls are and how they work with each other. All you explanations sound totally unclear, that makes me think you build your design castle on a sand. Try to be more abstract and remove all unnecessary details (like LabVIEW) from your theory. Try to think only in categories of functions, modules, callbacks. And start from building void modules that implement only the main concept. After succeeding, with this new experience it would be much easier to get back to your particular task.