Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / General Programming / Building a Graphics Library in Visual Studio Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
RussTaylor

March 19, 2005, 07:30 PM

Hi all,

For my graphics module in uni we built a graphics library in Fedora Core 3, then make applications to use it. All in a text editor.

That was fine but I get on well with Visual Studio so I have decided to migrate to Windows with all the benefits of the debugger etc.

Last time I built a load of classes and then linked them all in a header file, then my makefile built me a library I could use because I edited .bashrc and I used the library namespace.

What is the Windows / VS.NET equivalent? Am I supposed to build a dll somehow and then link that into a VC++ console project? I'm confused, I've searched the forums and google but can't find anything obvious.

Thanks for your help :)

Russ

 
Reedbeta

March 19, 2005, 08:01 PM

When you make a Windows DLL, you have two options for using it in an application. You can programatically load the DLL, using LoadLibrary(), and then get function pointers to exported functions in it by using GetProcAddress(). The other option is to link with an implicit library, which is a LIB built automatically by the compiler alongside the DLL. Linking with this LIB gives you all the DLL functions and basically puts all the LoadLibrary/GetProcAddress stuff under the hood where you can't see it.

To create a DLL, you just have to choose the appropriate option in VS (in VS.NET 2003, it's a checkbox under the Win32 App wizard). Then you have to write a DllMain function, which is the WinMain of DLLs, and mark every function that you want exported as __declspecs(dllexport). More information is available in the MSDN, but this should give you a starting point.

 
This thread contains 2 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.