Help me start setting up very old Borland C++ project using C++ Builder

Hi,

I am very new to this both C++ and C++ Builder community. My questions may sound silly but they are not to me.

I have been assigned to modify a very old project with the code library. I do not have any system/builder information like what compiler and interfaces or any third party assemblies this project incorporated with. All I have is the list of .cpp, .dfm, .obj and .h files. By this list I assumed this project should have been compiled in C++ compiler. 

So I have downloaded the free Borland C++ compiler and installed it. After setting up the compiler I did try compiling my program from the command prompt. I received so many errors... also found it very difficult to work with dos prompt as a long time MSDN user.

So I have downloaded your C++ builder trial version, opened my project inside the builder (by opening "myproject.bpr"), I was very please tosee all my project files are included under the project and literally celebrating the success. It is big achievement to me after all these struggle...

Now I build the project and started receiving errors one by one. I am finding it hard to find any help on these errors. For example, one of the error is,

"Unable to open include file 'NMUUE.hpp" 

I am not sure this comes with C++ compiler or not. and also not sure how to fix this.. 

Instead of banging my head like this forever, I would like to learn appropriately. 

I want to know what am I missing in order to set up the project and How to proceed from here. Please some one help me where to start and how to proceed. 

Please atleast point me to some article or tutorial where I can learn these and also any help on the above mentioned error will be great!!

Thanks
Renu
1
Renukadevi
2/3/2012 2:03:58 AM
embarcadero.cppbuilder.ide 2180 articles. 1 followers. Follow

22 Replies
5560 Views

Similar Articles

[PageSpeed] 3
Get it on Google Play
Get it on Apple App Store

Hi Renukadevi

Renukadevi Padhmanaban wrote:

> Hi,

> So I have downloaded your C++ builder trial version, opened my project inside 
> the builder (by opening "myproject.bpr"), 

if You look inside the .bpr file You can see which version of C++Builder
that was used like in the start of this bpr file:

<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
  <MACROS>
    <VERSION value="BCB.05.03"/>

 
> "Unable to open include file 'NMUUE.hpp" 

That file exists in my C++Builder 5, I don't know the file, but it seem 
to be related to  Base64Decode and POP3.
The file do no longer exist C++Builder now uses other component for base64
and pop3.

To upgrade an old project:

Start a new project from scratch do a save all to a new folder.
Copy all the cpp h and dfm files from the old project to the new directory.
Add all the cpp files to the new project, using the project manager.
Compile 
Start fixing Ansi to unicode and other errors.

 
Best regards
Asger-P
0
Asger
2/3/2012 9:02:38 AM
<Renukadevi Padhmanaban> wrote in message 
news:442832@forums.embarcadero.com...
> Hi,
>
> So I have downloaded your C++ builder trial version, opened my project 
> inside the builder (by opening "myproject.bpr"), I was very please tosee 
> all my project files are included under the project and literally 
> celebrating the success. It is big achievement to me after all these 
> struggle...
>
> Now I build the project and started receiving errors one by one. I am 
> finding it hard to find any help on these errors. For example, one of the 
> error is,
>
> "Unable to open include file 'NMUUE.hpp"
>
>
> Please atleast point me to some article or tutorial where I can learn 
> these and also any help on the above mentioned error will be great!!
>

FWIW
1) It appears that file last came with C Builder 6, but was not present in 
bds2006 or rs2007 (nor presumably later versions.)

2)When I bought XE, it was possible to request various older versions - 
among them was C Builder 6.  If that policy still exists for XE2, then you 
might be able to purchase XE2, then request the serial-number/license for 
the older version C Builder 6, download it from Embarcero and install, and 
just build your project as is.

