Solved

Making a MFC DLL  and using it

Posted on 2000-05-09
2
159 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 50 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now