Click here to Skip to main content
16,012,061 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: get the last # from a 2 digit sum Pin
Roger Allen11-Mar-03 5:37
Roger Allen11-Mar-03 5:37 
GeneralRe: get the last # from a 2 digit sum Pin
João Paulo Figueira11-Mar-03 5:41
professionalJoão Paulo Figueira11-Mar-03 5:41 
GeneralRe: get the last # from a 2 digit sum Pin
mijarral11-Mar-03 6:33
mijarral11-Mar-03 6:33 
GeneralMultiple Line Edit Pin
raner11-Mar-03 4:03
raner11-Mar-03 4:03 
GeneralRe: Multiple Line Edit Pin
blagrang11-Mar-03 4:07
blagrang11-Mar-03 4:07 
GeneralRe: Multiple Line Edit Pin
raner11-Mar-03 4:17
raner11-Mar-03 4:17 
GeneralRe: Multiple Line Edit Pin
raner11-Mar-03 4:42
raner11-Mar-03 4:42 
GeneralCorrupted strings returning to VB ("M"e"s"s"e"d" "U"p"!"") Pin
dazinith11-Mar-03 3:38
dazinith11-Mar-03 3:38 
welp, i finally got a string to pass back to VB using my dll! Big Grin | :-D

the main issue i have write now is that most ways i tried to return my string, or modify a variable passed in I would get my string mixed with a bunch of end of line chars (i think thats what they are). the strings look fine in C++ when debugging, but when they go into VB they have squares (EOL's) between every character.. such that when i print them it only prints the first letter! here is a list of all the ways i tried it.. there are some easier ways to do it if i could just get rid of those little blocks.. anyone seen these before? Confused | :confused:

thanks for all your help with these strings!Smile | :)
BSTR __stdcall FindBankName(LPSTR strFilename, LPSTR strRoutingNumber, BSTR a)
{
//#1 - get unresolved external symbols when linking for ConvertBSTRToSTring() and ConvertStringToBSTR()
	//char chArray[50];
	//strcpy(chArray, "woop");
	//_bstr_t stuff(a);
	//stuff = chArray;
	//return stuff;
//#2 - returns "wha wha wha what", doesnt modify a
	//CString temp("wha wha wha what");
	//a = temp.AllocSysString();
	//return a;


//#3 - modifies and returns "Test"
	//char buff[] = "Test";
	//CStringW strw(buff);
	//wcscpy(a, strw);
	//return a;


//#4 - does modify a and return a value of "Tes" for both, but could not have a string longer than whats passed in for a
	//int len = wcslen(a); 
	//if lstrlen is workin as ANSI it may return unexpected results
	//this is the only way to prevent memory exception without knowing the size of a[]
	//if(len >= wcslen(L"Tes")) //the 'L' is very important   
		//wcscpy(a, L"Tes");
	//return a;


//#5 - returns "Woop Howdi Bob!" back to VB and does not modify a
	//a = SysAllocString ( L"Woop Howdi Bob!" );
	//return a;


//#6 - WORKS!!! - returns correct string
	//int i;
	//BSTR b;
	//LPSTR pB;
	//char s[] = "tenchars10";
	//b = SysAllocStringLen( NULL, 11 );
	//pB = (LPSTR)b;
	//for ( i = 0; i < 11; i++ )
	//	*pB++ = s[i];
	//return b;
}


still a newb.. cut me some slack :P
-dz
GeneralRe: Corrupted strings returning to VB ("M"e"s"s"e"d" "U"p"!"") Pin
Cedric Moonen11-Mar-03 3:46
Cedric Moonen11-Mar-03 3:46 
GeneralRe: Corrupted strings returning to VB ("M"e"s"s"e"d" "U"p"!"") Pin
dazinith11-Mar-03 3:52
dazinith11-Mar-03 3:52 
GeneralRe: Corrupted strings returning to VB ("M"e"s"s"e"d" "U"p"!"") Pin
Cedric Moonen11-Mar-03 4:00
Cedric Moonen11-Mar-03 4:00 
GeneralRe: Corrupted strings returning to VB ("M"e"s"s"e"d" "U"p"!"") Pin
dazinith11-Mar-03 4:21
dazinith11-Mar-03 4:21 
GeneralRe: Corrupted strings returning to VB ("M"e"s"s"e"d" "U"p"!"") Pin
Cedric Moonen11-Mar-03 4:29
Cedric Moonen11-Mar-03 4:29 
GeneralRe: Corrupted strings returning to VB ("M"e"s"s"e"d" "U"p"!"") Pin
dazinith11-Mar-03 5:12
dazinith11-Mar-03 5:12 
GeneralRe: Corrupted strings returning to VB ("M"e"s"s"e"d" "U"p"!"") Pin
Like2Byte11-Mar-03 3:50
Like2Byte11-Mar-03 3:50 
GeneralRe: Corrupted strings returning to VB ("M"e"s"s"e"d" "U"p"!"") Pin
dazinith11-Mar-03 3:51
dazinith11-Mar-03 3:51 
GeneralRe: Corrupted strings returning to VB ("M"e"s"s"e"d" "U"p"!"") Pin
AlexO11-Mar-03 4:04
AlexO11-Mar-03 4:04 
GeneralI/o Completion Problem Pin
Renjith Ramachandran11-Mar-03 3:22
Renjith Ramachandran11-Mar-03 3:22 
GeneralEditing treeview in win32 dialog closes dialog Pin
blagrang11-Mar-03 3:16
blagrang11-Mar-03 3:16 
GeneralBuild #'s, Version Tracking and such Pin
Like2Byte11-Mar-03 3:07
Like2Byte11-Mar-03 3:07 
GeneralRe: Build #'s, Version Tracking and such Pin
Rob Groves12-Mar-03 10:59
Rob Groves12-Mar-03 10:59 
GeneralCreating grayscale bitmap Pin
djordj11-Mar-03 3:06
djordj11-Mar-03 3:06 
GeneralRe: Creating grayscale bitmap Pin
Hesham Amin11-Mar-03 3:44
Hesham Amin11-Mar-03 3:44 
GeneralRe: Creating grayscale bitmap Pin
Mike Zinni11-Mar-03 4:29
Mike Zinni11-Mar-03 4:29 
QuestionHow do u pass parameters to OnKillfocus... Pin
IrishSonic11-Mar-03 2:58
IrishSonic11-Mar-03 2:58 

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.