BSTR to CString Conversion in Windows XP

(this is a re-post from the vstudio.development newsgroup)

I am using Visual C++ Version 6.0 SP 5 to convert a BSTR 
(returned from an XML transform) to a CString for further 
manipulation/return.  This is done in a base class which 
several classes inherit from, which then call this 
Transform function to get the XML transform results back.

The entire class works fine in Windows 2000 and it works 
fine in Windows XP under most circumstances.  I have 
found, however, that the conversion fails in Windows XP 
when the length of the string represented in the BSTR is 
somewhat large (it is failing on a resulting HTML document 
that is approximately 23K).  By stepping through the 
debugger the call seems to fail on the wcslen() function 
in the CString MFC class when using the base conversion 
from BSTR to CString.  My application is not built with 
the _UNICODE definition.

Has anyone else seen this?  Is there a work-around out 
there, or possibly a better way to do what it is I'm 
trying to do?  Any help would be appreciated.

Thanks,
-Steve

0
9/5/2003 4:59:26 PM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
441 Views

Similar Articles

[PageSpeed] 23

Reply:

Similar Artilces:

Office XP Exel
Scenario: User's A,B, C, and D all have access to an excel XLS on a 2003 server. Users A & B have modify rights, users C&D only have read rights. If user A updates the file, the general tab in properties reflect the exact time the file was modified. After user A saves and closes the file, user D goes in. The changes are there, but in the properties general tab, the modify date in an old date (probably the actual creation date). Is this normal ? Any idea's ? ...

How to Hide Left Panel of Folder Window?
I'm well behind the Windows curve and I'm just now learning to use Windows XP Home. Up to now I've been using Windows 2000 Pro. On my XP desktop I have a shortcut to my music folder which containins my MP3 files. When I double click on the shortcut, a window opens on the desktop displaying the contents of my music folder. This window has a panel along the left side containing items like "File and Folder Tasks" and "Other Places." I can't figure out how to close, hide or otherwise delete this panel. This panel takes up a lot of prec...

XP Media Center
Hello, I have Media Center 2002 and I recently installed SP3 and now the Media Center does not work. The error says: ehshell.exe - Strong name validation failed for assembly... Is there a fix to this problem? Thank you. ...

New message opens up behind outlook window
Everytime I click new in my inbox to open a new message, the new message pops up behind the main oulook window. does anyone know how to make this stop? ...

Can't install windows updates on SBS 2003
I have a SBS 2003 server that has not been updated in a couple years. It has SP2 installed but when I run Microsoft Update it needs to download and install 96 updates. When I try to get them installed it comes back with an error saying not enough disk space. I have tried to just install 1 update at a time and get the same error. The C:\ drive has over 14GB of free space and the other drives have plenty of space as well. I restarted the server and also ran Disk Cleanup, as the error message reccomends, but am still having the same problem. Anyone run across this problem befo...

Outlook and Windows Integrated Authentication
Hello All, Does anyone know if Outlook (not OWA) can use Windows Integrated Authentication (like IE) to automatically log onto Intranet Web sites to retrieve graphics in HTML messages? Right now we get a logon dialog and have to manually log in. Thanks. if you paste the url into a browser, does it work as desired? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outloo...

Integrating Great Plains 8.0 and CRM 1.2 and Windows Small Busines
Integrating Great Plains 8.0 and CRM 1.2 I run a Windows Small Business Server 2003 Premium box along with a Windows Server 2003 Standard box used for my Great Plains 8.0 and SQL 2000. I’m considering introducing CRM 1.2 Professional into the mix. From a hardware stand point I know I’m fine all around. I’ve been researching how I should configure CRM and am a bit confused. The info I’ve found in KB887153 states “When you install Microsoft Business Solutions CRM Integrations for Great Plains 7.0, 7.5, or 8.0, Microsoft BizTalk Server is also installed. However, BizTalk Server 2000 and B...

Can Outlook 2003 use MSN Messenger INSTEAD of Windows Messenger?
I didn't get an answer to this question last week so I'm re-posting... I recently purchased a new computer (Windows XP Home Edition w/SP2) and loaded up all of the available updates to the OS, Internet Explorer, etc. Next, I installed Office 2003 Professional. I disabled Messenger integration with Outlook 2003 as discussed in other posts here. Next I installed MSN Messenger 6.2 and it seemed to run properly as a stand-alone application. So I re-enabled Messenger integration on Outlook 2003. The next time I booted up and ran Outlook, the Messenger icon appeared in the taskbar...

