|
Dividing the size by two to the the number of chars only works if the textfile is saved as 16 bit unicode. Most text files are ANSI or UTF-8, which uses 8 bit encoding.
---
b { font-weight: normal; }
|
|
|
|
|
Hi all,
I have a server with a server object and a UI (2 different classes). The server object must send UI update events to the UI. I want to have an instance of the shared object in my UI class.
If I create an object in the UI of the server object, it is not the same as the object that is retrieved when using Activator.GetObject(...);
Is there a way I can specify which object is shared using the Activator.GetObject function? What I want is to create a server object in my UI class. That object should also be shared when a client uses the function Activator.GetObject.
Is this possible?
Thanks!
Geert
Want to spread the newest version of your software automatically for free? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|
Did you try using RemotingServices.Marshal ? That allows you to register an already created object as a remote object.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks for you answer. This is my code now:
<br />
tcpServerChannel = new TcpChannel(8080);<br />
<br />
ChannelServices.RegisterChannel(tcpServerChannel);<br />
<br />
RemotingConfiguration.RegisterWellKnownServiceType(<br />
typeof(IMyClass),<br />
"MyClass",<br />
WellKnownObjectMode.Singleton);<br />
<br />
myobject = new MyClass();<br />
<br />
myobject.UpdateServerData += new UpdateServerDataHandler(UpdateData);<br />
<br />
RemotingServices.Marshal(myobject, "tcp://localhost:8080/MyObject", typeof(IMyObject));<br />
As you see, I want to be triggered when the server data changes. However, the UpdateServerData of the server object is <undefined> when I use a breakpoint at the point it should throw the event.
Any ideas?
Geert
Want to spread the newest version of your software automatically for free? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|
On the Pocket Pc emulator of VS2003 i'm trying to run an application that
want to access web services on a java server ( using JWSDP 1.5).
And occurs a error, and i don't no how to slove it:
----------------------------------------
unexpected encoding style:
expected=http://schemas.xmlsoap.org/soap/encoding/, actual=
----------------------------------------
A think it's a lack of what is the actual enconding, but i'm not sure...
Thanks
|
|
|
|
|
can anyone tell me how to make a windows serivce that starts a timer and increments the value in a text file every 10 seconds? I've worked on windows applications but i dont have a clue about services.
|
|
|
|
|
private void submit_Click(object sender, System.EventArgs e)
{
if (userName.ToString() ="myname") && (userPwd.ToString()= "mypassword")
{
Response.Redirect("index.htm");
}
else
{
Response.Redirect("error.htm");
}
}
---------------------
debugger report:
Operator '&&' cannot be applied to operands of type 'string' and 'string'
How to correct it??
shanzy
|
|
|
|
|
= should be ==
---
b { font-weight: normal; }
|
|
|
|
|
Could it be that you're coming from a VB background?
First, C/C++/C# uses '==' to test for equality and '=' for assignment.
Secondly, the whole if clause has to be written in parenthesis.
if ((userName.ToString() == "myname") && (userPwd.ToString() == "mypassword")) Btw. please tell me you don't plan to use this code outside your test project...
mav
|
|
|
|
|
thank you for your answer,I got it!
shanzy
|
|
|
|
|
If userName and userPwd are TextBox controls (as opposed to string variables), you have to use the Text property.
if(userName.Text == "myusername" && userPwd.Text == "mypassword") Also note the equality operator (== ) instead of the assignment operator (= ).
And yes, please tell us this is not real production code!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Could any one tell the real time experience in .net remoting.
If so pls describe it.
What is the design pattern that has to be followed
www
|
|
|
|
|
|
Hello,
I am developing a program to access mails from a Exchange server 2003 Mailbox. For this I am using MSXML 2.6, XMLHTTP and WebDav protocol's PROPFIND method.
Till Now I created one Sample Console Application to execute these tasks (basically Exe). But when I try to implement the same logic in Web Application I am getting an Error. See the screen shot below.
I tried the same with a Console Application/Windows Application, both are working fine and able to access Exchange Server 2003. I am able to Read/Send Emails from Exchange Server and also able to Change Mail Message Status as Read.
Problem is when I create Class library (dll) or a Web Application to use the same code I am getting the error and I am unable to access Exchange Server 2003. I tried with different versions of MSXML but no use.
Any help regarding this would be very helpful.
Thanks & Regards,
Srinivas Muvvala.
|
|
|
|
|
I know Pen.CustomLineCap provides the function.But I don't know how to use it.
And I tryed to look for some knowledge about this class,but the information is so poor.Can you help me?
Thanks!(Please email to me!)
|
|
|
|
|
Here is an example from MSDN.
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
|
Hi!
In order to draw an arrow tip at the beginning or end of a line you'll have to assign the correct CustomLineCap to your pen, as you've already found out.
For an arrow, this is an instance of AdjustableArrowCap .
You can control the look of the arrow tip by setting the Width , Height , MiddleInset , Filled and WidthScale properties.
Then it's really easy.
Regards,
mav
|
|
|
|
|
Thank you,I have resolved the problem in your help.
|
|
|
|
|
yeah, I have a listBox that the user can select multiple items in the list, how do I go about removing the selected items? I tried so many things, but I haven't had any success, I'm thankful for any help.
Stephen
|
|
|
|
|
Remove the selected items from the list?
for(int i = lstBox.SelectedItems.Count; i >= 0; i--)
lstBox.Items.RemoveAt(i); You have to do it bottom-up. If you do top-down, when you remove an item on the top, the index of the items below it change. You could also do this:
while(lstBox.SelectedItems.Count > 0)
lstBox.Items.Remove(lstBox.SelectedItems[0]); but I think the first way is easier to understand.
I hope this helps!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
|
the error i recieve was
'SerialPlcProgram.Form1.txtStatus' denotes a 'field' where a 'class' was expected
i got a
public static void ReadThread()<br />
{<br />
SerialPort line = new SerialPort();<br />
string ReplyString;<br />
ReplyString = Encoding.ASCII.GetString(line.Read(10));<br />
txtStatus.Text= ReplyString;<br />
<br />
}
and i start a thread for read just after a open()(open connection for serial connection)
|
|
|
|
|
What's wrong with the thread you started 40 minutes ago?
You are trying to use txtStatus as if it were an object.
---
b { font-weight: normal; }
|
|
|
|
|
sorry for the double post..
th last thread was askin for you all point of view if i should use a thread for my read function.
and yes i was hoping to up date a textbox in the form directly from the thread..
is it possible?
|
|
|
|