Board index » cppbuilder » Re: Unresolved external 'StrToIntA' ..

Re: Unresolved external 'StrToIntA' ..


2007-06-06 04:24:49 AM
cppbuilder27
Just to update on this topic. I changed .c_str() to .ToInt(). Problem
solved.
On Jun 5, 2:38 pm, XXXX@XXXXX.COM wrote:
Quote
Thanks for all your help on mine last post!!!

I got another problem now. Let me repost the old message with the
new problem.

--
I have a compilable program. It ran fine. Now I want to
convet it to a COM server by adding an COM Object to the project.
After
I add a COM object through the wizard, I got a lot of "cannot convert
AnsiString to const Char*" errors on lines like the following:

AnsiString
sMSG2=sMSG.SubString(iCommaPos+1,iLen-iCommaPos);
int iProcessID = StrToInt(sMSG2); //cannot convert AnsiString to
const Char*

--
As suggested by friend here, I append .c_str() to all the troubled
lines.

Now I got another error:

[Linker Error] Unresolved external 'StrToIntA' referenced from ..
\ACTDRAWORDER.OBJ

Any idea how to solve this?
 
 

Re:Re: Unresolved external 'StrToIntA' ..

< XXXX@XXXXX.COM >wrote in message
Quote
Just to update on this topic. I changed .c_str() to .ToInt(). Problem
solved.

It was also suggested that you specify the SysUtils namespace (i.e.
SysUtils::StrToInt(...)) to get the VCL version of StrToInt as opposed to
the WinAPI version. Did you try that?
- Dennis
 

Re:Re: Unresolved external 'StrToIntA' ..

"Dennis Jones" < XXXX@XXXXX.COM >writes:
Quote
< XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>Just to update on this topic. I changed .c_str() to .ToInt(). Problem
>solved.
>

It was also suggested that you specify the SysUtils namespace (i.e.
SysUtils::StrToInt(...)) to get the VCL version of StrToInt as opposed to
the WinAPI version. Did you try that?
The windows headers define a lot of macros that change function
names. Whenever I see a problem with a function ending with 'A' and
the function I call doesn't actually have an 'A' in it, the FIRST
suspicion is that the windows headers are doing their evil things
again.
Microsoft thought it was a good idea to have two functions, one for
regulard characters and another for wide strings, and a macro expands
to change the function name to select one of the functions.
I suspect that the header is interfering with his call, and that
namespace qualifications won't help here.
--
Chris (TeamB);
 

{smallsort}

Re:Re: Unresolved external 'StrToIntA' ..

"Chris Uzdavinis (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote
"Dennis Jones" < XXXX@XXXXX.COM >writes:

>< XXXX@XXXXX.COM >wrote in message
>news: XXXX@XXXXX.COM ...
>>Just to update on this topic. I changed .c_str() to .ToInt(). Problem
>>solved.
>>
>
>It was also suggested that you specify the SysUtils namespace (i.e.
>SysUtils::StrToInt(...)) to get the VCL version of StrToInt as opposed to
>the WinAPI version. Did you try that?

The windows headers define a lot of macros that change function
names.
I suspect that the header is interfering with his call, and that
namespace qualifications won't help here.
Ah yes, good point. If it is indeed a macro, then adding the namespace will
just result in SysUtils::StrToIntA, which will just result in a *different*
compiler error!
- Dennis
 

Re:Re: Unresolved external 'StrToIntA' ..

I tried it but it did not work. The compiler error says that
"SysUtils" is not a class name or namespace. I do not understand why.
On Jun 5, 4:46 pm, "Dennis Jones" < XXXX@XXXXX.COM >wrote:
Quote
< XXXX@XXXXX.COM >wrote in message

news: XXXX@XXXXX.COM ...

>Just to update on this topic. I changed .c_str() to .ToInt(). Problem
>solved.

It was also suggested that you specify the SysUtils namespace (i.e.
SysUtils::StrToInt(...)) to get the VCL version of StrToInt as opposed to
the WinAPI version. Did you try that?

- Dennis
 

Re:Re: Unresolved external 'StrToIntA' ..

I guess this explains it!
On Jun 6, 12:14 am, Chris Uzdavinis (TeamB) < XXXX@XXXXX.COM >
wrote:
Quote
"Dennis Jones" < XXXX@XXXXX.COM >writes:
>< XXXX@XXXXX.COM >wrote in message
>news: XXXX@XXXXX.COM ...
>>Just to update on this topic. I changed .c_str() to .ToInt(). Problem
>>solved.

>It was also suggested that you specify the SysUtils namespace (i.e.
>SysUtils::StrToInt(...)) to get the VCL version of StrToInt as opposed to
>the WinAPI version. Did you try that?

The windows headers define a lot of macros that change function
names. Whenever I see a problem with a function ending with 'A' and
the function I call doesn't actually have an 'A' in it, the FIRST
suspicion is that the windows headers are doing their evil things
again.

Microsoft thought it was a good idea to have two functions, one for
regulard characters and another for wide strings, and a macro expands
to change the function name to select one of the functions.

I suspect that the header is interfering with his call, and that
namespace qualifications won't help here.

--
Chris (TeamB);
 

Re:Re: Unresolved external 'StrToIntA' ..

XXXX@XXXXX.COM wrote:
Quote
I tried it but it did not work. The compiler error says that
"SysUtils" is not a class name or namespace. I do not understand why.
That's usually the case when you haven't got the relevant header
included. If no header has been included that mentions SysUtils, then
the compiler hasn't heard of it.
Alan Bellingham
--
Team Thai Kingdom
<url:www.borland.com/newsgroups/>Borland newsgroup descriptions
<url:www.borland.com/newsgroups/netiquette.html>netiquette
 

Re:Re: Unresolved external 'StrToIntA' ..

On Wed, 06 Jun 2007 11:46:02 -0700, XXXX@XXXXX.COM wrote:
Quote
I tried it but it did not work. The compiler error says that
"SysUtils" is not a class name or namespace. I do not understand why.
because you misspelled it, replace with Sysutils
--
Vladimir Ulchenko aka vavan