|
With namespace or not, e.g class name is "classA" in namespace "nsA", so on resource use "nsA.classA.bmp" or only "classA.bmp"?
Thanks for the reply.
|
|
|
|
|
Shouldn't need it. If should just be classname.BMP.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I tried that but not working, I'm VB.net, my component is in this namespace "CRMSoft.Controls.Forms.NumberPicker.vb" Bitmap and left it at "CRMSoft.Controls.NumberPicker.bmp" not right?
Cleber Roberto Movio
|
|
|
|
|
Hi
I would like to list all the available servers from tnsnames.ora file.
DBNAME =
(DESCRIPTIOMN= (ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.114.2.145)(PORT=1521))
(CONNECT_DATA=SERVICE_NAME=dbname))
In this file i want to read exactly "service_name = dbname". How to do it in C#. Any one could you help me please?
kesavan
|
|
|
|
|
Please don't cross post.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
Ok another problem with .NET Remoting.
Server create object in mode='singleton' by file configuration. Object has member 'parent_'.
Like this:
-----------------------------------------------------------------------
RemotingConfiguration.Configure(@"TestServer.exe.config", false); remoteobject_ = new RemoteObject();
remoteobject_.parent_=this
-----------------------------------------------------------------------
I tried connect to this object in client like this:
-----------------------------------------------------------------------
RemotingConfiguration.Configure(@"TestClient.exe.config", false);
WellKnownClientTypeEntry[] ClientEntries = RemotingConfiguration.GetRegisteredWellKnownClientTypes();
remoteobject_ = (RemoteObject)Activator.GetObject(typeof(TestRemothing.RemoteObject),ClientEntries[0].ObjectUrl);
-----------------------------------------------------------------------
and i noticed, that client work with other remote object than server. Why? How client can work with object, that already created by server?
|
|
|
|
|
I fined solution! Thank's codeproject
qqq
|
|
|
|
|
By using this, what exactly is locked? A specifiek variable or the thread itself or the variables that have been modified with 'System.Threading.Interlocked.Increment'?
I THINK 'THE VARIABLES THAT HAVE BEEN MODIFIED BY THE THREAD'. WRIGHT?
If you have the following:
public static void Synchronization_WriterLock()
{
System.Threading.ReaderWriterLock oReaderWriterLock;
oReaderWriterLock = new System.Threading.ReaderWriterLock();
miCount = 0;
try
{
oReaderWriterLock.AcquireWriterLock(100);
try
{
System.Threading.Interlocked.Increment(ref miCount);
Console.WriteLine(miCount);
}
finally
{
oReaderWriterLock.ReleaseWriterLock();
}
}
catch (ApplicationException e)
{
Console.WriteLine("Failed to get a Writer Lock");
}
}
What locks what?
-- modified at 17:03 Wednesday 27th December, 2006
|
|
|
|
|
Can anybody help me . I use remote object with events. When client connect to event - system throw SecurityException:
"Message = "Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level."
In MSDN i finded this:
--------------------------------------------
To adjust the security level
1. Modify the configuration file(s) generated in conversion.
- or -
2. Edit the converted code.
--------------------------------------------
but how to do it?
qqq
|
|
|
|
|
OK. I find solution! Thanks
qqq
|
|
|
|
|
Hi all
I am developing one installation wizard. I have one issue. If i click the next button I made the current form visible = false and creating instance for the next from and showing the form. There problem I facing is, I dont know how to show the previous form by hidding the current form. Can anybody help me please....
Thanks
kesavan
kesavan
|
|
|
|
|
CurrentFormName.Hide
PreviousFormName.Show
Obviously that's VB code, but you should be able to figure out the C# equivalent pretty easily.
|
|
|
|
|
Just to be clear - if you're inside the current form, you need to only call Hide, and specifying the name of the form classes won't work, you need to specify the name of form instances that are visible within the scope of the method that's got the call in it
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I was expecting the result of this search for "1" to be at location "0"
<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
List<double> listItems = new List<double>();<br />
<br />
listItems.Add(1);<br />
listItems.Add(2);<br />
listItems.Add(4);<br />
listItems.Add(6);<br />
listItems.Add(4);<br />
listItems.Add(3);<br />
listItems.Add(8);<br />
listItems.Add(4);<br />
listItems.Add(1);<br />
<br />
listItems.Sort();<br />
<br />
for (int i = 0; i < listItems.Count; i++)<br />
{<br />
Console.WriteLine("{0} : {1}", i, listItems[i]);<br />
}<br />
<br />
Console.WriteLine(listItems.BinarySearch(1));<br />
}<br />
}<br />
However, the result is at location "1". Any reason for this?
With love,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Paul
In your list, you have two entries for 1. You sort your list, so both those entries will move together, i.e. be at position 0 and 1. Now, a binary search works by starting at the center of the list, and then deciding whether or not the value has been found or is higher or lower. In this case, it is lower. It effectively discards the top of the list and moves to the center of the lower selection and repeats this process again. It keeps going until it finds a match. In this case, it will find the item at position 1 because that is the first match it will find. I hope that this makes sense to you.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: I hope that this makes sense to you.
It does. That it starts from the center, I know but I think as an algorithm, there are checks to account for cases like this.
I have tested a case of three "1", and the result is position "1", and for four "1", the result is position "2".
So, may be the question should be should conditions must be there before we consider binary search?
With love,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Your array after sorting would look like 1 1 2 3 4 4 4 6 8
If you look at the way binary search works, the first condition of it would be
low = 9
high = 0
mid = 4
if (collection[4] = SearchItem) -> false
now since the search item wasnt found and the search item is less than the mid value, the elements that would be used to search next would be 1 1 2 3
low = 3
high = 0
mid = 1
if (collection[1] == SearchItem) -> True, so it returns the position of mid which is 1
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
|
|
|
|
|
I have tested a case of three "1", and the result is position "1", and for four "1", the result is position "2".
So, may be the question should be should conditions must be there before we consider binary search?
With love,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
In the following code, I use a a DataView to find all the records in my table that meet criteria X. I then change the value in the DataRowView so that they no longer meet criteria X.
After I change a couple of DataRowViews, I get an exception that my index is out of range. It looks like the DataView object is updating the Table, and re-evaluating the RowFilter criteria, and updating itself. So, there's now less DataRowViews in my DataView, and my index is incorrect.
Can that really be happening? Are you not supposed to modify the DataView? Or should I be locking it somehow?
private void ClearCurrentSetInPlayistTable()
{
// goes through the Libraries And Playlists Table, setting
// any playlist whose IsInCurrentSet col value is true, to false
DataView dv = new DataView(dtLibrariesAndPlaylists);
string strRowFilter = IsInCurrentSet + " = true";
dv.RowFilter = strRowFilter;
int dvRowCount = dv.Count;
for (int i = 0; i < dvRowCount; i++)
{
DataRowView drv = dv[i];
drv[IsInCurrentSet] = false;
}
}
Thanks,
Joe
|
|
|
|
|
My original suspicion is correct, and is valid behavior.
By modifying the DataViewRow, I'm modifying the underlying table. This causes all of the DataView "children" from the table to be updated, and the count of rows in my DataView goes down.
I could get around this problem by putting the actual row count, and not a copy of it's initial state, into my loop statement. Instead of:
int dvRowCount = dv.Count;
for (int i = 0; i < dvRowCount; i++)
{
DataRowView drv = dv[i];
drv[IsInCurrentSet] = false;
}
I would just use
//int dvRowCount = dv.Count;
for (int i = 0; i < dv.Count; i++)
{
DataRowView drv = dv[i];
drv[IsInCurrentSet] = false;
}
However, since the update to the DataView is coming in asynchronously, this might still fail.
The real solution here is to use a Table.Select() instead of a DataView here. The set of rows returned by the Select are static, and aren't updated by changes to the underlying table.
|
|
|
|
|
I have a ToolStripDropDownButton, which drops a menu. During run time, my code adds a dropdownmenu to each of those items, ala:
// top level menu item is A
// submenu is B
B = new ToolStripMenuItem(); // new menu item
B.Text = "Checkable Sub Menu";
A.DropDownItems.Add(B);
To A, I will add a dynamic number of DropDownItems. Later, in code outside of this scope, I need to handle the CheckStateChanged event for those items. How do I code a handler for them?
If I've added B in the Designer, then I can easily write the handler using the name:
private void B_CheckStateChanged()
However, since these items are created on the fly, how do I can I write a handler that doesn't need to know their name?
I'm working in C#, if it's not clear. TIA for the help.
|
|
|
|
|
You can specify the event handler for B before adding it to A
B.CheckStateChanged += new System.EventHandler(CheckStateChanged);
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
|
|
|
|
|
Thanks for the quick answer!
I'm still a little confused, though. It looks like you are specifying a type of handler, and not a specific instance of a handler?
In other words, did I write a handler somewhere, that is being called when B.CheckStateChanged fires for B?
And what did it look like (the declaration)?
Thanks!
|
|
|
|
|
I am sorry, I shouldnt have used the Event name
B.CheckStateChanged += new System.EventHandler(CheckStateChanged_Event);<br />
<br />
void CheckStateChanged_Event(object sender, System.EventArgs e)<br />
{<br />
}
I guess this makes it clearer
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
|
|
|
|