3)I don't know what the "budget" is for modifying the program... but, it 
might be worth considering that purchase
(it sounds like you don't have the original development product available 
any more),
with the possibility (mind you I can't guarantee it) that the project will 
simply build correctly with CBuilder 6.
This might be far faster, and more reliable, and possibly cheaper (for labor 
involved),
than attempting to convert a project that you can't currently build and 
"poke at" to see what
happens when you make changes.
0
david
2/3/2012 2:34:09 PM
Thanks Asger,

I have confirmed that the application was built using BCb.05.03. Thanks for the help to know this basic information.

I have tried both ways, adding a new project and adding all existing cpp files and as well as openign the existing project, both compilation gives me the same error on NMUUE header. Obviously this is missing and now I am trying to find a way to get this header file as per David's advice.

If that doesnt work I may need to change code to use right header from current version of c++ builder to decoding functionality.

Thanks for your reply that sure gave me hope in my current project.

Renu
0
Renukadevi
2/6/2012 1:36:51 AM
Thanks David,

I have enquired and confirmed that I can still get the older version of the Builder (on request) including C++ builder 6 when I purchase the XE license. I hope this will solve the problem.. 

Thanks for pointing me the options.. you saved lot of my time.

Renu
0
Renukadevi
2/6/2012 1:45:04 AM
Hi,

Honestly I believe that going back to an ancient compiler is a VERY BAD idea, because it will stay stuck 12-15 years ago and not cope with the Win evolution (to 64 bits one day, for instance).
I had a similar problem porting BCB 5 code to the latest XE2. It was rather painful (mostly of the Unicode in all VCL), but I now have projects that will survive the next decades.

I didn't have a problem with missing headers, but there is an obvious resolution to that:
- comment OUT the #include clause
- try to build: chances are that the compiler will complain about undefined symbols (functions, variables)
- scan the include directories in your new compiler environment and find out which headers contain the missing symbols nowadays
- #include the new headers and rebuild.

Good luck,

Emanuel
0
Emanuel
2/10/2012 5:20:53 PM
On 2/2/2012 8:03 PM, Renukadevi Padhmanaban wrote:
> Hi,
>
> I am very new to this both C++ and C++ Builder community. My questions may sound silly but they are not to me.
>
> I have been assigned to modify a very old project with the code library. I do not have any system/builder information like what compiler and interfaces or any third party assemblies this project incorporated with. All I have is the list of .cpp, .dfm, .obj and .h files. By this list I assumed this project should have been compiled in C++ compiler.
>
> So I have downloaded the free Borland C++ compiler and installed it. After setting up the compiler I did try compiling my program from the command prompt. I received so many errors... also found it very difficult to work with dos prompt as a long time MSDN user.
>
> So I have downloaded your C++ builder trial version, opened my project inside the builder (by opening "myproject.bpr"), I was very please tosee all my project files are included under the project and literally celebrating the success. It is big achievement to me after all these struggle...
>
> Now I build the project and started receiving errors one by one. I am finding it hard to find any help on these errors. For example, one of the error is,
>
> "Unable to open include file 'NMUUE.hpp"
>
> I am not sure this comes with C++ compiler or not. and also not sure how to fix this..
>
> Instead of banging my head like this forever, I would like to learn appropriately.
>
> I want to know what am I missing in order to set up the project and How to proceed from here. Please some one help me where to start and how to proceed.
>
> Please atleast point me to some article or tutorial where I can learn these and also any help on the above mentioned error will be great!!
>
> Thanks
> Renu
DO NOT USE the old CBuilder compiler --- create a new project, then 
click add to project and load the c++ files...click make...the Ansi to 
Unicode issue is quite minor...relatively easy when compared to trying 
to get CB 5 or 6 to work....I'd wait a while on buying XE -- lots of bad 
stuff going on it ... read posts for last 30 days....CB 5 & 6 were 
issued in the last days of Borland....Baddddd.....CB 7 and CG2010 are 
very stable.
0
charles
2/12/2012 2:46:29 PM
Hi charles

charles leggette wrote:

> DO NOT USE the old CBuilder compiler --- create a new project, then 
> click add to project and load the c++ files...click make...the Ansi to 
> Unicode issue is quite minor...relatively easy when compared to trying 
> to get CB 5 or 6 to work....I'd wait a while on buying XE -- lots of bad 
> stuff going on it ... read posts for last 30 days....CB 5 & 6 were 
> issued in the last days of Borland....Baddddd.....CB 7 and CG2010 are 
> very stable.

I do not disagree with You on the point that it's probably better to go
forward then it is to go backward, but when You say "Baddddd" about
BCB5 I have to disagree. BCB5 have been the most stable compiler I have
used and its IDE don't have a huge amount of scaling bugs like the newer 
versions.
I only do small app's and components, so I have not pushed its limits at 
all, but from my point of view I have to disagree with You.

I still have BCB5 installed and I still use it, now on win7 64. 


Best regards
Asger-P
0
Asger
2/12/2012 3:16:18 PM
On 2/12/2012 9:16 AM, Asger Joergensen wrote:
> Hi charles
>
> charles leggette wrote:
>
>> DO NOT USE the old CBuilder compiler --- create a new project, then
>> click add to project and load the c++ files...click make...the Ansi to
>> Unicode issue is quite minor...relatively easy when compared to trying
>> to get CB 5 or 6 to work....I'd wait a while on buying XE -- lots of bad
>> stuff going on it ... read posts for last 30 days....CB 5&  6 were
>> issued in the last days of Borland....Baddddd.....CB 7 and CG2010 are
>> very stable.
>
> I do not disagree with You on the point that it's probably better to go
> forward then it is to go backward, but when You say "Baddddd" about
> BCB5 I have to disagree. BCB5 have been the most stable compiler I have
> used and its IDE don't have a huge amount of scaling bugs like the newer
> versions.
> I only do small app's and components, so I have not pushed its limits at
> all, but from my point of view I have to disagree with You.
>
> I still have BCB5 installed and I still use it, now on win7 64.
>
>
> Best regards
> Asger-P
Asger, I think that's terrific....for such a very limited 
environment---I wish the IT world was in synch with you...regrettably we 
are using unicode, updating the third party controls and libs and 
connecting with iPhones, Androids and MS VS 2010+[.Net]...and using AJAX 
in Intraweb...
0
charles
2/12/2012 4:13:58 PM
Hi charles

charles leggette wrote:

> Asger, I think that's terrific....for such a very limited 
> environment---I wish the IT world was in synch with you...regrettably we 
> are using unicode, updating the third party controls and libs and 
> connecting with iPhones, Androids and MS VS 2010+[.Net]...and using AJAX 
> in Intraweb...

Oooh, I know BCB5 have it's limitation and I also mainly use CB2009, but the
CB2009 IDE have so many Scaling bugs, that it is difficult to use, these bugs
have as far as I know not been fixed yet, event though they have been around
since CB2007. I also often get include errors (file not found) even though the
files are in path. The new Additional components in CB2009 also have serious 
scaling bugs.
So if I compare BCB5 and CB2009, I think BCB5 was a better product, but today
BCB5 is very, very old........ ;(  

 
Best regards
Asger-P
0
Asger
2/12/2012 4:45:57 PM
> Honestly I believe that going back to an ancient compiler is a VERY BAD idea, because it will stay stuck 12-15 years ago and not cope with the Win evolution (to 64 bits one day, for instance).

Speaking as someone who is currently trying to get unstuck (using BCB6, (c) 2002), this is much more easily said than done.  I've been fighting with tech support to even START getting my code to compile in C++Builder XE, while my 30-day eval burns away.  So Embarcadero is going to lose a sale and I am going to remain stuck 9+ years back, possibly forever.  If Embarcadero expects people to keep up, they should provide a lot better help in CATCHING up.

Edited by: Chris Chiesa on Feb 17, 2012 9:36 AM
0
Chris
2/17/2012 5:36:15 PM
> the Ansi to 
> Unicode issue is quite minor...relatively easy when compared to trying 
> to get CB 5 or 6 to work....

I find that incredibly difficult to believe.  I have been completely unable to make even the first tiny step toward getting BCB 6 code to compile with the 30-day trial of XE, and tech support has been incapable of doing anything but point me to the same document links that weren't helpful in the first place.

I don't care / understand what other string classes AnsiString or whatever "now map to" -- it's not even all that clear what "map to" MEANS -- but that's what the docs keep harping on, and never touching on what I need to know.  For example, I need to call GetFileInfo() which requires LPCTSTR (etc.) arguments, passing the executable name returned by Application->ExeName().  ExeName() used to return an AnsiString, whose c_str() method gave the needed argument for GetFileInfo() -- but now ExeName() returns 
a UnicodeString (or WideChar, or something; again, it's not clear) and its c_str() method now returns a WideChar* (or something), which is NOT a suitable GetFileInfo() argument.  

(I occasionally see references to "calling the Unicode versions of the Windows API functions," or words to that effect, but I have no idea what functions those would be or how to access them.  GetFileInfo() takes const char*, and that's that.  If there's a version that takes UnicodeString or somesuch, I don't know how to invoke it.)

I sent that GetFileInfo() -using code to Quinn Wildman, who made a few simple changes and sent it back, claiming it was fixed; only, it still wouldn't compile, giving the same error.  Clearly, he never even tried to compile it himself.  I wrote him a note saying, "it's still not fixed; it won't compile," and have heard nothing further from him.  I recently received an email asking me to fill out a survey about the call, so apparently he closed it without solving it.  

This is MY experience with ANSI-to-Unicode conversion.  If you can do better I'd love to hear from you.

> I'd wait a while on buying XE -- lots of bad 
> stuff going on it ... read posts for last 30 days....CB 5 & 6 were 
> issued in the last days of Borland....Baddddd.....CB 7 and CG2010 are 
> very stable.

I haven't seen this bad stuff, thanks for the warning.  Does it really do me (or the original poster here) any good to say CB 7 and CG2010 are better?  Can you still get them?  If so, how?
0
Chris
2/17/2012 5:47:00 PM
Hi Chris

Chris Chiesa wrote:

> I don't care / understand what other string classes AnsiString or whatever "now 
> map to"

You have to care if You want to upgrade and old BCB5 project to Unicode and You 
can learn to understand, but it doesn't help much to complain a lot. ;-)

 -- it's not even all that clear what "map to" MEANS 

It's a setting in the project options, which You probably already know.
What it does:
if Unicode is defined and TCHAR maps to are set to wchar_t the compiler
will automatically pick the functionnameW instead of the functionnameA
version of the function.

but in Your case with GetFileInfo it is different, because it is not a VCL
or Windows API function. I have no reference to that function name in my 
BCB5 and I only have one function by that name in my CB2009 in a SWSystem.hpp 
file, it is not in my help in any of my Builders.

so You option will be to give the function what it wants:

AnsiString(Application->Exename).c_str() 

will give You the exename as a char*

 
> (I occasionally see references to "calling the Unicode versions of the Windows 
> API functions," or words to that effect, but I have no idea what functions those 
> would be or how to access them.  GetFileInfo() takes const char*, and that's 
> that.  If there's a version that takes UnicodeString or somesuch, I don't know 
> how to invoke it.)

In most of the cases You can just add a W to the end of the function name
and You will get the unicode version of that function.

> This is MY experience with ANSI-to-Unicode conversion.  If you can do better I'd 
> love to hear from you.
> 
> I'd wait a while on buying XE -- lots of bad 
> stuff going on it ... read posts for last 30 days....CB 5 & 6 were 
> issued in the last days of Borland....Baddddd.....

I do not have that experience!!
My BCB5 is very stable and professional
 
> I haven't seen this bad stuff, thanks for the warning.  Does it really do me (or 
> the original poster here) any good to say CB 7 and CG2010 are better?  Can you 
> still get them?  If so, how?

 
If You buy XE2 You get the others for free, at least thats how it has been.
But You can probably also get them second hand. 

there is a unused BCB5 pro on ebay UK:
http://tinyurl.com/7t74d2u

but there is also some on ebay.com

 
Best regards
Asger-P
0
Asger
2/17/2012 6:47:55 PM
> {quote:title=Asger Joergensen wrote:}{quote}
> Hi Chris
> 
> Chris Chiesa wrote:
> 
> > I don't care / understand what other string classes AnsiString or whatever "now 
> > map to"
> 
> You have to care if You want to upgrade and old BCB5 project to Unicode and You 
> can learn to understand, but it doesn't help much to complain a lot. ;-)

Yeah...  Sorry about that.  I'm stalled/blocked on a couple of other BCB issues at the moment, that are eating up valuable time, and I was a bit... +aggravated+... when I wrote that post.  I should know better.
 
>  -- it's not even all that clear what "map to" MEANS 
> 
> It's a setting in the project options, which You probably already know.

Yes.

> What it does:
> if Unicode is defined and TCHAR maps to are set to wchar_t the compiler
> will automatically pick the functionnameW instead of the functionnameA
> version of the function.

Ah. I thought it was just a compile-time typedef.  I didn't know it would pick different function names.  This ties in to a long-standing question: I've occasionally seen sample code calling functions whose names are things I recognize but with A's on the ends.  Have Windows compilers (e.g. Microsoft's) always appended an A to what's-documented-and-what-you-write-in-your-code, to call a slightly-differently-named function under the hood?  If so, they must have anticipated the need for indirection such as 
we are now using.  Impressive.  Thanks for the clarification!

Incidentally, I've only been programming Windows "for a living" for about ten months; before that, my Windows programming experience consisted of a little messing around with Visual Studio / MFC back in the late 90s, "for fun."  It was "interesting" jumping right into Windows 98, Visual Studio, and MFC, without ever having used any of their predecessors; I was a character-cell-terminal, Emacs, Xwindows (at best) guy before that (and for another thirteen years thereafter, really).  So maybe some of the thi
ngs you're explaining are "common knowledge" in the Windows world; I wouldn't know.  I don't really have anybody else to talk to about this stuff.

> but in Your case with GetFileInfo it is different, because it is not a VCL
> or Windows API function. I have no reference to that function name in my 
> BCB5 and I only have one function by that name in my CB2009 in a SWSystem.hpp 
> file, it is not in my help in any of my Builders.

Oops...  In my haste I neglected to verify the function name against my source code when posting before.  Looking just now with intent to tell you where to find it, I see that it is actually *GetFileVersionInfo*.  Hopefully that helps.  Sorry to waste your time.  I guess I'm still a little agitated.

> 
> so You option will be to give the function what it wants:
> 
> AnsiString(Application->Exename).c_str() 
>
>will give You the exename as a char*

Well, yes, the whole idea is definitely to "give the function what it wants" -- it's just difficult to figure out what it wants and how to give it to it.  I've been fighting with compilers over matters like this for almost 25 years now; there are days when I miss assembler. :-)

Anyway -- between reading your remarks, and a little newly-enlightened fiddling with the code, I just now got it to work!

Here are some valuable lessons.

   1) AnsiString::c_str() nowadays actually returns WideChar* (a.k.a. wchar_t, I believe).  I discovered this a few weeks ago without finding the correct alternative.  Apparently it was done just in the latest revision, i.e. since 2009.  Quinn Wildman modified my original, non-compiling code by changing AnsiString usages to String, and that fixed the case I've been harping on; evidently String::c_str() still returns char*.  (I would never have come up with that as a solution, though, even after reading th
