?
Solved

Linker Errors on Dialog Box

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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

719 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