Thread: VB Strings
View Single Post
  #3 (permalink)  
Old 09-16-2008, 02:27 PM
reniery reniery is offline
Learning Programmer
 
Join Date: May 2008
Posts: 43
Credits: 0
Rep Power: 3
reniery is on a distinguished road
Default Re: VB Strings

No I haven't tried &strtemp, but I'll try it right now.

Btw I found the solution for my problem, I used a c++ dll and then I just call it from my vb app. But is there a way to do this in vb6 directly, this are the functions I did in my c++ dll

Code:

BSTR __stdcall testFunction(BSTR stringVar)
{
             LPSTR buffer;
	buffer = (LPSTR)stringVar;
	
	if (OK!=SETDRIVERPAR(290,(LPARAM)buffer)){
	::MessageBox(NULL,"Error asignando ","Error",0);
	}
	else{
	
	}

	//buffer = _strrev(buffer);
	return(SysAllocString(stringVar));

}

BSTR __stdcall testGetSerial()
{
	unsigned char bufSerial[255];
	if (OK!=GETDRIVERPAR(290,(LPVOID)bufSerial)){
             ::MessageBox(NULL,"Error retrieving Serial ","Error",0);
	} 
	else{
	}

	return (BSTR)bufSerial;

}
My problem is these 2 lines, in both I need a pointer to a string and I'm having trouble doing it in vb6. Any suggestions or using my dll is the only solution.

GETDRIVERPAR(290,(LPVOID)bufSerial))
SETDRIVERPAR(290,(LPARAM)buffer))
Reply With Quote