473,503 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP! (or....What the hell is wrong with this code?)

Sam
I'm writing an address processing app in C#, using an ActiveX
component (Addr) written in VB6, for which I have the source code. The
main function is FixAddress, which takes a string representing the
address to process (as tab separated fields) and returns a validated
and "standardized" address as a (tab separated) string of address
fields. Here is the code that's driving me nuts (minus a lot of
parsing/error checking stuff):

//******** begin ***********

string inputAddr;
string outputAddr;
string allAddr; // all addresses, separated by "\n"

//Block 1
inputAddr = "415 N Western\t#4\tChicago\tIL\t60625";
outputAddr = Addr.FixAddress(inputAddr);
allAddr = outputAddr + "\n";

//Block 2
inputAddr = "235 East Fullerton\tApt 111\tMiami\tFL\t33174";
outputAddr = Addr.FixAddress(inputAddr);
allAddr = allAddr + outputAddr + "\n";

//********* end ************

Looks pretty simple, but when I run it, allAddr only has the value
assigned in Block 1, minus the newline. When I step through the code,
I can see the variable outputAddr in Block 2 set to the right value,
but, again, the concatenation does NOT work, allAddr is unchanged. I
have even tried something like allAddr = allAddr + "XXX"; but even in
that case allAddr remains unchanged.
WHAT IS GOING ON? Is there something about strings returned from an
unmanaged app that makes them behave like this?

help...

Sam
Jul 19 '05 #1
1 1229
Sam <pr*****@marihuana.com> wrote:
Nevermind, I found the problem: it seems like the string returned from
the ActiveX component is null terminated.


Note that that will stop the debugger working properly (in VS.NET 2002,
anyway) but shouldn't stop the concatenation from happening itself -
it's just the debugger doesn't show values after a null. The values are
still there though.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2016
by: Tim21 | last post by:
OK, im miserable :)) so.. help'd b highly appreciated. Situation: Win XP aplication server RUNTIME (stored fmx files along with the ..hlp files) Fmx's generated and compiled on development...
0
2239
by: Denise L. Moss-Fritch | last post by:
Has anyone developed context sensitive help for a C# application? According to our programming staff, the development side is not able to provide links without adding hard coded links (topic names)...
2
1723
by: clintonG | last post by:
Is there a document that explains the difference between the Visual Studio .NET 2003 Combined Help Collection and the MSDN Library for Visual Studio .NET 2003 or does someone have comments...
6
4304
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
3
4512
by: Mark Lees | last post by:
Just installed 2003 and the help file sucks because it tries to connect to Microsoft Online Help which takes too long. When I run Access and I'm not connected to the internet, it seems to connect...
2
2532
by: John Baker | last post by:
I find it highly annoying that MS Access tries to go online when I want to look at the help files. Is there a way to configure it so it just looks at my local helpfiles when I hit F1?
2
3002
by: J | last post by:
I use Access 97 and Windows XP (Sp2 if that matters) I mostly program for myself, but am now writing an application for my wife's club and need to include a help file with the database I am...
5
2594
by: TD | last post by:
Hey All, I am hooking up our custom html (.chm) help file to our Access xp application, and, despite reading several posts and manuals on this, I still have a gap in my understanding... OK, so...
1
4038
by: Denise L. Moss-Fritch | last post by:
Has anyone developed context sensitive help for a C# application? According to our programming staff, the development side is not able to provide links without adding hard coded links (topic names)...
1
1310
by: Diego F. | last post by:
I'm trying to show my application help. I installed VSHIK 2003 to create a simple help file. Now I need to integrate it into my application. I have two problems: - I don't know how to register...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.