e documentation.  I never even knew String existed, let alone used it, until I started trying to unravel this Unicode stuff two-and-a-half weeks ago.)

   2) The documentation of GetFileVersionInfoSize(), GetFileVersionInfo(), and VerQueryValue() is misleading, at least to me; it documents several arguments as wanting LPCTSTR, which I've always understood to be const char*.  The compiler, however, indicated that they wanted const wchar_t* for those arguments.  Is there something I should know about LPCTSTR?

The last remaining build error as of ten minutes ago was that a call to VerQueryValue() had exactly the same problem: documented wanting LPCTSTR, compiler saying it wanted const wchar_t*.  I discovered the variable involved was still an AnsiString, changed it to String -- and now the code compiles!

It merely didn't work.  I only got the first character of the version string.  It turned out that the length-return argument of VerQueryValue() now returns length "in TCHARs," not in bytes or chars or whatever it did before.  As far as I'm concerned, a pointer ought to be a pointer ought to be a pointer (told you I miss assembler), but the fix was to change the type of the pointer involved, from void* to TCHAR*, and then cast it to (void*) in the call to VerQueryValue(), rather than the other way around. 
 Don't ask me why that worked; I still don't fully understand it; but I sure am proud of myself for figuring it out!

So maybe I can justify buying XE after all.  Oh, wait, it has problems they say.


