Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Making a MFC DLL  and using it

Posted on 2000-05-09
2
Medium Priority
?
173 Views
Last Modified: 2010-04-02
I have constructed an MFC DLL. It is having a single function DisplayDialog, which will display a dialog box.
To use this dll I have built a new Win32 Application project and add a file to the project which contains:
<#include windows.h>
extern int DisplayDialog();
main()
{
 DisplayDialog();
}
I have copied the dll in the windows system directory, and add the .lib file in the project link setting.
While building the project It is giving an error "unresolved external symbol _WinMain@16"
How to correct this.
0
Comment
Question by:mtushar
2 Comments
 
LVL 1

Accepted Solution

by:
ZivKatzir earned 150 total points
ID: 2791596
when you create a win32 application you should use WinMain() and not main().

Try using the wizard for creating a simple hallow world win32 application. you'll find that a win32 application has some more default functions. Those functions deals with creating the main window and proccessing the windows messages sent to the app.

After you look at the source generated by the wizard, switch the "Hellow world" line with a call for your dialog.

At last you can gently clean up the functionalities you do not need.
0
 

Author Comment

by:mtushar
ID: 2791844
Thanx
Just now I have tested, its working fine.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question