473,657 Members | 2,763 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 "standardiz ed" 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\tCh icago\tIL\t6062 5";
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 1238
Sam <pr*****@marihu ana.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.co m>
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
2027
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 machine (Win2003 Advanced Server), also place of generation of HLP files (using HCW-Help Workshop Compiler)) Problem: When trying to call help file from module (fmx) (ON runtime machine) by pressing F1 (help key),. system seems not to react at all....
0
2249
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) in the user's registry. The latest e-mail we received from development states: "Launching help with a certain topic using a Map ID is not supported in the C#.NET API. Well there is always a work around but would violate the .NET help...
2
1734
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 describing the benefits of either or the other? -- <%= Clinton Gallagher, "Twice the Results -- Half the Cost" Architectural & e-Business Consulting -- Software Development NET csgallagher@REMOVETHISTEXTmetromilwaukee.com
6
4330
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 result in any way. Who can help me, I thank you very very much. list.cpp(main program) //-------------------------------------------------------------------------- - #pragma hdrstop #pragma argsused
3
4527
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 to the locally stored help files. How can I turn off the online help and just access the locally stored help files?
2
2544
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
3010
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 looking for a good, and low cost, help compiler that will run on WinXp AND will work with Access 97 Far as I know any help compiler should work, but to
5
2608
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 I've setup the registry keys to have a profile and I specify an AppHelpFile and TitleBar in that profile. This works swell: when I startup my application in runtime with the /profile option and then I press F1 on a form, our help file appears....
1
4045
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) in the user's registry. The latest e-mail we received from development states: "Launching help with a certain topic using a Map ID is not supported in the C#.NET API. Well there is always a work around but would violate the .NET help...
1
1321
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 the help file. I created a setup project and included the HxS file, but it doesn't open. - I tried also with a .chm file and it works pressing F1, but I don't know how to show the help pressing a menuitem component.
0
8306
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7327
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6164
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.