> > (I occasionally see references to "calling the Unicode versions of the Windows 
> > API functions," ...
> 
> In most of the cases You can just add a W to the end of the function name
> and You will get the unicode version of that function.

And it now sounds as though the compiler will "sometimes" do this for me.  If not, at least I now have a better idea of possibilities to check when errors occur.

> > I'd wait a while on buying XE -- lots of bad 
> > stuff going on it ... read posts for last 30 days....CB 5 & 6 were 
> > issued in the last days of Borland....Baddddd.....
> 
> I do not have that experience!!
> My BCB5 is very stable and professional

I don't need older versions; I am already at BCB6 and trying to move forward.  

Incidentally, I have a few problems now and then with BCB6, but at least some of them are almost certainly due to running under the greatly heightened security paranoia of Windows 7 Professional 64-bit; some very ordinary things are extraordinarily difficult to do, in this environment.  Anyway, I get occasional access violations from the IDE itself.  Usually I can continue past them, save my work, exit-and-restart, but once in a while I get one that prevents the act of saving, itself, and I have to cut/pa
ste from the text editor to external files, then kill the process with Task Manager, then restart and copy/paste back in.  One thing that is definitely a security-paranoia issue is that in order to save projects in Borland\CBuilder\Projects I have to run BCB "As Administrator."  I'm hoping XE is better behaved.  Actually I'm hoping a lot of things for XE.

> > I haven't seen this bad stuff, thanks for the warning.  Does it really do me (or 
> > the original poster here) any good to say CB 7 and CG2010 are better?  Can you 
> > still get them?  If so, how?
>  
> If You buy XE2 You get the others for free, at least thats how it has been.

Interesting.  There's an XE +2+ ???  I hope that's a typo.   And I've seen "CG" 2010 a couple of times now; why CG and not CB?  Name change?

> But You can probably also get them second hand. 

I hadn't thought of that.  I will suggest that to my managers as a possible alternative; we're a very small company and saving money is good.

> Best regards
> Asger-P

Thank you very much; you may just have un-logjammed me in a big way.  I owe you one.

Chris
0
Chris
2/17/2012 10:17:04 PM
Hi Chris

Chris Chiesa wrote:

> Yeah...  Sorry about that.  

You are forgiven, I certainly know the feling. ;-)


> 1) AnsiString::c_str() nowadays actually returns WideChar* (a.k.a. wchar_t, I 
> believe). 

Wrong!
AnsiString::c_str() always return a char* 

because the internal storage of the ansistring is char* so when You call the
c_str() You get a pointer to the raw date in the class with an added \0
terminator.

> evidently String::c_str() still returns char*.  

That is true IF and ONLY IF You are using a compiler pre CB2009. CB2009 and
above are full unicode and in those, String::c_str() returns wchar_t*.

>  I never even knew String existed, let alone used it, until I 
> started trying to unravel this Unicode stuff two-and-a-half weeks ago.)

String have for many years been a shorthand for AnsiString or UnicodeString
depending on which compiler You ver using. 


> 2) The documentation of GetFileVersionInfoSize(), GetFileVersionInfo(), and 
> VerQueryValue() is misleading, at least to me; it documents several arguments as 
> wanting LPCTSTR, which I've always understood to be const char*.  The compiler, 
> however, indicated that they wanted const wchar_t* for those arguments.  Is 
> there something I should know about LPCTSTR?

that means You have "TCHAR maps to" set to wchar_t, then the widechar version
of the function is automatically called.

> I discovered the variable involved 
> was still an AnsiString, changed it to String -- and now the code compiles!

that because String automatically maps to UnicodeString and its c_str() gives
You a wchar_t* as mentioned earlier.

