|
-
May 7th, 2001, 03:29 PM
#1
Thread Starter
Frenzied Member
Bstr
I need some help with making a BSTR. I need to make two BSTR in to 1 and I can't seem to make it work. The finished product needs to look like this:
ItemOpen("ID")
ID is the other BSTR. So how I combine two BSTRs together?
I have tried:
PHP Code:
BSTR cmd;
cmd = SysAllocString(L"ItemOpen(\"" & ID & "\")");
Thanks
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
May 7th, 2001, 04:06 PM
#2
Monday Morning Lunatic
Do you specifically have to use BSTR? Actually, it's basically synonymous with LPWSTR (== wchar_t*). So, you can use the STL to help with this:
Code:
basic_string<OLECHAR> sMyStr;
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 7th, 2001, 06:19 PM
#3
Thread Starter
Frenzied Member
Yeah I dont have much of a choice, BSTR is what the functions I am using need. But I will try LPWSTR just to see what happens.
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
May 7th, 2001, 06:20 PM
#4
Monday Morning Lunatic
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 7th, 2001, 06:26 PM
#5
Thread Starter
Frenzied Member
They are Novell GroupWise functions. If you know anything about them you would be my hero. But it seems like no one does
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
May 7th, 2001, 06:29 PM
#6
Monday Morning Lunatic
Hmm... not used that, sorry 
BSTR is defined as OLECHAR FAR* which is basically OLECHAR*:
Code:
typedef basic_string<OLECHAR> BString;
BString x = L"Hello";
FunctionThatTakesBSTR(x.c_str());
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 7th, 2001, 06:33 PM
#7
Thread Starter
Frenzied Member
Ok so how would I make 2 of those into 1
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
May 7th, 2001, 06:36 PM
#8
Thread Starter
Frenzied Member
What libary is that in?
It barfs up an error on compile about missing a ; after basic_string
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
May 8th, 2001, 05:03 AM
#9
Monday Morning Lunatic
Code:
#include <string>
using namespace std;
// ...
BString x = BString(L"Hello ") + BString(L"World");
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 8th, 2001, 11:21 AM
#10
Thread Starter
Frenzied Member
Because I could not get on to VB-World this morning I figured it out. *** is up with this server?? Seems like its got alot of problems. Anyways I used:
PHP Code:
#include <atlbase.h>
CComBSTR cmd;
cmd = "ItemOpen(\"";
cmd += ID;
cmd += "\")";
And it work. But thanks for the suggestions.
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
May 8th, 2001, 11:58 AM
#11
Monday Morning Lunatic
No problem. I was just trying to avoid bringing in ATL or MFC if I could help it
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 8th, 2001, 12:00 PM
#12
Thread Starter
Frenzied Member
On this program so would I, but I will take what works.
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|