I am a beginner in this area. Hope someone find time to help me.
I created a MFC dll. In that dll I inserted one resource which is a
dialog box and I associated a class CPicDlg with it. In this dialog box

a calender and a bitmap is shown.

# What I found was even this is a dll , its not exporting anything.
So should I explicitly mention the things I want to expose.
So what I have done is, I created a new function OpenDialog() and
exported it as shown. and in that function I wrote as
CPictureApp theApp;
So in the constructor of the application class, CPictureApp
I tried to initiate , show the dialogbox in my dll as CPicDlg picdlg.
(Dialog is not being displayed with this code only. but If I give
picdlg.domodal() then its showing the dialogbox but the error is also
being displayed offcourse when I link this dll with the other exe file)

WHy. What is the correct method to display dialog from dll (when linked

) which has only dialog resource .

// TODO: add construction code here,
CPicDlg picdlg;


__declspec (dllexport) int OpenDialog()
CPictureApp theApp;
return true;


# I have few doubts about how to link this MFC Dll with MFC application

I created an MFC exe project. In my projects settings mentioned the lib

file also copied the lib and dll to the folder of my exe project.
mentioned the include path.

Now in my dll the function OpenDialog was exposed as
__declspec (dllexport) int OpenDialog();

How this function should be mentioned in the exe projects' header file.

should it have same syntax or should it be like with import..

__declspec (dllimport) int OpenDialog();