> It merely didn't work.  I only got the first character of the version string.  
> It turned out that the length-return argument of VerQueryValue() now returns 
> length "in TCHARs," not in bytes or chars or whatever it did before.

Kind of logic right. ;-)
now that it works in wchar_t it, returns the number of wchar_t and not the number 
of chars...


>  As far as I'm concerned, a pointer ought to be a pointer ought to be a pointer 

Then it is up hill for a while still, C++ is very strict when it comes t types
and there is a very good reason why. In C++ or C You can have arrays of any type
and You can use ++ on any kind of pointer (except void*), which makes it jump to 
the next in the array, as long as the compiler knows the type.

> So maybe I can justify buying XE after all.  Oh, wait, it has problems they say.

That would be XE2 if You buy now.
 
> 
> And it now sounds as though the compiler will "sometimes" do this for me.  

If You have set TCHAR map to wchar_t then Yes.

> Incidentally, I have a few problems now and then with BCB6, but at least some of 
> them are almost certainly due to running under the greatly heightened security 
> paranoia of Windows 7 Professional 64-bit; some very ordinary things are 
> extraordinarily difficult to do, in this environment.  

Such as ??

> Anyway, I get occasional 
> access violations from the IDE itself.  Usually I can continue past them, save 
> my work, exit-and-restart, but once in a while I get one that prevents the act 
> of saving, itself, and I have to cut/paste from the text editor to external files, 
> then kill the process with Task Manager, then restart and copy/paste back in.

You can set up the IDE to auto save files when ever You do a build or a Build file
I use the last all the time, to check my code ( Alt+F9 ). F9 to run the project.
You can set up auto save in Environment options, right-click in the editor click 
properties scroll to the top and check both in "Auto save options".
  
> One thing that is definitely a security-paranoia issue is that in order to save 
> projects in Borland\CBuilder\Projects I have to run BCB "As Administrator."  

> Interesting.  There's an XE +2+ ???  I hope that's a typo. 
  
No the last model is XE2.

And I've seen "CG" 2010 a couple of times now; why CG and not CB?  Name change?

I believe the CG stands for CodeGear but in my opinion it is still a CB

below is my code for using GetFileVersionInfoSize and VerQueryValue.

Best regards
Asger-P

{code:cpp}
String __fastcall VersionInfo(String AppName, const String QueryField)
{
    DWORD handle ; // Dummy, Windows does not use this parameter.
    DWORD size = GetFileVersionInfoSizeW (AppName.c_str (), &handle) ;
    if(size == 0)
       return L""; //No file information
 
    wchar_t *buffer = new wchar_t[size] ;
 
    bool status = GetFileVersionInfoW (AppName.c_str (), 0, size, buffer) ;
    if(! status)
    {
       delete[] buffer ;
       return L""; //No file information
    }
 
    // Extract the language ID
    UINT datasize ;
    unsigned short *translation ;
    status = VerQueryValueW( buffer,
                             L"\\VarFileInfo\\Translation",
                             (void **) &translation,
                             &datasize ) ;
 
    // Here we create a prefix string that is the same for all the keys.
    String prefix = L"\\StringFileInfo\\"
                    + String::IntToHex (translation [0], 4)
                    + String::IntToHex (translation [1], 4) ;
 
    wchar_t *data;
    UINT qDatasize ;
    String fullkey = prefix + L"\\" + QueryField ;
    status = VerQueryValueW(buffer, fullkey.c_str (), (void **) &data, &qDatasize) ;
 
    String Res = (status) ? String(data) : String(L"");
    delete[] buffer;
    return Res;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    String AppName = Application->ExeName;
    Memo1->Lines->Add( L"CompanyName = "      + VersionInfo( AppName, L"CompanyName" ) );
    Memo1->Lines->Add( L"FileDescription = "  + VersionInfo( AppName, L"FileDescription" ) );
    Memo1->Lines->Add( L"FileVersion = "      + VersionInfo( AppName, L"FileVersion" ) );
    Memo1->Lines->Add( L"InternalName = "     + VersionInfo( AppName, L"InternalName" ) );
    Memo1->Lines->Add( L"LegalCopyright = "   + VersionInfo( AppName, L"LegalCopyright" ) );
    Memo1->Lines->Add( L"LegalTrademarks = "  + VersionInfo( AppName, L"LegalTrademarks" ) );
    Memo1->Lines->Add( L"OriginalFilename = " + VersionInfo( AppName, L"OriginalFilename" ) );
    Memo1->Lines->Add( L"ProductName = "      + VersionInfo( AppName, L"ProductName" ) );
    Memo1->Lines->Add( L"ProductVersion = "   + VersionInfo( AppName, L"ProductVersion" ) );
    Memo1->Lines->Add( L"Comments = "         + VersionInfo( AppName, L"Comments" ) );
}
//---------------------------------------------------------------------------
{code}
0
Asger
2/17/2012 11:23:39 PM
Chris Chiesa <> wrote:

>I've been fighting with tech support to even START 
>getting my code to compile in C++Builder XE

I don't suppose that tech support will work too hard to provide
support for someone who has not purchased the current product, let
alone a support contract. Also, it's not really their job to teach you
how to write code that compiles.

Rather than going that route, I would suggest that you post here to
get help with the problems you are having. There are plenty of folks
here who have updated old projects to run properly in XE and XE2. I
even moved an old project developed in BC 5.02/OWLNExt directly to CB
XE, and have moved many other projects from earlier versions of
Builder.

Why not try posting an error message and the code that produces it and
people here can probably help you to get started. Most of the changes
are likely to be related to the change from AnsiString to
UnicodeString as the basic VCL string type, and the changes to you
code to accommodate that change in VCL are well understood and can
mostly be made by running a few search and replace actions on your
code base.

Other differences are include and library path changes, and the best
way to work around them is to start a new project in CB XE and import
the units from your old project into the new CB XE project. If you
instead import the entire project, you will have to spend some time
sorting out the paths to get it to compile.

 - Leo
