|
Well I can do that and still fall back to brute force searching for the next image if it fails
|
|
|
|
|
i have want to entertanin one client when second client want to connect then it will not connect i have set the tcplistner.listen(1) also, but when i connect to this i will place the second client to blocking queue.
i dont want to stop the listening socket. but i want to reduce the blocking queue.
i have tested tcplistner.listen(1) and tcpListener.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.MaxConnections, 1);
when i set SocketOptionName.MaxConnections then i get the following exception
{"An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call"}
|
|
|
|
|
I want to connect to a sqlserver instance on another computer in the workgroup network.
----------------------------------
my application: VS.NET 2008-C#
my DB: SQL Server 2000 Personal Edition
my OS: Win XP Profesional sp3
----------------------------------
I have done these steps:
1. in target sql server instance: Enterprise Manager -> server -> right click -> Properties -> Connections tab -> tick:
-allow other sql servers to connect remotely to this sql server using RPC
-enforce distributed transactions
2. in target sql server instance: Enterprise Manager -> server -> right click -> Properties -> General tab -> Network Configuration... button ->
enabling TCP/IP
3. in target sql server instance: Enterprise Manager -> server -> right click -> Properties -> Security tab -> Authentication ->
SQL Server and Windows
4. I created a New Login in target sql server instance:
Name=admin , Password=1001 , SQL Server Authentication , Database=Exam
5. my SqlConnection in application:
"Server=192.168.0.205\\MYSQLSRV; Initial Catalog=Exam; Integrated Security=False; Persist Security Info=False; User ID=admin;Password=1001";
6. I removed anti virus softwares and turned off Windows Firewall.
7. I tested both of my computers to ping to another
But I have an error yet:
an error was occured while establishing a connection to the server. when connecting to sql server 2005, this failure may be caused by the fact under the default settings sql server dose not allow remote connections.
(provider:sql network interfaces, error:26-error locating server/instance specified)
----------------------------------
can any one help me ?
H.R
|
|
|
|
|
|
Hi guys,
i am implementing a RTP application. i have created an RTP class. there are two bytes Header fields, one is Sequence Number(size of 2 bytes) and 2nd is TimeStamp(size of 4 bytes). i want to increment sequence number by 1 and Time Stamp by 160 when i send the packet to the network.
This increment will be done when the bufferfull event is called. i am incrementing with the mentioned values but when i monitor it, it increases randomly. is this the thread problem?
any solution for this problem. i am writing my event handler here of buffer full event.
void m_pWaveIn_BufferFull(byte[] buffer)<br />
{<br />
<br />
byte[] sentData = G711.Encode_aLaw(buffer, 0, buffer.Length);<br />
<br />
sentData = rtpPacket.getRTP_Packet(sentData);<br />
<br />
byte[] seqNo = BitConverter.GetBytes(seq);<br />
byte[] TimeStamp = BitConverter.GetBytes(timStm);<br />
<br />
Buffer.BlockCopy(seqNo, 0, sentData, 2, 2);<br />
Buffer.BlockCopy(TimeStamp, 0, sentData, 4, 4);<br />
<br />
m_pUdpServer.Send(sentData, sentData.Length, m_pTargetEP);<br />
<br />
seq++;<br />
<br />
timStm += 160;<br />
}<br />
<br />
Thanks to All.
|
|
|
|
|
try Interlocked.Increment()
Calin Tatar
|
|
|
|
|
if there are two threads running then you should declare the seq as a volatile int.
When ever a thread is to modify the value it should be locked.
lock(seq);
seq++;
unlock(seq);
btw what sort of RTP application is this??
|
|
|
|
|
Hi
I create a main Form with a splitContainer
In the Left panel I put a Tree View
In the Right panel I like to open diferent forms according to de selected information in the treeview.
Example
Tre view - Item - Customer xxx
When double click on on this customer a new CustomerFor with customer details open in Right panel
If anoter customer yyy is selected a second CustomerForm open in the same panel
A sort of tabContol cold be use to swich between Customer xxx and Customer yyy
I try with MDE but I dont know hot to restrict the opening of the Child forms to the right panel of the splitContainer or anoder object capable of containing Forms.
any clue?
|
|
|
|
|
I do not know of a way to constrain a form within another form. I don't think that it is possible in C#, perhaps someone with more knowledge will respond and let you know.
However, what you can do is build a 'customer' control. Add a new User Control to your project and design it like you would a form. Add this control to the right panel. Then, when the TreeView is clicked, just fill whatever controls you have put on your 'customer' control with the data for that customer.
You can then have a separate form just containing the new control, for occasions when it is more appropriate to display it as a form.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Henry is definitely on the right track. Think of forms as layouts. Which in turn have panels. You then create a user control for the "subform" and load it into the right panel of the main form. This works extremely well and now you can decouple your views and reuse them in different layouts and containers.
I hope that this helps you.
|
|
|
|
|
I think is a good idea
But very complex to maintain
We are all use of this kind of interface
The IDE work exactly as I want:
Multiple pages, im my case Forms
The tree view is the solution explorer.
How could be this so dificult to replicate.
Cristian
|
|
|
|
|
If you are absolutely determined to do 'Form Docking', it can be done. But not in pure c#. A great deal of P/Invoke is required, to get this functionality.
Take a look at this[^] for examples.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I take back some of my last post.
I have just read Eddy Vluggens response.
This definitely CAN be done in pure c#.
Very slight modification to his code
private void btnForm_Click(object sender, EventArgs e)
{
Form newForm = new Form();
newForm.TopLevel = false;
newForm.Parent = this;
newForm.Visible = true;
newForm.Location = new Point(10, 10);
newForm.Size = new Size(this.ClientSize.Width - 20, this.ClientSize.Height - this.panel1.Height - 20);
newForm.BackColor = Color.Bisque;
newForm.FormBorderStyle = FormBorderStyle.None;
this.Controls.Add(newForm);
}
getting rid of the border, to save you having to look it up if you weren't aware of it already.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hey Christian,
I am having exactly the same problem.
I use a SplitContainer and and have placed a TreeView control inside. In the right side of the split container, one of five different Forms shall be loaded, depending on what's selected in the TreeView. Up to now, I unfortunately have not found a solution, but I'm new to C#, so this does not mean anything
"SubForms" even work in LabVIEW, so I would be very amazed, if C# would be unable to do the same...
Peter
|
|
|
|
|
I have seen this in 3P Component, I think it was .Net Bar
But this is out of my budget, So I'm trying to develop a solution with the component that come with C#.
If I find something I let you know.
Cristian
|
|
|
|
|
Ok, that sounds fine. Thank you!
Peter
|
|
|
|
|
A form inside a form;
Form newForm = new Form();
newForm.TopLevel = false;
newForm.Parent = this;
newForm.Visible = true;
newForm.Location = new Point(10, 10);
this.Controls.Add(newForm);
Is this what you're after?
Happy Programming
I are troll
|
|
|
|
|
Perhaps you could use the NativeWindow class, passing a CreateParams structure with its Parent property set to the Handle property of the right handle Panel. Then, display the form and use the SetParent PInvoke call to make it a child window of the parent
Pseudocode:
NativeWindow wnd = new NativeWindow(new CreateParams()
{
Parent = rightHandPanel.Handle,
Height = rightHandPanel.Height,
Width = rightHandPanel.Width,
X = Y = 0
}
Form display = formYouWantToDisplay;
wnd.CreateHandle();
display.Show(wnd);
This would require quite a bit of research to work properly I think. Are you sure you don't just want to have an MDI parent, and dock a panel containing a treeview to the left hand side?
modified on Sunday, March 1, 2009 1:54 PM
|
|
|
|
|
If you use MDI, you can't exactly control where the MdiClient (which is where MDI children are located) window goes.
However, I would try this (I once tried something similar and it worked):
1. Create your main form
2. Set its IsMdiContainer property to true
3. Add a panel and dock it to the left of your main form.
[EDIT: If you want a splitter, add it here and also dock it to the left. But don't add a SplitContainer , but an original Splitter[^] control.]
4. Add the TreeView and whatever else inside that panel
When you create MDI children, they will be located inside the MDI client area, which will be to the right of your tree view.
I hope this helps
|
|
|
|
|
Hi evirione
For any one interest in this
Here I publish my solution
Object in Form1
splitContainer1
tabControl1 (in the right panel of the splitContainer1)
The tabControl does not have any page on design.
The left panel I intent to put a treeView, but for this code, there is a button
button1 (in the left panel of the splitContainer1)
this is the code for the button click event
private void button1_Click(object sender, EventArgs e)
{
TabPage newTabPage = new TabPage("Form " + tabControl1.TabPages.Count);
newTabPage.Size = new Size(tabControl1.Width, tabControl1.Height);
Form2 newForm = new Form2();
newForm.TopLevel = false;
newForm.Parent = this;
newForm.Visible = true;
newForm.Location = newTabPage.Location;
newForm.Location = new Point(3, 3);
newForm.Size = new Size(newTabPage.Width - 3, newTabPage.Height - 3);
newForm.FormBorderStyle = FormBorderStyle.None;
newTabPage.Controls.Add(newForm);
tabControl1.TabPages.Add(newTabPage);
}
Becaus Microsoft does not provide the Tab control we all use in the IDE, that allow to close a tabpage with an X in the upper right corner, I have no alternative and just use a normal tabControl
Now, in order to destroy the tabpage when closing the form created on each page.
In Form2 I add a button, and the followin code.( this close the form and destroy the tab page.
private void button1_Click(object sender, EventArgs e)
{
TabPage tab = this.Parent as TabPage;
TabControl tabControl = tab.Parent as TabControl;
tabControl.TabPages.Remove(tab);
this.Dispose();
}
Hope this help
Cristian Conrads
modified on Monday, March 2, 2009 7:05 PM
|
|
|
|
|
I want to display a calender on desktop [right side] if any one can help me helping link
Please keep following points in mind
- application will be running in background. [at startup]
- icon will be in Tray no tab in Task bar. when double clicked then in Task Bar.
Thanks
|
|
|
|
|
To make your application run when Windows starts, put it into the Startup folder. I think there are registry keys you can add it to. To make the tray icon, use the NotifyIcon component, and simply show the form with the calendar upon the double click of the aforementioned component. You can actually find a calendar-like component in the .Net Framework - I think it's something like DateTimePicker. Inherit from that, link it to a collection of dates, and you have your calendar. To make the form display on the right hand side of the desktop, set the Dock property of the form to Right
|
|
|
|
|
Thanks For Giving Idea
But i am talking to put calender on desktop not on the form's right. On desktop where icons will be on left side and my calender on right side
hope u understand what i want.
|
|
|
|
|
I see. You could theoretically put some code in the Resize event handler to adjust the size and location of the form. Use these equations:
Form.X = Screen.Width - Form.Width
Form.Y = 0
Form.Height = Screen.Height
Form.Width can be anything you want it to be. This will look best if you set the BorderStyle to None
|
|
|
|
|
Nice Idea to calculate the Location on desktop.
But i want to bound the calender application object added to Windows Desktop Object in such a way that it behave like icons on desktop. so that when all applications in Taskbar are minimized my application still will be visible on desktop
Basic thing i want is access to desktop and put my calender object into that.
|
|
|
|