Click here to Skip to main content
15,899,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to prevent power off from the power button Pin
nadzzz1-May-06 11:12
nadzzz1-May-06 11:12 
AnswerRe: How to prevent power off from the power button Pin
Michael Dunn1-May-06 13:27
sitebuilderMichael Dunn1-May-06 13:27 
AnswerRe: How to prevent power off from the power button Pin
Hamid_RT1-May-06 18:16
Hamid_RT1-May-06 18:16 
QuestionFile operations in OO c++ Pin
peruv1-May-06 11:10
peruv1-May-06 11:10 
AnswerRe: File operations in OO c++ Pin
Joe Woodbury1-May-06 18:11
professionalJoe Woodbury1-May-06 18:11 
GeneralRe: File operations in OO c++ Pin
Maxwell Chen1-May-06 18:23
Maxwell Chen1-May-06 18:23 
AnswerRe: File operations in OO c++ Pin
oldmirco2-May-06 17:57
oldmirco2-May-06 17:57 
Questionpb with project wizard for DLL (VS6 / VS .NET 2003) Pin
Tnarol1-May-06 10:58
Tnarol1-May-06 10:58 
Hi,

I'm trying to follow the example described at http://www.codeproject.com/dll/XDllPt1.asp to create and use the contents of a DLL from a VC++ application. Problem is that i'm using Visual Studio .NET 2003 instead of Visual Studio 6 in the example.

It seems my project wizard does not have the "Win32 Dynamic Link Library" option. The only kind of project that look like a DLL is named "MFC DLL" and has 3 possible options. 2 of them create an instance of a class that derives from CWinApp and I guess I don't want that. The last option creates a project with a DllMain entry point (just like the example) but there are also some differences (see cpp file below).

So I'm wondering if I can get VS .NET 2003 to behave as VS 6 does (something I didn't see in the project wizard or in the installation setup) or if I must go on using the provided template (meaning there are some good reasons why the template file for a dll has changed in VS .NET 2003).

Thanks for your help.


cpp template file :

#include "stdafx.h"
#include <afxdllx.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

static AFX_EXTENSION_MODULE testdll02DLL = { NULL, NULL };

extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Remove this if you use lpReserved
UNREFERENCED_PARAMETER(lpReserved);

if (dwReason == DLL_PROCESS_ATTACH)
{
TRACE0("testdll02.DLL Initializing!\n");

// Extension DLL one-time initialization
if (!AfxInitExtensionModule(testdll02DLL, hInstance))
return 0;

// Insert this DLL into the resource chain
// NOTE: If this Extension DLL is being implicitly linked to by
// an MFC Regular DLL (such as an ActiveX Control)
// instead of an MFC application, then you will want to
// remove this line from DllMain and put it in a separate
// function exported from this Extension DLL. The Regular DLL
// that uses this Extension DLL should then explicitly call that
// function to initialize this Extension DLL. Otherwise,
// the CDynLinkLibrary object will not be attached to the
// Regular DLL's resource chain, and serious problems will
// result.

new CDynLinkLibrary(testdll02DLL);

}
else if (dwReason == DLL_PROCESS_DETACH)
{
TRACE0("testdll02.DLL Terminating!\n");

// Terminate the library before destructors are called
AfxTermExtensionModule(testdll02DLL);
}
return 1; // ok
}
QuestionDDX_FieldText and CTime Pin
SwordeR1-May-06 10:53
SwordeR1-May-06 10:53 
AnswerRe: DDX_FieldText and CTime Pin
David Crow2-May-06 3:19
David Crow2-May-06 3:19 
GeneralRe: DDX_FieldText and CTime Pin
SwordeR2-May-06 10:06
SwordeR2-May-06 10:06 
QuestionDouble Manipulation Pin
Jader891-May-06 10:50
Jader891-May-06 10:50 
GeneralRe: Double Manipulation Pin
Jader891-May-06 11:13
Jader891-May-06 11:13 
GeneralRe: Double Manipulation Pin
Jörgen Sigvardsson1-May-06 11:37
Jörgen Sigvardsson1-May-06 11:37 
AnswerRe: Double Manipulation Pin
Stephen Hewitt1-May-06 13:43
Stephen Hewitt1-May-06 13:43 
AnswerRe: Double Manipulation Pin
Maxwell Chen1-May-06 22:19
Maxwell Chen1-May-06 22:19 
AnswerRe: Double Manipulation Pin
David Crow2-May-06 3:24
David Crow2-May-06 3:24 
Questionhelp: RH 3D graphics in LH display (DirectX) Pin
nastyimp131-May-06 7:27
nastyimp131-May-06 7:27 
QuestionMFC Inheritance Pin
cmdill1-May-06 3:03
cmdill1-May-06 3:03 
AnswerRe: MFC Inheritance Pin
Hamid_RT1-May-06 3:47
Hamid_RT1-May-06 3:47 
AnswerRe: MFC Inheritance Pin
David Crow1-May-06 5:58
David Crow1-May-06 5:58 
AnswerRe: MFC Inheritance Pin
Nibu babu thomas1-May-06 17:23
Nibu babu thomas1-May-06 17:23 
AnswerRe: MFC Inheritance Pin
Hamid_RT1-May-06 18:10
Hamid_RT1-May-06 18:10 
Question2 C++ game developer positions for HullBreach Pin
hullbreach1-May-06 2:09
hullbreach1-May-06 2:09 
AnswerRe: 2 C++ game developer positions for HullBreach Pin
Ryan Binns1-May-06 14:08
Ryan Binns1-May-06 14:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.