0
Leo
2/20/2012 3:52:02 PM
> {quote:title=Asger Joergensen wrote:}{quote}
> > 2) The documentation of GetFileVersionInfoSize(), GetFileVersionInfo(), and 
> > VerQueryValue() is misleading, at least to me; it documents several arguments as 
> > wanting LPCTSTR, which I've always understood to be const char*.  The compiler, 
> > however, indicated that they wanted const wchar_t* for those arguments.  Is 
> > there something I should know about LPCTSTR?
> 
> that means You have "TCHAR maps to" set to wchar_t, then the widechar version
> of the function is automatically called.
> 
> > I discovered the variable involved 
> > was still an AnsiString, changed it to String -- and now the code compiles!
> 
> that because String automatically maps to UnicodeString and its c_str() gives
> You a wchar_t* as mentioned earlier.
> 
> > It merely didn't work.  I only got the first character of the version string.  
> > It turned out that the length-return argument of VerQueryValue() now returns 
> > length "in TCHARs," not in bytes or chars or whatever it did before.
> 
> Kind of logic right. ;-)
> now that it works in wchar_t it, returns the number of wchar_t and not the number 
> of chars...
> 
> 
> >  As far as I'm concerned, a pointer ought to be a pointer ought to be a pointer 
> 
> Then it is up hill for a while still, C++ is very strict when it comes t types
> and there is a very good reason why. In C++ or C You can have arrays of any type
> and You can use ++ on any kind of pointer (except void*), which makes it jump to 
> the next in the array, as long as the compiler knows the type.
> 

Having a similar issue.  I have a set of common code that uses GetFileVersionInfoSize, passing in an AnsiString::c_str() call for the first parameter.  In an application that was built in earlier versions of CBuilder and ported up to XE (several ports from CBuilder 6, originally), the code compiles and works properly.  Same code file pulled into a NEW XE Project fails to compile.  In the one that compiles, the code-completion signature for GetFileVersionInfoSize() indicates "const char * lptstrFileName" a
s the first parameter.  In the one that does not compile, it shows, "const wchar_t* lptstrFileName" as the first parameter and gives me an E2034 error.  Same (common) files, different projects.  In either, I cannot "Find Declaration" for the method to see what header file it is being declared in.

I don't understand why one would work and the other would not.  I've tried side-by-side project options comparisons and I believe they are identical but the problem persists.

Please help!

Jim
0
James
9/7/2012 1:21:39 PM
James wrote:

> Having a similar issue.  I have a set of common code that uses
> GetFileVersionInfoSize, passing in an AnsiString::c_str() call for the
> first parameter.  In an application that was built in earlier versions
> of CBuilder and ported up to XE (several ports from CBuilder 6,
> originally), the code compiles and works properly.

In CB2009 and later, that will only work if "TCHAR maps to" is set to "char" 
in the Project Options.  In CB2009, that was the default setting for new 
and migrated projects for backwards compatibility while people were migrating 
to Unicode.  By the time XE was released, the default setting had changed 
to "wchar_t" moving forward.

> Same code file pulled into a NEW XE Project fails to compile.  In the one
> that compiles, the code-completion signature for GetFileVersionInfoSize()
> indicates "const char * lptstrFileName" as the first parameter.


"TCHAR maps to" is set to "char".

> In the one that does not compile, it shows, "const wchar_t* lptstrFileName"
> as the first parameter and gives me an E2034 error.

"TCHAR maps to" is set to "wchar_t".  You have a few choices:

1) go into the Project Options and change "TCHAR maps to" to "char".  Just 
know that doing so will affect most Win32 API and C RTL function calls in 
your C++ code.  But if everything you are doing is based on AnsiString than 
it should be set to "char".

2a) stay with AnsiString but change your code to call GetFileVersionInfoSizeA(), 
GetFileVersionInfoA(), and VerQueryValueA() directly instead of GetFileVersionInfoSize(), 
GetFileVersionInfo(), and VerQueryValue() so TCHAR is not a factor.

2b) change your code to use UnicodeString in CB2009, then call GetFileVersionInfoSizeW(), 
GetFileVersionInfoW(), and VerQueryValueW() directly so TCHAR is not a factor.

3) change your code to use System::String instead, then you can use an #ifdef 
statement to check if _DELPHI_STRING_UNICODE is defined.  That will tell 
you whether System::String maps to AnsiString or UnicodeString, then you 
can call the A or W functions accordingly.

> I don't understand why one would work and the other would not.

Different project settings.

> I've tried side-by-side project options comparisons and I believe they are
> identical

They are not.

--
Remy Lebeau (TeamB)
0
Remy
9/7/2012 4:35:49 PM
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}

> 1) go into the Project Options and change "TCHAR maps to" to "char".  Just 
> know that doing so will affect most Win32 API and C RTL function calls in 
> your C++ code.  But if everything you are doing is based on AnsiString than 
> it should be set to "char".
> --
> Remy Lebeau (TeamB)

Thanks, Remy.  My only problem is that I have gone through the project options for my windows forms project and I cannot find such an option.  Can you point me in the right direction as far as which project options section/page that option should be located on?

Thanks,

Jim
0
James
9/7/2012 6:37:49 PM
James wrote:

> Thanks, Remy.  My only problem is that I have gone through the project
> options for my windows forms project and I cannot find such an option.

It is located in the "Project > Options > Directories and Conditionals" section.

You can also use the IDE's new "IDE Insight" feature to find settings when 
you don't know where they are located.

--
Remy Lebeau (TeamB)
0
Remy
9/7/2012 6:53:26 PM
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> James wrote:
> 
> > Thanks, Remy.  My only problem is that I have gone through the project
> > options for my windows forms project and I cannot find such an option.
> 
> It is located in the "Project > Options > Directories and Conditionals" section.
> 
> You can also use the IDE's new "IDE Insight" feature to find settings when 
> you don't know where they are located.
> 
> --
> Remy Lebeau (TeamB)

Awesome on all fronts!  Thanks again...that did the trick!

Jim
0
James
9/7/2012 7:29:06 PM
I am facing the same problem. I have an old Borland C++ project version bcb 5.03 and I have to build the code. I tried building it in Borland C++ Builder XE5, although I was able to open the project (.bpr) there are a lot of build errors. Some of the errors I have mentioned below:

