Solved

Linker Errors on Dialog Box

Posted on 1997-04-19
3
196 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

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

Suggested Solutions

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

828 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