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

x
?
Solved

Linker Errors on Dialog Box

Posted on 1997-04-19
3
Medium Priority
?
201 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 200 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

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…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

824 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