[bcc32 Error] Cannot convert 'wchar_t *' to 'char *'
[bcc32 Error] Cannot convert 'char[128]' to 'const wchar_t *'
  
I am facing similar hundreds of issues throughout the project. Can someone please suggest me a solution to this. Am I using the correct Builder version or if the version of the code I have is at all compatible with XE5.

I could not find any of the old Borland Builder versions anywhere on the internet, the only free legal trial version I could find is C++ Builder xE5

Thanks
0
rashmi
4/1/2014 12:44:58 PM
rashmi wrote:

> I tried building it in Borland C++ Builder XE5, although I was able to
> open the project (.bpr) there are a lot of build errors.

It is not a good idea to open an older .bpr file in a newer IDE version. 
 The upgrade process rarely works correctly.  It is better to create a new 
project and then add your existing source files to it as needed.

> [bcc32 Error] Cannot convert 'wchar_t *' to 'char *' [bcc32 Error]
> Cannot convert 'char[128]' to 'const wchar_t *'

Prior to 2009, everything in the RTL/VCL was based on AnsiString, and UNICODE/_UNICODE 
were never defined for the Win32 and C runtime APIs (respectively), so all 
API calls used 'char'-based parameters.  Since 2009 onwards, everything in 
the RTL/VCL is now based on UnicodeString, and there is a Project Option 
named "TCHAR maps to" that specifies whether UNICODE/_UNICODE are defined 
or not.  By default, "TCHAR maps to" is set to "wchar_t" for new projects 
and "char" for migrated projects.  You must have it set to "wcar_t", which 
means all API calls will use 'wchar_t'-based parameters, which would account 
for the "cannot convert" errors.  You can set the "TCHAR maps to" option 
to "char" instead, which will resolve those errors.  However, the RTL/VCL 
will still be using UnicodeString instead of AnsiString (you cannot change 
that), so you may still run into Unicode migration issues.  You need to do 
a thorough review of your code's use of strings and migrate accordingly.

> I am facing similar hundreds of issues throughout the project.
> Can someone please suggest me a solution to this.

You are making a VERY large leap from a very old version to a very modern 
version, skipping years worth of migrations in between.  So you have your 
work cut out for you.  You need to perform a code review.

--
Remy Lebeau (TeamB)
0
Remy
4/1/2014 5:49:39 PM
Reply:

Similar Artilces:

Anyone want old Turbo Pascal, Turbo C/C++, Borland C++, C++Builder user manuals (paperback)?
Hi, I'm going to be moving in the next couple of months and I've got a bunch of old Turbo/Borland Pascal, Turbo/Borland C/C++, and C++Builder user manuals that I no longer have any use for. I am going to throw them into the recycle bin next week, UNLESS someone wants them. I will be glad to give them to anyone that wants them if you'll pay for shipping. I don't have a list of all the manuals yet (I still need to clean the garage), but if you are interested, let me know which manuals you might be interested in, and I'll let you know if I have them. The top ed...

Anyone want old Turbo Pascal, Turbo C/C++, Borland C++, C++Builder user manuals (paperback)?
Hi, I'm going to be moving in the next couple of months and I've got a bunch of old Turbo/Borland Pascal, Turbo/Borland C/C++, and C++Builder user manuals that I no longer have any use for. I am going to throw them into the recycle bin next week, UNLESS someone wants them. I will be glad to give them to anyone that wants them if you'll pay for shipping. I don't have a list of all the manuals yet (I still need to clean the garage), but if you are interested, let me know which manuals you might be interested in, and I'll let you know if I have them. The top ed...

How Can I use the compliers used under Dev-C++ in C++ builder?
How Can I use the compliers (for instance GCC, ...) used under Dev-C++ in C++ builder? In my program,I used boost lambda expression under Dev-C++ due to the fact that C++ builder 2009 do not support such expression. But Dev-C++ do not support RAD(rapid application development). It is hard to establish the common graphic GUI under windows.So I want to use the compliers of Dev-C++ in C++ builder. And I do not know how to manage it. Where can I get the related materials or advices? Can any one with kindness help me? Il Tue, 11 Aug 2009 23:29:59 -0700, lserjt lserjt <> ha scritto:...

C++Builder 2010: same old bugs.... goodbye, C++Builder.
I've tried the demo version, built my OCX, set the constrained size, and added some event handler. It works exactly like the old Borland CBuilder 6: the grab handles does not follow the constrained size, the OnCloseQuery and OnDestroy events are not fired, there's is not an OnAmbientChange event available. Building OCX is an important feature for us, as our customer needs them... so, if i were the one that take the final decision, i'll migrate to MS developement tools.... i'm not that one, but i'll strongly push in that direction. It's a shame, anyway. If yo...

superreview requested: [Bug 232503] Start using Empty[C]String() : [Attachment 140140] Use Empty[C]String()
Johnny Stenback <jst@mozilla.jstenback.com> has asked Peter Van der Beken <peterv@propagandism.org> for superreview: Bug 232503: Start using Empty[C]String() http://bugzilla.mozilla.org/show_bug.cgi?id=232503 Attachment 140140: Use Empty[C]String() http://bugzilla.mozilla.org/attachment.cgi?id=140140&action=edit ...

superreview granted: [Bug 232503] Start using Empty[C]String() : [Attachment 140140] Use Empty[C]String()
Peter Van der Beken <peterv@propagandism.org> has granted Johnny Stenback <jst@mozilla.jstenback.com>'s request for superreview: Bug 232503: Start using Empty[C]String() http://bugzilla.mozilla.org/show_bug.cgi?id=232503 Attachment 140140: Use Empty[C]String() http://bugzilla.mozilla.org/attachment.cgi?id=140140&action=edit ------- Additional Comments from Peter Van der Beken <peterv@propagandism.org> > Index: editor/libeditor/html/Makefile.in > =================================================================== > @@ -58,19 +58,18 @@ CPPSRCS =...

