Click here to Skip to main content
15,915,328 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Key handling in a windowless control [modified] Pin
Stephen Hewitt6-Jun-06 3:25
Stephen Hewitt6-Jun-06 3:25 
GeneralRe: Key handling in a windowless control [modified] Pin
TClarke6-Jun-06 3:40
TClarke6-Jun-06 3:40 
QuestionBandObject Question [modified] Pin
hung_ngole25-May-06 1:53
hung_ngole25-May-06 1:53 
QuestionSendMessage not working Pin
HarishDixit25-May-06 0:24
HarishDixit25-May-06 0:24 
AnswerRe: SendMessage not working Pin
Michael Dunn25-May-06 6:58
sitebuilderMichael Dunn25-May-06 6:58 
QuestionCustom Frame Window Pin
HakunaMatada24-May-06 21:22
HakunaMatada24-May-06 21:22 
AnswerRe: Custom Frame Window Pin
wpapers19-Aug-06 23:24
wpapers19-Aug-06 23:24 
QuestionSteps to create a simple ATL DLL using the VS2005 AppWizard... Pin
Defenestration23-May-06 15:57
Defenestration23-May-06 15:57 
I found an article on CP, "How to write a Super compact Super Fast C++ Dll for Visual Basic" which explains how to use ATL to create a DLL.

When I use the VS 2005 AppWizard to create an ATL DLL, it ends up creating a lot more files in the Solution Explorer than are present in the sample project from the article I mention. For example, after using the AppWizard I end up with the following in the Solution Explorer Treeview:

http://img130.imageshack.us/img130/5752/testatldllsolutionexplorer1hn.png[^]

whereas the sample project only has the following in the Solution Explorer Treeview:

http://img442.imageshack.us/img442/7792/tvb4jn.png[^]


I'm guessing the difference is probably because the sample file project was created in VC++ 6.

In the example project, the automatically created functions:

DllCanUnloadNow
DllGetClassObject
DllRegisterServer
DllUnregisterServer

have been commented out in tvb.cpp and the entries removed from tvb.def, but in the VS 2005 project they are not commented out and the entries are still in the .def file. The sample project also has the following line commented out in tvb.idl:

//import "ocidl.idl"

What does this line do, and what does the line import "oaidl.idl" do ?


All I want to do is create a DLL which exports my own functions. For example, AddTwoInts(int a, int b).

1) Of the automatically generated files from the VS 2005 ATL AppWizard, what can be safely deleted ?

2) Once that's done, do I only need to add the following to the end of ATL_Test_DLL.cpp

extern "C"
{
int__stdcall AddTwoInts( int a, int b )
{
return( a + b );
}
}

followed by adding the following to the end (ie. after the line with "EXPORTS") of ATL_Test_DLL.def

AddTwoInts


Do I need to do anything else ?
QuestionIE plugin Pin
hung_ngole22-May-06 15:41
hung_ngole22-May-06 15:41 
AnswerRe: IE plugin Pin
Michael Dunn23-May-06 6:35
sitebuilderMichael Dunn23-May-06 6:35 
GeneralRe: IE plugin Pin
hung_ngole24-May-06 6:55
hung_ngole24-May-06 6:55 
QuestionCOM+ noncreatable and IObjectContext Pin
sameeraperera21-May-06 18:00
sameeraperera21-May-06 18:00 
QuestionWhy different results in Debug and Release Modes Pin
NiceNaidu19-May-06 1:39
NiceNaidu19-May-06 1:39 
AnswerRe: Why different results in Debug and Release Modes Pin
toxcct22-May-06 7:07
toxcct22-May-06 7:07 
QuestionMemory problem Pin
bujji_bec18-May-06 21:33
bujji_bec18-May-06 21:33 
AnswerRe: Memory problem Pin
Maxwell Chen18-May-06 21:43
Maxwell Chen18-May-06 21:43 
GeneralRe: Memory problem [modified] Pin
bujji_bec21-May-06 19:47
bujji_bec21-May-06 19:47 
GeneralRe: Memory problem Pin
Maxwell Chen21-May-06 23:33
Maxwell Chen21-May-06 23:33 
AnswerRe: Memory problem Pin
Cedric Moonen18-May-06 23:43
Cedric Moonen18-May-06 23:43 
GeneralRe: Memory problem [modified] Pin
bujji_bec21-May-06 19:45
bujji_bec21-May-06 19:45 
AnswerRe: Memory problem Pin
Zac Howland22-May-06 9:32
Zac Howland22-May-06 9:32 
GeneralRe: Memory problem Pin
Cedric Moonen23-May-06 3:10
Cedric Moonen23-May-06 3:10 
GeneralRe: Memory problem Pin
Zac Howland23-May-06 3:29
Zac Howland23-May-06 3:29 
QuestionEdit control Pin
HarishDixit18-May-06 21:02
HarishDixit18-May-06 21:02 
AnswerRe: Edit control Pin
Michael Dunn19-May-06 7:28
sitebuilderMichael Dunn19-May-06 7:28 

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.