Click here to Skip to main content
15,884,629 members
Articles / Desktop Programming / WTL

Using a View (dialog) exported from a dynamically loaded DLL (SDI) in WTL

Rate me:
Please Sign up or sign in to vote.
3.00/5 (6 votes)
6 Oct 20034 min read 71.4K   1.5K   17  
An article on on how to load DLLs that export views (dialogs) into a SDI Application under WTL
// WTLDLG.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include "WTLDLG.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 function.
WTLDLG_API __stdcall void GetPlugin( IDLLFormView** ppOutput )
{
	//Note that error checking has been removed for clarity
	*ppOutput = new CReplaceFormView;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
Dave has been programming for the past 20+ years first on a variety of platforms and operating systems using various languages. As a hobbyist Dave cut his teeth on the Commodore Pet and the 64 coding in basic and then moving to 6502 ASM. Dave moved to the Amiga using 68000 ASM and then C. His knowledge of the C language offered the stepping stone for him to make his hobby his profession taking a position coding C on an AIX Unix platform. Since then he has worked on many flavors of Unix, QNX, Windows (3.11 – present), and has been coding games for his Pocket PC in his spare time.

Dave lives in Indiana with his two teenage daughters and two cats.

Comments and Discussions