Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / April 2006

Tip: Looking for answers? Try searching our database.

DLL design question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bit byte - 30 Apr 2006 06:19 GMT
I have an application which consists of several (approx 40 C/C++ dlls).
     I want to provide a C (Win32 Dll) API to these Dlls. However, I
want to partion the API at a different level of abstraction. I need som
advice on the best practise on doing this. the following may help
explain the situation better:

'Core' Low level C/C++ DLLs
=============================
foo_1.dll
foo_2.dll
foo_3.dll
foo_4.dll
foo_5.dll
foo_6.dll
foo_7.dll
foo_8.dll
foo_9.dll
foo_10.dll
...

Higher level 'C' Win32 Dll public 'C' Interface
================================================
foobar_1.dll  (uses functions exported in foo_1.dll, foo_3.dll and
foo_8.dll)
foobar_2.dll  (uses functions exported in foo_7.dll and foo_8.dll)
foobar_3.dll  (uses functions exported in foo_3.dll, foo_4.dll and
foo_5.dll)

... etc

I know I'll have to use DllLoad and GetProcAddress() etc (at least I
think I know that is ONE option), but I would be grateful if someone
could provide more details on the best way to do this (i.e. expose a
higher level abstraction C DLL)
William DePalo [MVP VC++] - 30 Apr 2006 15:15 GMT
> 'Core' Low level C/C++ DLLs
> =============================
[quoted text clipped - 24 lines]
> provide more details on the best way to do this (i.e. expose a higher
> level abstraction C DLL)

Forget for a minute the implementation detail that your functions are in
libraries called DLLs. Just think in terms of functions and libraries. If
your 'application' that resides in 'foobar_1.dll' calls a function in
another library 'foo_1.dll', all that you need to do is to add the library
to the linker input for your application so that the references may be
resolved.

Where DLLs are concerned, the 'libraries' used to build are called 'import
libraries'. Using the IDE, the linker creates them automatically for you.

So, build your low level projects. Then create projects for your higher
level interfaces. Add the relevant low level import libraries to those
projects.

Regards,
Will

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.