Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
QuestionPLZ HELP!!!Not able to Delete the records from DB using NHibernate Pin
Puneet Bhatnagar14-Oct-08 23:39
Puneet Bhatnagar14-Oct-08 23:39 
AnswerRe: PLZ HELP!!!Not able to Delete the records from DB using NHibernate Pin
SeMartens14-Oct-08 23:52
SeMartens14-Oct-08 23:52 
QuestionWebbrowser Pin
hadad14-Oct-08 23:21
hadad14-Oct-08 23:21 
QuestionHow to log statement in MS SqlServer by ADONetAppender using Log4Net. Pin
Chintan.Desai14-Oct-08 23:14
Chintan.Desai14-Oct-08 23:14 
AnswerRe: How to log statement in MS SqlServer by ADONetAppender using Log4Net. Pin
Giorgi Dalakishvili14-Oct-08 23:23
mentorGiorgi Dalakishvili14-Oct-08 23:23 
QuestionHow do you link a Treeview to a list View ? Pin
boiDev14-Oct-08 23:07
boiDev14-Oct-08 23:07 
AnswerRe: How do you link a Treeview to a list View ? Pin
Mohammad Dayyan15-Oct-08 1:14
Mohammad Dayyan15-Oct-08 1:14 
Questionmethod conversion from C to C# Pin
Programm3r14-Oct-08 22:45
Programm3r14-Oct-08 22:45 
Hi all,

I have the following method that was wriiten in C. The method makes use of a MarshallSoft method called: cscGetData(vSock, Buffer, BufLen). I am trying to rewrite the method in C#. Here is some info about the cscGetData method:

The cscGetData function is used to receive data from an established connection. All available data is copies to 'Buffer' up to a maximum of 'BufLen'. cscGetData never waits for data.


So the problem is that the C# method does not work. What am I doing wrong ... Confused | :confused:

C version of GetData Method
// calling method
Code = GetData(i, DataSock, (char *)gConnectData[i].Request, STRING_SIZE);

// GetData Method
int GetData(int Connect,int Sock, char *Buffer, int BufLen)
{int Code;
 Code = cscGetData(Sock, Buffer, BufLen);
 if(Code<0)
   {DisplayError(Connect, Code, (char *)"cscGetData:");
    gConnectData[Connect].ConnectState = STATE_FINI;
   }
 return Code;
}


C# version of GetData Method
// calling method ????
Code = TcpServer.GetData(i, TcpServer.ListenSocket, TcpServer.connectData[i].Request, 128);

// GetData Method ????    
unsafe static public int GetData(int Connect, int Sock, string Buffer, int BufLen)
{
	int Code;
	char[] BufferString = Buffer.ToCharArray();
	fixed (char* pBuffer = BufferString)
	{
		cscShortToByte(pBuffer);
	}
	fixed (char* pBuffer = BufferString)
	{
		Code = cscGetData(Sock, pBuffer, BufLen);
		if (Code < 0)
		{
			connectData[Connect].ConnectState = (int)STATE.STATE_FINI;
		}
	}
	return Code;
}


Many thanks in advance
Kind regards,



The only programmers that are better those C# programmers are those who code in 1's and 0's Green Alien | [Alien]



Smile | :) Programm3r

My Blog: ^_^

AnswerRe: method conversion from C to C# Pin
Guffa14-Oct-08 23:21
Guffa14-Oct-08 23:21 
GeneralRe: method conversion from C to C# Pin
Programm3r14-Oct-08 23:36
Programm3r14-Oct-08 23:36 
GeneralRe: method conversion from C to C# Pin
Guffa15-Oct-08 2:07
Guffa15-Oct-08 2:07 
GeneralRe: method conversion from C to C# Pin
Programm3r15-Oct-08 2:35
Programm3r15-Oct-08 2:35 
AnswerRe: method conversion from C to C# Pin
Programm3r14-Oct-08 23:56
Programm3r14-Oct-08 23:56 
AnswerRe: method conversion from C to C# Pin
Dave Doknjas15-Oct-08 13:38
Dave Doknjas15-Oct-08 13:38 
QuestionUnregistering Events Pin
Member 419713614-Oct-08 22:25
Member 419713614-Oct-08 22:25 
AnswerRe: Unregistering Events Pin
Eduard Keilholz14-Oct-08 22:39
Eduard Keilholz14-Oct-08 22:39 
AnswerRe: Unregistering Events Pin
Simon P Stevens14-Oct-08 22:47
Simon P Stevens14-Oct-08 22:47 
GeneralRe: Unregistering Events Pin
Member 419713614-Oct-08 23:35
Member 419713614-Oct-08 23:35 
GeneralRe: Unregistering Events Pin
Simon P Stevens15-Oct-08 0:38
Simon P Stevens15-Oct-08 0:38 
GeneralRe: Unregistering Events Pin
Member 419713615-Oct-08 0:51
Member 419713615-Oct-08 0:51 
QuestionHow to connect webservice through provided WSDL and proxy class Pin
shames(Sam)14-Oct-08 22:19
shames(Sam)14-Oct-08 22:19 
AnswerRe: How to connect webservice through provided WSDL and proxy class Pin
leppie15-Oct-08 1:49
leppie15-Oct-08 1:49 
AnswerRe: How to connect webservice through provided WSDL and proxy class Pin
leppie15-Oct-08 1:52
leppie15-Oct-08 1:52 
GeneralRe: How to connect webservice through provided WSDL and proxy class Pin
shames(Sam)15-Oct-08 3:27
shames(Sam)15-Oct-08 3:27 
Questionmerged cell aoto fit in c# [modified] Pin
Nilish14-Oct-08 22:06
Nilish14-Oct-08 22:06 

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.