|
Soumya Mulukutla wrote:
I tried that too, but no change. Other thing i observed was it is running (as individual projects) from the editor but from the command line it just exits.
Show me your server code.
Soumya Mulukutla wrote:
I still did not figure out how to make the server and the client talk to each other.
That's a seperate problem. Are you using .NET remoting? Web Services? Message Queue? DCOM? Most likely you'll need to use one of those technologies. If both your client and your server are .NET Windows or .NET Console applications, .NET remoting is probably the right choice for you.
If you need help with one of those topics, or just need general help making your client talk to your server, I suggest you start a new thread, as there's much to be said on any of the remote messaging APIs.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
I'm getting the "Tcp Channel already registered" on an application I'm working on that acts as both a server and a client to be a simple chat client. Hope someone can tell me what the issue with my code is, here's the relevant bits:
---------------------------------------------
//Server
TcpChannel channel = new TcpChannel(8002);
ChannelServices.RegisterChannel(channel);
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(Hello), "Hi", WellKnownObjectMode.SingleCall);
//Rest of code here
// Client (on button click)
string ipaddr = textBox2.Text;
string port = textBox3.Text;
TcpChannel chan = new TcpChannel(8001);
ChannelServices.RegisterChannel(chan);
Hello obj = (Hello)Activator.GetObject(
typeof(Hello), "tcp://" + ipaddr + ":" + port + "/Hi");
---------------------------------------------------
Thanks in advance,
Matt
|
|
|
|
|
Maybe the process didn't exit properly and is still in memory? Have a look at the running processes in Task Manager.
Regards
Senthil
|
|
|
|
|
Thanks for the reply I've tested this app on the laptop and desktop, and same result on both. All times, the program exits correctly
Anymore ideas?
Many thanks,
Matt
|
|
|
|
|
Yes. The problem is that the application is trying to register a channel on the same port multiple times. That isn't allowed; what you need is to register each channel you have on a different port.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
So simply putting the different port numbers as i have (8001 and 8002) isn't enough?
|
|
|
|
|
There has to be another place in your code that is registering 8001 or 8002. Set debug breakpoints or output some text letting you know when a channel is about to be registered. The only time this message would occur is if a channel has already been registered on that port.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
When you think your program has exited clean, start a command prompt an type:
netstat -a
Look in the output for a "TCP computername:yourportnum..."
If you find an entry for one of your ports, then something is still running.
|
|
|
|
|
Is there any method to append to a string, here's what I'm doing:
<br />
string selectString = "SELECT * FROM table_name WHERE ";<br />
<br />
if(programName.Text != null)<br />
{<br />
}<br />
Any ideas?
|
|
|
|
|
Have you looked at the StringBuilder class?
|
|
|
|
|
If you are trying to append the string in a loop or trying to do a lot of appending, use the StringBuilder class. Otherwise just use
<br />
selectString += "Whatever text to be appended";<br />
Regards
Senthil
|
|
|
|
|
Apart from all that - I would never, never build SQL like this. To be honest, I'd never build SQL at all in my middle tier, I'd put it all in stored procedures.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
|
I went ahead and used the += syntax for now as I'm reading up on stored procedures as I write this (pretty talented eh? :-P)
thanks for the advice all.
PS - is there an informal rule to go by as to when to use stored procedures or to use StringBuilder?
|
|
|
|
|
why can't u try to insert
by writing:
this.yourText.insert(); // and these parameters have the starting index which will be your string's textLenght-1 and your additional string
ByMindOnlyYouCanDoIt
|
|
|
|
|
never, Never, NEver, NEVer, NEVEr, NEVER(!!) use string concatenation to build SQL statements. All your doing is teaching someone how to get themselves fired from a developer job. Instead, teach them the best way: stored procedures and parameterized queries.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
When I use System.Diagnostics.Process to launch a console app such as NAnt, the process hangs whenever the memory it uses exceeds some arbitrary amount.
In the NAnt example, this command line will execute to completion without errors: "NAnt.exe -buildfile:Some.Build -logfile:Some.log"
But this command line will hang and NAnt will not compile anything:
"NAnt.exe -verbose -buildfile:Some.Build -logfile:Some.log"
<br />
System.Diagnostics.ProcessStartInfo _StartInfo = new System.Diagnostics.ProcessStartInfo(command, commandParameters);<br />
System.Diagnostics.Process _Process = new System.Diagnostics.Process();<br />
_StartInfo.WorkingDirectory = workingDirectory;<br />
_StartInfo.RedirectStandardOutput = true;<br />
_StartInfo.UseShellExecute = false;<br />
_Process.StartInfo = _StartInfo;<br />
_Process.Start();<br />
TIA for any help.
|
|
|
|
|
|
|
try to write a webmethod written in C# which has to use a method imported from a dll written in C++.
public char[] stringa;
[DllImport(<dll_name>)]
public static extern int RPC_GetStringa( ref char[] stringatest);
[WebMethod]
public int RPC_GetStringaWs()
{
int j = -1;
stringa = new char[127];
try
{
j = RPC_GetStringa (ref stringa );
return j;
}
catch (Exception e)
{
return j;
}
}
on the other side (C++) RPC_GetStringa accepts just a array of 127 char.
It's doesn't work.. The exception is: "Can not marshal parameter #1: Ansi char arrays can not be marshaled as byref or as an unmanaged-to-managed parameter." }
Any suggestions will be very appreciated! Thanks in advance.
Paolo Leoncini
|
|
|
|
|
I'm using a ListBox without the scrollbar and I want to have a visual indicator to show that there is more item on the top or on the bottom of the ListBox.
For the top I use TopIndex, but for the bottom ? BottomIndex doesn't exist.
So, how to know the last visible index of a listbox ?
Thanks
|
|
|
|
|
I found a way with IndexFromPoint.
|
|
|
|
|
I'm using MAPI33 wrapper DLL in my C# program to read mails from Outlook/Exchange. I was using
the wrapper to avoid the popup messages thrown by the Outlook message guard and it almost workd
till I started reading attachments from a message. I was able to retreive attachment
size/number/name properites but was unable to open any of them. I'm facing problems with
IAttachment interface exposed by the wrapper.
This is how I'm trying to read attachments:
IAttachment tempAttach;
hr = msg.OpenAttach(intAttachNum,Guid.Empty,
__MAPI33__INTERNALS__.Message.FLAGS.DeferredErrors,
out tempAttach);
Above code gives a pointer to the Attachment object.
MAPI33.IUnknown stmUnKNown;
hr = tempAttach.OpenProperty(Tags.PR_ATTACH_DATA_BIN,
Guid.Empty,0,
__MAPI33__INTERNALS__.MAPIProp.FLAGS.DeferredErrors,
out stmUnKNown);
Above code is giving two types of errors depending on the Flag property i.e., for some I'm
getting "Invalid Property" and for others "Errors Returned."
Pls point me to any examples or additional information.
|
|
|
|
|
I have a client application that successfully uses a singleton remote object hosted on a seperate server. Recently I have changed the same client application to also use a second singlecall remote object. The two objects are exposed through two seperate channels. During develpment the singlecall object was on the same machine as the client application.
I mannged to get this working but when I move the new object to another machine it no longer works. All I get is an internal error message on the client saying to turn customErrors on in the server. However doing so chnages nothing.
Any ideas where I'm going wrong?
|
|
|
|
|
Maybe it's got something to do with the machine's CAS policy? Did you try setting the TypeFilterLevel to full?
Regards
Senthil
|
|
|
|