Solved

Linker Errors on Dialog Box

Posted on 1997-04-19
3
195 Views
Last Modified: 2013-12-04
I am running Borland 4.52 in Win95. I have written windows apps in Turbo C++ before but am trying to learn OWL classes.
There are 2 problems and may be related.
1) I declared a dialog box
class Dialog_1 : public TDialog
{ public:
    Dialog_1(TWindow *parent, TRedId, resId,
             TModule = 0 );
    ~Dialog_1();
}
I execute the dialog box
void SchedMainWindow::cmSched()
{
  if(new Dialog_1(this, ID_PLAYERS)->Execute() == IDOK);
}

The code compliles but gets linker error - undefined symbol Dialog_1::Dialog_1(etc...).
2) Now, I also tried to do a strcat to put a title on the main window title bar. I get an error msg stating the declaration is obsolete. the problems may be related. the includes are correct.
0
Comment
Question by:dutch
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 100 total points
ID: 1334661
Your if statement is just about _the_ most obfuscated C++ I've ever seen.

Anyway, your linker error is because the linker can't find the implementation of your Dialog_1() constructor.  You've either not coded it, or you've not linked to the module which has the implementation in your project.

You probably should ask a separate question for your #2 problem. You'll need to show us your code so we can even guess at what you might've done wrong.

.B ekiM

0
 

Author Comment

by:dutch
ID: 1334662
Your answer did fix my probelm. I'm not sure that the tone of your note is all that helpful. The IF statement you find so confusing is pretty much standard windows code to execute a dialogue box, its right out of the test book. If I submit a second question, I would hope that you do more than guess at the problem since this process costs me points...
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1334663
I don't find the statement confusing at all; it's just bad C++.  If operator new() returns NULL, your program will crash because you haven't afforded yourself the luxury of handling the situation.

You don't need the if() statement anyway, since you don't have a conditional statement before the semicolon.

.B ekiM

0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

813 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