Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 131,538 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,208 people online right now. Registration is fast and FREE... Join Now!




How To Create Libraries and DLLs

 
Reply to this topicStart new topic

How To Create Libraries and DLLs, c++

NyeNye
post 12 Oct, 2006 - 08:58 PM
Post #1


D.I.C Head

**
Joined: 24 Sep, 2006
Posts: 248


My Contributions


is there a possible to do a liblary or a DLL with c++


and how??


is there a tutorials with that
User is offlineProfile CardPM

Go to the top of the page


gregoryH
post 13 Oct, 2006 - 12:58 AM
Post #2


D.I.C Regular

Group Icon
Joined: 4 Oct, 2006
Posts: 417



Dream Kudos: 50
My Contributions


in short.. yes...

its a little dependent on the compiler, but many have pre-formatted projects that start you off
User is offlineProfile CardPM

Go to the top of the page

born2c0de
post 13 Oct, 2006 - 09:59 AM
Post #3


printf("I'm a %XR",195936478);

Group Icon
Joined: 26 Nov, 2004
Posts: 3,895



Thanked 34 times

Dream Kudos: 2800

Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions


Yes, it is possible.

I was planning on writing a tutorial for this, but it's not complete yet.
So I've attached some code that shows you how DLL's can be written in C and used in VB.


Hope this helps.
Feel free to post again if you have any queries.

Attached File  dll_make.zip ( 55.89k ) Number of downloads: 61
User is offlineProfile CardPM

Go to the top of the page

gregoryH
post 13 Oct, 2006 - 01:53 PM
Post #4


D.I.C Regular

Group Icon
Joined: 4 Oct, 2006
Posts: 417



Dream Kudos: 50
My Contributions


QUOTE(NyeNye @ 12 Oct, 2006 - 09:58 PM) *

is there a possible to do a liblary or a DLL with c++


and how??


is there a tutorials with that


Here is an outline of a DLL... you can write one using this in you C/C++ compiler
CODE
BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                       DWORD reason        /* Reason this function is being called. */ ,
                       LPVOID reserved     /* Not used. */ )
{
    switch (reason)
    {
      case DLL_PROCESS_ATTACH:
        break;

      case DLL_PROCESS_DETACH:
        break;

      case DLL_THREAD_ATTACH:
        break;

      case DLL_THREAD_DETACH:
        break;
    }

    /* Returns TRUE on success, FALSE on failure */
    return TRUE;
}


Any program in C/C++ must have a "main" function, in the case of the DLL the DllMain is the entry point that windows uses to launch your code.

This post has been edited by gregoryH: 13 Oct, 2006 - 01:54 PM
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/20/08 01:51AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month