Click here to Skip to main content
15,919,567 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: confirmation please: a char is 8 bits??? Pin
Kuniva10-Mar-03 11:01
Kuniva10-Mar-03 11:01 
AnswerRe: confirmation please: a char is 8 bits??? Pin
Michael Dunn10-Mar-03 11:02
sitebuilderMichael Dunn10-Mar-03 11:02 
AnswerRe: confirmation please: a char is 8 bits??? Pin
Robert Palma Jr.10-Mar-03 11:36
Robert Palma Jr.10-Mar-03 11:36 
AnswerRe: confirmation please: a char is 8 bits??? Pin
RaajaOfSelf10-Mar-03 17:23
RaajaOfSelf10-Mar-03 17:23 
Questionstd::stack iterator ? Pin
Maximilien10-Mar-03 10:46
Maximilien10-Mar-03 10:46 
AnswerRe: std::stack iterator ? Pin
valikac10-Mar-03 11:02
valikac10-Mar-03 11:02 
AnswerRe: std::stack iterator ? Pin
Taka Muraoka10-Mar-03 16:10
Taka Muraoka10-Mar-03 16:10 
QuestionHow do I modify a BSTR type string? Pin
dazinith10-Mar-03 10:27
dazinith10-Mar-03 10:27 
ok.. i am getting closer and closer to almost having something that almost works..

i have an example of a function that interacts with vb, and it modifies a variable that comes in by making it backwards before returning.. all i am trying to do is be able to set the value of the variable before returning.. the variable is of type BSTR, and i am getting nowhere.. here is an example of modifying the string which works:
void __stdcall FindBankName(LPSTR strFilename, LPSTR strRoutingNumber, BSTR a)
{

	int i, iLen;
		BSTR b;
		LPSTR pA, pB;

		iLen = lstrlen( (LPCSTR) a );

		b = SysAllocStringLen( NULL, iLen );
		
		pA = (LPSTR)a;
		pB = (LPSTR)b + iLen -1;
		
		for ( i = 0; i < iLen; i++ )
			*pB-- = *pA++;
		
		pA = (LPSTR)a;
		pB = (LPSTR)b;
		
		for ( i = 0; i < iLen; i++ )
			*pA++ = *pB++;
		
		SysFreeString( b );

}
here is an example of one of the many many unsuccessful tries which doesn't work:
void __stdcall FindBankName(LPSTR strFilename, LPSTR strRoutingNumber, BSTR a)
{
 	a = SysAllocString ( "Woop Howdi Bob!" );
}


my main purpose here is to be able to set a variable of type BSTR equal to a character array i have..

like:
char szBuffer[60];
// load up szBuffer with whatever
// use k-rad command to set my BSTR variable to the szBuffer


thanks a ton fer everyones help..

still a newb.. cut me some slack :P
-dz
AnswerRe: How do I modify a BSTR type string? Pin
Brian Shifrin10-Mar-03 12:53
Brian Shifrin10-Mar-03 12:53 
AnswerRe: How do I modify a BSTR type string? Pin
MAAK10-Mar-03 13:39
MAAK10-Mar-03 13:39 
GeneralList View question Pin
will138310-Mar-03 10:21
will138310-Mar-03 10:21 
GeneralRe: List View question Pin
dazinith10-Mar-03 10:35
dazinith10-Mar-03 10:35 
GeneralRe: List View question Pin
will138310-Mar-03 10:38
will138310-Mar-03 10:38 
GeneralRe: List View question Pin
will138310-Mar-03 10:44
will138310-Mar-03 10:44 
GeneralRe: List View question Pin
User 665810-Mar-03 11:08
User 665810-Mar-03 11:08 
GeneralNeed to catch Close message in Formview Pin
tjkrz10-Mar-03 10:01
tjkrz10-Mar-03 10:01 
GeneralRe: Need to catch Close message in Formview Pin
valikac10-Mar-03 11:04
valikac10-Mar-03 11:04 
GeneralRe: Need to catch Close message in Formview Pin
Nish Nishant10-Mar-03 11:20
sitebuilderNish Nishant10-Mar-03 11:20 
GeneralShellExecute advice.... Pin
JoeSox10-Mar-03 9:35
JoeSox10-Mar-03 9:35 
GeneralWriteFile never returns Pin
Brigg Thorp10-Mar-03 9:15
Brigg Thorp10-Mar-03 9:15 
GeneralRe: WriteFile never returns Pin
valikac10-Mar-03 11:06
valikac10-Mar-03 11:06 
GeneralRe: WriteFile never returns Pin
Brigg Thorp11-Mar-03 1:23
Brigg Thorp11-Mar-03 1:23 
GeneralRe: WriteFile never returns Pin
valikac11-Mar-03 4:40
valikac11-Mar-03 4:40 
GeneralESC Key on a CFormView Pin
netx200310-Mar-03 8:23
netx200310-Mar-03 8:23 
GeneralRe: ESC Key on a CFormView Pin
Mazdak10-Mar-03 8:25
Mazdak10-Mar-03 8:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.