Windows media player
Why does windows media player keep popping up? David wrote: > Why does windows media player keep popping up? OK, I give up. Why does Windows Media Player keep popping up ? How to ask a question http://support.microsoft.com/kb/555375 Windows Media Player General Discussion http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.windowsmedia.player&cat=en_US_44d7101f-71dd-4f9a-b6b9-45215557dd35&lang=en&cr=US MowGreen ================ *-343-* FDNY Never Forgotten ================ banthecheck.com "Security update...

Task Manager window only CPU
Vista Ultimate SP2 When I launch Windows Task Manager, only a CPU meter opens. When I right click icon in task bar, I only get Close & Always on top options. How do I restore task manager? Happy New Year -- ***************** John Lenz JohnLenz@comcast.net Double click on the white frame of the task manager window. That should do it. -- whs THX - it worked Happy New Year -- ***************** John Lenz JohnLenz@comcast.net "whs" <guest@unknown-email.com> wrote in message news:89eee91dbeee8173c55e0008be25b622@nntp-gateway....

URGENT: WINDOWS 8 ANNOUNCEMENT for July 2011!
Think Windows7 just came out & too young? Welcome to the brave future: Windows8! 1) Windows 8 To Contain New Anti-Ha*king Software (antipir*cy). Some may consider anti-pir*cy measures similar to whistling in the wind, but that's certainly not the case. George has posts in Windows7NewsDOTcom, and ConnectedInternet showing how in many cases Microsoft has foiled anti-pir*cy efforts. Many believe that piracy is relegated to just illegal copying or theft. But that is not the case. V*rus distribution and embedded malw*re, and privacy intrusion are typical features that result from...

email address on Service Call Entry window
Add an email address field to the Service Call Entry window for the customer contact on the service call. Even if it is not pulled from the email address of the address id on the service call, at least the dispatcher could enter an email address on the service call in order to communicate with the customer regarding the call. It is common to take email address as part of contact information. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the m...

Time Conversion
I need help in converting time. I am using data from a time clock which currently formats time as 1.5. When I input this data into a cell how can I have it formated to read 1 hour and 30 minutes (1:30) T.I.A. Ed What you could do in an adjacent row or column is format them as Time and then using a formula, divide the input time by 24(hours in a day). >-----Original Message----- >I need help in converting time. I am using data from a time clock which >currently formats time as 1.5. When I input this data into a cell how can I >have it formated to read 1 hour and 30 minut...

Windows Update Office 2007 Converter confusion
On my desktop I have Office 2003 (laptop has Office 2007). I recently received an attachment in .docx format (2007). I downloaded the converter to my desktop and opened the document. Now on my desktop (which has Office 2003) I receive update notices for Office 2007. Should I ignore these? Hide them? Install them? Will I still be notified re updates needed for Office 2003? Thank you for whatever insight you can provide. If you can give me some of the background explanation as to why this is happening (I presume related to the 2007 converter viewer install), I can understand bett...

Windows XP SP2
Has anyone else noticed that after installed Windows XP SP2, emails in Outlook sit in the Outbox for several "noticable" seconds before sending. Sam <anonymous@discussions.microsoft.com> wrote: > Has anyone else noticed that after installed Windows XP > SP2, emails in Outlook sit in the Outbox for > several "noticable" seconds before sending. I believe I saw this documented on the Microsoft web site. -- Brian Tillman ...

Office 2007 on Windows 7
I just purchased a new laptop with Windows 7. I also purchased Office 2007 but I notice that Windows 7 is not shown on the Office package. Can I install Office 2007 without any propblems? Answered your first posting. apensa wrote: > I just purchased a new laptop with Windows 7. I also purchased Office 2007 > but I notice that Windows 7 is not shown on the Office package. Can I > install Office 2007 without any propblems? ...

Volume License copy of Windows Server
Gurus, Is there anyway anymore to get a full Volume License copy of Windows Server (e.g., version 2008) which does NOT require Internet activation? -- Spin Start with Vista/Windows 2008, your options to activate are by Internet or Phone. I believe the command that kicks it off is: slui.exe 4 "Spin" <Spin@invalid.com> wrote in message news:84nk89Far1U1@mid.individual.net... > Gurus, > > Is there anyway anymore to get a full Volume License copy of Windows > Server (e.g., version 2008) which does NOT require Internet activation? > ...