C Components Using Watcom C/C++ Compiler
This is a cryptographically signed message in MIME format. --------------ms2646818B6AC700D6597C3859 Content-Type: multipart/mixed; boundary="------------E0BFC7D7A6CA166C48EDA143" This is a multi-part message in MIME format. --------------E0BFC7D7A6CA166C48EDA143 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Does anyone have an example of C skeleton files and Watcom C/C++ make file to compile and load C components into Jaguar using the Watcom C/C++ compiler/Linker? --------------E0BFC7D7A6CA166C48EDA143 Content-Type: text/x-vcard; ch...

Examples or how to put c++ project in main() in PB C++ builder?
I am using PB 6.0.01 Enterprise and created a C++ project from a user nvo that contains a function that gets called from my PB app. I would like to know how I could use the C++ builder that comes with PB to embed the results of the C++ project so I can register it with CTS Jaguar. I would like to have the C++ project part of my app (.cpp file,.h file, and related .pbd file) run within Jaguar. Does anyone have any examples of doing this? Any suggegstions or advice would be greatly appreciated. TIA Marc marcwhitney@compuserve.com ...

C++ or C#
HI, I have still seen that many big companies are still using C++ as their primary language of choice instead of C#. Like IBM stilll prefers C++ over c#. Any reason ???HighOnCodingWanna get high! Well not everybody has the .net framework installed. C++ will work on any platform, c# will not yet because the framework has not been ported to all platforms yet (e.g. mac). Also you have to think of the expense of a large company to retrain ALL its coders to use the new framework. Not exactly practical in the short term David LeggDave Legg Considering that they have a huge c...

About C and C++
Hello, I will resume it like this: On the criterias of "complexity" and "difficulty", the C and C++ programming languages are more complex and difficult than Object Pascal for example, so since they are more complex and difficult they are likely to create something like a darwinian filter who don't let the weaker humans among us humans to cross or to climb the social ladder, this is why i think that C and C++ do participate to social darwinism, this is why i say that C and C++ are bad. Thank you, Amine Moulay Ramdane. Amine Moulay Ramdane wrote: > He...

C or C++
What's the difference in using C or C++ for ultralite developments?. Novice user. Thank you The ONLY difference is YOUR preference. There is no speed difference between the two. If you are very used to C++ but not used to SQL, then the C++ API maybe a better choice. If you are familiar with SQL, the embedded SQL may make more sense. -- David Fishburn Sybase - iAnywhere Solutions Professional Services Please only post to the newsgroup EBFs and Whitepapers http://www.sybase.com/products/mobilewireless/anywhere/ "Lorenzo Mota" <lorenzomota@aol.com> wro...

How can I use c# 's project web server control on a vb.net project....Help Please
Hi       I am using a server control in a C# project in an aspx file. It works fine when I use that in that same c# project. But when I import the assembly into a vb project and place the control on the page. Its giving me a System.NullReferenceException: Object reference not set to an instance of an object. error message. Please help me with it, I cant even debug it as soon as I land on the aspx page this error appears. Please help me in getting through with this message. I have spend two days working on it. Its giving me an error message on this line this.t...

Newbie Question: Import C++ DLL and using it in a C++.NET Project
Hi, I am using Microsoft Visual Studio 2005. I am trying to create a C++ application (Win32 project/application) that imports functions from a DLL. The DLL, which I did not create, is a Win32 DLL (that uses MFC in a static library). The DLL .h and .cpp files do not contain any classes. Just functions with __declspec (dllexport).  I think that my problem is that I am very new  to .NET (I am not sure I should post this question in a different form[:'(]). Here is what I have done:I tried creating a new solution and adding the DLL project to it and then building the project (to gen...

use VB.NET and C#.NET code in the same C#.NET project
All-- Here is a sample that is "off the beaten path", (at least for me). Is it possible, in an ASP.NET application, using the code-behind page building technique, to have both pages written in VB.NET and pages written C#.NET?At http://www.WebLogicArts.com/DemoList.aspx there is a sample that shows that, (contrary to popular belief), it IS possible to mix ASP.NET pages built with C#.NET with ASP.NET pages built with VB.NET in the same VS.NET 2003 project. Note that this is just a "fun" sample to see if it can be done and I do not recommend this practice as a "standard" way of develo...

Web resources about - Help me start setting up very old Borland C++ project using C++ Builder - embarcadero.cppbuilder.ide

Help:Contents/Account settings and maintenance - Wikipedia, the free encyclopedia
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. , a non-profit organization.

Mode setting - Wikipedia, the free encyclopedia
Mode setting can be done in kernel space ( Kernel Mode Setting or KMS) or in user space ( User-space Mode Setting , UMS). Doing mode setting ...

5 Facebook Privacy Settings You Must Review Now
Facebook now has five different settings for controlling whether and how you get tagged on the site.

Analysis: Facebook’s New Privacy Settings a Major (and Risky) Step Toward Openness
The upcoming changes to Facebook’s privacy settings will allow users to control who they share information with every time they post a piece ...

Here Come the Habibs: Breaking barriers or setting race relations back decades?
The co-creator and writer of Nine's new sitcom insist the critics on Twitter have got it all wrong.

Here Come the Habibs: Breaking barriers or setting race relations back decades?
The co-creator and writer of Nine's new sitcom insist the critics on Twitter have got it all wrong.

Default settings in Apache may decloak Tor hidden services
World's most widely used Web server often displays geographic locations of Tor sites.

'Alexa, turn on kitchen lights': Setting up Cree bulbs with Amazon Echo and Wink hub
... voice control of all sorts of products. All it takes is a hub and several are already operational with it. A while back I wrote about setting ...

Speeding up your home Wi-Fi might be as easy as changing one setting
You’ve tried everything when it comes to fixing your home Wi-Fi , but it’s still broken and the first thing you should do is check our tips , ...

Setting up a mailinator-like test mail server with postfix and MailHog
The purpose of this exercise is to set up a mailinator-style mail server under our control. If you haven't used mailinator, it's a free service ...

Resources last updated: 2/14/2016 7:56:45 AM