|
Ups, my fault
this.chkboxGroup.Items.Remove(this.chkboxGroup.Items[i]);
www.troschuetz.de
|
|
|
|
|
Thank you for your replay!
|
|
|
|
|
I need a robust way to insert some hidden information of 2 bytes in a text file which should not be visible in a normal text editor,I can't use Alternative data streams as when we unzip them the info gets lost,Plz help!!
|
|
|
|
|
There's no way to completely *hide* 2 bytes, but you can crypt them or scramble them so in the notpad will be shown 2 little squares...
CodeProject's Server wrote:
HTTP/1.1 500 Server Error
|
|
|
|
|
Is it possible (e.g. with reflection or by using some debugging-/profiling-API) to write a class that is aware of the context where it is instantiated?
E.g. something like this:
class SomeClass {
void A( int i, string s )
{
ContextDumper cd = new ContextDumper();
string d = cd.Dump();
...
}
} with function A being called like this:
void B()
{
SomeClass sc = new SomeClass();
sc.A( 10, "hello" );
} And cd.Dump() returning a string like this:
Hi, this is ContextDumper.
I was called inside the following function
with the following paramters:
SomeClass.A( int i=20, string s="hello" ) Is this possible? If yes, how?
--
Affordable Windows-based CMS for only 99 €: try www.zeta-producer.com for free!
-- modified at 8:33 Wednesday 21st September, 2005
|
|
|
|
|
Look at system.diagnostics.StackTrace and StackFrame.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Yes, thanks; but these classes do not tell me with which current parameter values the method is called.
--
Affordable Windows-based CMS for only 99 €: try www.zeta-producer.com for free!
|
|
|
|
|
The only way I know to get the parameters like this is to use enterpriseServices and setup a context for the object. Here is an example of the technique.
http://www.codeproject.com/dotnet/ContextBoundModel.asp[^]
I don't know of any way to get the actual parameters in regular code.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Hi all!
I need to create application to capture video and audio. To do this I use WMEncoder SDK. I use video tape recorder device connected through a COM port using the Sony RS422 protocol. Everything is good - I can capture and control my device. But I have a problem, when I try to change settings of encoder instance. Here is source:
<br />
WMEncoder Encoder;<br />
IWMEncSourceGroupCollection SrcGrpColl;<br />
IWMEncSourceGroup2 SrcGrp;<br />
IWMEncVideoSource2 SrcVid;<br />
IWMEncSource SrcAud;<br />
IWMEncDeviceControlCollection DCColl;<br />
IWMEncDeviceControl DControl;<br />
IWMEncDeviceControlPlugin DCPlugin;<br />
Encoder = new WMEncoder();<br />
SrcGrpColl = Encoder.SourceGroupCollection;<br />
SrcGrp = (IWMEncSourceGroup2) SrcGrpColl.Add("SG_1");<br />
SrcVid = (IWMEncVideoSource2) SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);<br />
SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);<br />
SrcVid.SetInput(_video, "Device", "" );
SrcAud.SetInput(_audio, "Device", "" );
IWMEncProfileCollection ProColl = Encoder.ProfileCollection;<br />
for (int i=0; i<ProColl.Count; i++)<br />
if (ProColl.Item(i).Name == _profile)<br />
{<br />
SrcGrp.set_Profile(ProColl.Item( i ));<br />
break;<br />
}<br />
DCColl = SrcGrp.DeviceControlCollection;<br />
DControl = DCColl.Add();<br />
DControl.SetInput(_device, "DeviceControl", "");<br />
Encoder.PrepareToEncode(true);<br />
DCPlugin=(IWMEncDeviceControlPlugin)DControl1.GetDeviceControlPlugin();<br />
So, when I try to change my settings (_video, _audio, _profile or _device) and do Encoder.PrepareToEncode(true) I catch an exception "It was not possible to find a valid source plug-in for the specified source". I try to set null for all of using vars after doing Encoder.PrepareToEncode(false), but have no result. Maybe somebody do something like this? Thanx for all advices.
_sergei
|
|
|
|
|
While reading a large textfile with, I am going to implement a Progressbar. My question is how to determine the MAX value for this progressbar? So I can update the progressbar dynamically, while application is reading textfile.
|
|
|
|
|
Get the size of the file before you open it.
---
b { font-weight: normal; }
|
|
|
|
|
Sure, but how to determine actual file block and block size?
StreamReader and TextReader don't support a method to do it.
|
|
|
|
|
Block size? What do you mean?
---
b { font-weight: normal; }
|
|
|
|
|
File fIn = new File<br />
("C:\\dotNET Projects\\Namespaces\\EnumFiles\\ReadMe.txt");<br />
StreamReader strm = fIn.OpenText();<br />
<br />
string sLine;<br />
do<br />
{<br />
sLine = strm.ReadLine();<br />
AddItem(sLine);<br />
}<br />
while (sLine != null);<br />
strm.Close();<br />
<br />
Look at the code posted above. After sLine = strm.Readline, I want update the progressbar value but don't know the MAX value of this one before.
|
|
|
|
|
Get the size of the file in bytes, divide by two to get the number of chars. Finally use sLine.Length to get the number of chars you just read in.
|
|
|
|
|
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
|
|
|
|