The Artima Developer Community
Sponsored Link

.NET Buzz Forum
VC++ New DLL project humor

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Frans Bouma

Posts: 265
Nickname: fbouma
Registered: Aug, 2003

Frans Bouma is a senior software engineer for Solutions Design
VC++ New DLL project humor Posted: Jun 19, 2004 3:37 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Frans Bouma.
Original Post: VC++ New DLL project humor
Feed Title: Frans Bouma's blog
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/fbouma/Rss.aspx
Feed Description: Generator.CreateCoolTool();
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Frans Bouma
Latest Posts From Frans Bouma's blog

Advertisement

I started a little C++ Dll test project this morning and a good start for that is to fire up VS.NET 2003, create a new Win32 project and specify that it is a DLL.

VS.NET creates an initial .cpp file for you with some plumbing code. Here's the code it generated, no editing has been done on my part:

// TestLibrary.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include "TestLibrary.h"
BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved)
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
    return TRUE;
}

// This is an example of an exported variable
TESTLIBRARY_API int nTestLibrary=0;

// This is an example of an exported function.
TESTLIBRARY_API int fnTestLibrary(void)
{
	return 42;
}

// This is the constructor of a class that has been exported.
// see TestLibrary.h for the class definition
CTestLibrary::CTestLibrary()
{ 
	return; 
}
Now, take a good look at function 'fnTestLibrary'. . It's always good to see there are still developers with a good sense of humor around

Read: VC++ New DLL project humor

Topic: RSS Feed to dasBlog Content Converter Previous Topic   Next Topic Topic: Blog Roller?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use