Solved

Linker Errors on Dialog Box

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

760 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

19 Experts available now in Live!

Get 1:1 Help Now