views:

168

answers:

1

I have been away from BCB for over five years, and now I am having a st00pid n00b moment.

I am using BCB, and using a VCL component package for which I have the Delphi source.

I want to comment out a few lines in the Delphi source of the component (to not add a few toolbars in a form's OnCreat()).

So, I comment it out, and the syntax highlighting shows it as a comment. I build my package, just to make sure it gets recompiled and my out-commenting didn't work.

I breakpoint on the line before, step and the code which is commented out in the edit is executed (as if it is picking up an old OBJ ?).

What's my checklist here?

The answer will be awarded to whoever leads me to that D'oh! moment. Thanks

+3  A: 

Well you're obviously linking to old code. You'll need to figure out what you're linking against and fix it.

  1. Does your application list the Delphi package in it's "Build with runtime packages" list? If so, you're linking to the code in the delphi package, re-build that. The file you're interested in is the "BPL" file (that's the file you need to rebuild). Sometimes packages automagically build themselves (if they're marked as "Always Build") - but you're talking about an Delphi package used by BCB, maybe the magic is not that strong.

  2. If you are not linking to the BPL then you're linking to the compiled version of the unit, a DCU or an OBJ, I don't work with BCB so I can't tell. Is the PAS file part of your project? If it's not part of your project then you're using the compiled unit and, as far as the IDE is concerned, you happen to be looking at a text file that has the same name as your compiled file (DCU or OBJ). Add the file to the project!

  3. Is BCB actually capable of compiling PAS files? If it's not then you'd need to compile the PAS file using it's native compiler (Delphi). Maybe you've got a C++ only BCB that can't compile PAS files? Not sure such a version exists, but then again I've only been exposed to Delphi-only or RAD Studio environments.

Cosmin Prund
+1, but re item 2: No need to add the unit to the project. It should be enough to make sure the Source or the correct DCU is on the search path.
Ulrich Gerhardt
Yes, BCB has a pascal (Delphi) compiler built in.
Mawg
Mawg
2) I doubt that I have to the project, just make sure it is in the include path and include its header file. What's a DCU? Anyway, I only have one and it's where it ought to be. One .OBJ in the same dir. I delete and rebuild, still have a problem. Grrrrr!!! I know I am making some st00pid n00b mistake
Mawg
3) Yes, BCB has a pascal (Delphi) compiler built in
Mawg
@mawg: A DCU is the Delphi equivalent of a C++ OBJ file.
Ken White
I am going to award the answer for #1. TMS have backtracked. Now it seems I must reload the component project, edit code, build, then reload my own project and build.
Mawg