Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: String Array in C# Pin
Michael P Butler14-Feb-04 21:34
Michael P Butler14-Feb-04 21:34 
QuestionUnmanaged Dlls ? Pin
veselin_iordanov14-Feb-04 15:40
veselin_iordanov14-Feb-04 15:40 
AnswerRe: Unmanaged Dlls ? Pin
leppie14-Feb-04 19:51
leppie14-Feb-04 19:51 
GeneralRe: Unmanaged Dlls ? Pin
veselin_iordanov15-Feb-04 6:57
veselin_iordanov15-Feb-04 6:57 
AnswerRe: Unmanaged Dlls ? Pin
Heath Stewart16-Feb-04 5:13
protectorHeath Stewart16-Feb-04 5:13 
GeneralRe: Unmanaged Dlls ? Pin
veselin_iordanov16-Feb-04 9:21
veselin_iordanov16-Feb-04 9:21 
GeneralRe: Unmanaged Dlls ? Pin
Heath Stewart16-Feb-04 9:26
protectorHeath Stewart16-Feb-04 9:26 
GeneralRe: Unmanaged Dlls ? Pin
veselin_iordanov16-Feb-04 9:32
veselin_iordanov16-Feb-04 9:32 
<br />
typedef BYTE *BBSTR;<br />
BBSTR AllocString(UINT len)<br />
{<br />
	return (BBSTR) SysAllocStringByteLen(NULL, len);<br />
}<br />
void ReAllocString(BBSTR *pbbstr, UINT len)<br />
{<br />
	BBSTR tstr;<br />
	tstr = AllocString(len);<br />
	if(len > StringLen(*pbbstr))<br />
		len = StringLen(*pbbstr);<br />
	if(len > 0)<br />
		memcpy(tstr, *pbbstr, len);<br />
	FreeString(*pbbstr);<br />
	*pbbstr = tstr;<br />
}<br />
BBSTR __stdcall decode(BBSTR data)<br />
{<br />
	UINT i, j;<br />
	BBSTR outstr;<br />
<br />
	outstr = AllocString(StringLen(data) - 1);<br />
	i = 0;<br />
	j = 0;<br />
<br />
	while(i + 1 < StringLen(data)) {	//first to 2nd last char<br />
		if(data[i] == 0x07) {<br />
			i++;<br />
			outstr[j] = data[i] ^ 0x0F;<br />
		} else {<br />
			outstr[j] = data[i];<br />
		}<br />
<br />
		i++;<br />
		j++;<br />
	}<br />
<br />
	ReAllocString(&outstr, j);<br />
	return outstr;<br />
}<br />

in VB this is defined like
Public Declare Function decode Lib "endecode.dll" (ByVal Data As String) As String
in C#
[DllImport("endecode.dll",CharSet=CharSet.ASCII,<br />
CallingConvention=CallingConvention.StdCall)]<br />
static public extern string decode ([MarshalAs(UnmanagedType.LPStr)] string Data) ;

but dont work
GeneralRe: Unmanaged Dlls ? Pin
Heath Stewart16-Feb-04 9:51
protectorHeath Stewart16-Feb-04 9:51 
GeneralRe: Unmanaged Dlls ? Pin
veselin_iordanov16-Feb-04 9:56
veselin_iordanov16-Feb-04 9:56 
GeneralRe: Unmanaged Dlls ? Pin
Heath Stewart16-Feb-04 10:30
protectorHeath Stewart16-Feb-04 10:30 
GeneralRe: Unmanaged Dlls ? Pin
veselin_iordanov16-Feb-04 12:27
veselin_iordanov16-Feb-04 12:27 
GeneralRe: Unmanaged Dlls ? Pin
Heath Stewart17-Feb-04 2:41
protectorHeath Stewart17-Feb-04 2:41 
GeneralChanging Control Locations In C# Pin
Eric Houser14-Feb-04 12:16
Eric Houser14-Feb-04 12:16 
GeneralRe: Changing Control Locations In C# Pin
Colin Angus Mackay14-Feb-04 13:27
Colin Angus Mackay14-Feb-04 13:27 
GeneralRe: Changing Control Locations In C# Pin
Bo Hunter15-Feb-04 7:38
Bo Hunter15-Feb-04 7:38 
GeneralRichTextBox, Scroll Bars and VScroll Event Pin
je_gonzalez14-Feb-04 11:03
je_gonzalez14-Feb-04 11:03 
GeneralCommunication between webservice and win application Pin
Anonymous14-Feb-04 10:59
Anonymous14-Feb-04 10:59 
GeneralRe: Communication between webservice and win application Pin
Mazdak14-Feb-04 19:49
Mazdak14-Feb-04 19:49 
GeneralRe: Communication between webservice and win application Pin
Anonymous14-Feb-04 21:26
Anonymous14-Feb-04 21:26 
GeneralRe: Communication between webservice and win application Pin
Mazdak14-Feb-04 21:30
Mazdak14-Feb-04 21:30 
GeneralRe: Communication between webservice and win application Pin
naxos15-Feb-04 20:10
naxos15-Feb-04 20:10 
GeneralNeed Help In Socket Programming Pin
Amoola14-Feb-04 10:15
Amoola14-Feb-04 10:15 
GeneralRe: Need Help In Socket Programming Pin
Colin Angus Mackay14-Feb-04 10:53
Colin Angus Mackay14-Feb-04 10:53 
GeneralShellnotifications Pin
Lesuran14-Feb-04 9:56
Lesuran14-Feb-04 9:56 

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.