Re: SysAllocString

2002-03-11 Thread Hal DeVore
> On Mon, 11 Mar 2002, "James" == Murphy, James wrote: James> ATL CComBSTR class or the MFC CString class James> they manage much of this for you. Or the ATL/WTL CString class. But you still have to understand the underlying semantics or it's easy to create memory leaks and/or access

RE: SysAllocString

2002-03-11 Thread Murphy, James
You get 3 guesses... :) It frees the BSTR allocated with SysAllocString(X)(). consider using the ATL CComBSTR class or the MFC CString class - they manage much of this for you. Jim > -Original Message- > From: Bavishi, Pankaj [mailto:[EMAIL PROTECTED]] > Sent: Saturday, March

RE: SysAllocString

2002-03-09 Thread Bavishi, Pankaj
:[EMAIL PROTECTED]] Sent: Friday, March 08, 2002 10:03 PM To: [EMAIL PROTECTED] Subject: RE: SysAllocString Since DOMString stores Unicode characters encoded in UTF-16, there's no need to transcode to do what you want. Just use DOMString::rawBuffer() to get the pointer, and go from

RE: SysAllocString

2002-03-09 Thread Bavishi, Pankaj
Thanks a lot..works great. What does sysfreestring(bstr) do? -Original Message- From: David N Bertoni/Cambridge/IBM [mailto:[EMAIL PROTECTED]] Sent: Friday, March 08, 2002 10:03 PM To: [EMAIL PROTECTED] Subject: RE: SysAllocString Since DOMString stores Unicode characters encoded in

RE: SysAllocString

2002-03-08 Thread David N Bertoni/Cambridge/IBM
ot;Bavishi, Pankaj" To: [EMAIL PROTECTED] Subject: RE:

RE: SysAllocString

2002-03-08 Thread Bavishi, Pankaj
Samar I guess it worked the way you suggested. Thanks a bunch. But it seems to give same value(short*) for bstr(=102): BSTR bstr = SysAllocString(L"India"); Or BSTR bstr= SysAllocString(L"Ind"); Any suggestion? -Original Message- From: Bhushan Khanal [mailto:[EMA

RE: SysAllocString

2002-03-08 Thread Bhushan Khanal
Be careful when using rawBuffer(). The documentation says that its not always guranteed to be null terminated ;) Bhushan -Original Message- From: Samar Lotia [mailto:[EMAIL PROTECTED]] Sent: Friday, March 08, 2002 4:13 PM To: '[EMAIL PROTECTED]' Subject: RE: SysAllocString

RE: SysAllocString

2002-03-08 Thread Samar Lotia
Since you are working on windows, an XMLCh * is exactly the same as a wchar_t * which is the same as a OLECHAR * which is the same as a BSTR. You can use XMLCh * p = XMLnode.getNodeName().rawBuffer(); BSTR bstr = SysAllocString(p); -Original Message- From: John Utz [mailto:[EMAIL

RE: SysAllocString

2002-03-08 Thread John Utz
ut in my code, I don't know what "Hello" is? > I mean I have : > > Char* vna2 = ((XMLNode.getNodeName()).transcode()); > BSTR bstr= SysAllocString(vna2)doesn't work.. > > I am not in a position to print the string and then put it in SysAlloc > function

RE: SysAllocString

2002-03-08 Thread Bavishi, Pankaj
Dave, Thanks a lot. But I am unable to use CString in my VC++ proj. It says undecl identifier. Do I need to include any files? -Original Message- From: Dave Connet [mailto:[EMAIL PROTECTED]] Sent: Friday, March 08, 2002 6:52 PM To: '[EMAIL PROTECTED]' Subject: RE: SysAlloc

RE: SysAllocString

2002-03-08 Thread Dave Connet
If you can use a CString, that's probably the easiest way. Otherwise you'll have to convert char* to wchar* (and casting won't work). [The issue is that what transcode returns and what SysAllocString takes are different (imcompatible) types] char* vna2 = ((XMLNode.getNodeNa

RE: SysAllocString

2002-03-08 Thread Bavishi, Pankaj
So how should I do it? I tried: BSTR bstr=SysAllocString((WCHAR*)str);etc. I have to get str and not "hello" into the SysAllocString function. Please help. Thanks -Original Message- From: John Utz [mailto:[EMAIL PROTECTED]] Sent: Friday, March 08, 2002 6:32 PM To: [EMAIL

RE: SysAllocString

2002-03-08 Thread Bavishi, Pankaj
I get what you are saying. But in my code, I don't know what "Hello" is? I mean I have : Char* vna2 = ((XMLNode.getNodeName()).transcode()); BSTR bstr= SysAllocString(vna2)doesn't work.. I am not in a position to print the string and then put it in SysAlloc function. -

Re: SysAllocString

2002-03-08 Thread John Utz
this is because the L makes it a wide string On Fri, 8 Mar 2002, Bavishi, Pankaj wrote: > When I use: > BSTR bstr=SysAllocString(L"Hello"); > It works fine > But I can't do: > Char* str ="Hello"; WCHAR* wstr = L"Hello"; > BSTR bstr=SysAl

SysAllocString

2002-03-08 Thread Bavishi, Pankaj
When I use: BSTR bstr=SysAllocString(L"Hello"); It works fine But I can't do: Char* str ="Hello"; BSTR bstr=SysAllocString(str); Why? Could you please suggest me the Solution. This is the process to convert DOMStri