quicken file conversion?
how can i convert the data for two mutual funds from quicken to money 2003. i don't want to convert all old data of every acct in quicken 2003. any ideas welcomed ...

Can we get newsgroups with Windows Live Mail?
Currently we have WindowsXP, SP3, OE. How will Windows7 get newsgroups? Will these be part of "Windows Live Mail" as they are in OE? Please help, Frank Newsgroups work virtually the same in WLMail as they do in OE. -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "Frank Martin" <fm@general.com.au> wrote in message news:uybUM2d2KHA.2284@TK2MSFTNGP06.phx.gbl... > Currently we have WindowsXP, SP3, OE. > > How will Windows7 get newsgroups? Will these be part of "Windows Live > Mail" as they ...

Outlook 2007 in Windows 7
I've installed Office 2007 in Windows 7. Then I installed Lotus Notes 8.5 as my default mail client. After that I opened Outlook 2007 then it prompted to set Outlook 2007 as the default and I clicked Yes. But still the HKEY_CLASSES_ROOT\mailto\shell\open\command value is LotuNotes exe destination. What is the reason for this. But if I use <a href="mailto:dummymail@dum.edu">send mail</a> tag in my HTML page it opens Outlook 2007 new mail window. How does the mailto protocol identifies the default mail client and open the new mail window? Pls someo...

how to convert a CString variable to unsigned short array one?
Hi, In my unicode VC6 app, how to convert a CString variable to unsigned short array? ....... CString strRst; unsigned short strOleChars[100]; strOleChars = strRst; //??? Thank you. Is ConvertStringToBSTR() what you are looking for? AliR. "David" <David_Wang_Xian@hotmail.com> wrote in message news:e6gbA3avFHA.720@TK2MSFTNGP15.phx.gbl... > Hi, > In my unicode VC6 app, how to convert a CString variable to unsigned short > array? > ...... > CString strRst; > unsigned short strOleChars[100]; > strOleChars = strRst; //??? > > Thank you. > > ...

link file from virtual windows xp to access 2007 on windows 7 plat
I am trying to link a paradox db file to access 2007 db. The paradox file resides on a virtual windows xp platform within the windows 7 platform of the physical machine. How do I map this field into access? -- cblackman ...

about treeview in view window
hi I am trying to display treeview in view window.But unable to do that. When we call CTreeCtrl &tree=GetTreeCtrl(); it is giving error that GetTreeCtrl is undeclared idenifier.So any one can tell ,how i have done this. I don't want to use App Wizard step 6 Base Class TreeView Class. Arbind your view window should be a CTreeView,GetTreeCtrl() is the member function of CTreeView,but not CView. "Arbind" <arbindb_tech@rediffmail.com> wrote in message news:OOePU1iXDHA.1644@TK2MSFTNGP10.phx.gbl... > hi > > I am trying to display treevi...

CString and embedded 0s
Meh... I'm in the process of porting code from VS2003 to VS2008 and I found an issue with CString and embedded 0s. In MFC 9 (VS 2008), void Append( const CSimpleStringT& strSrc ), and consequently operator+=()const CSimpleStringT& strSrc), do not work as they used to in MFC 7.1. For example, the following does works with MFC 7.1 and not in MFC 9: CString s(_T("a")); s += CString(_T("b\000c"), 3); ASSERT(s.GetLength() == 4); // ASSERT here I traced it down to CSimpleStringT::Append(PCXSTR pszSrc, int nLength) (atlsimpstr.h, line 400 in MFC9 souurces, ...

Book/doc on converting XP program to work nicely on Vista?
Any good books or documentation, things I should know about what worked fine on XP that won't work on Vista, what needs to be modified in the program to get it to work nicely on Vista, umm, stuff like that? What's a better way than Journal Hooks for a program to record it's own keystrokes? Journal hooks was always problematic if other programs were running that didn't process their messages correctly, and now on Vista I hear journal hooks have been disabled. try Microsoft Application Verifier. "David Deley" <deleyd@gte.net> wrote in message news:vTqVi.1...