Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Making a MFC DLL  and using it

Posted on 2000-05-09
2
Medium Priority
?
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

661 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