all groups > c# > march 2008 > threads for wednesday march 12
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
.NET Runtime 2.0 Error
Posted by hermbagger at 3/12/2008 11:59:47 PM
I have written a server in C# using the .net 2.0 socket class. The
server will run fine accepting incoming connections and handling
connected sockets (up to 10 at a time) just fine. It may run for 2
weeks without a hitch, then all of the sudden, without any
notification, the server will just d... more >>
Implementing Unmanaged Interface in C#
Posted by Saad at 3/12/2008 11:03:21 PM
Hi,
I have an unmanged interface which i have exposed through COM to C#. I
have been able to implement the interface in one of the C# classes
(say Class1) as well.
But now what i want to do is that i need to pass the reference of the
object of Class1 to this COM wrapper...and then from insi... more >>
Custom Control in c#
Posted by anant at 3/12/2008 10:12:17 PM
Can anyone tell me how can i write on a custom control area using
keyboard.
i.e i want that custom control to work like textbox, but i m not
using (inheriting) textbox instead
i m creating my control using UserControl
thanks in advance.... more >>
How to define struct with array in C#?
Posted by Polaris at 3/12/2008 10:11:55 PM
Hi Experts:
In my C# program I need to use a Win32 DLL which leads to a question: how to
define Win32/C++ struct with array in C#. For example, I have a C++ struct:
struct MY_STRUCT
{
int nCities[128];
};
How to define it in C#?
Thanks in advance!
Polaris
... more >>
How to retrieve static property of DLinq entity
Posted by Andrus at 3/12/2008 9:30:34 PM
I need to associate text used in messages with every DLinq entity type.
I need to retrive this text from entity name.
I tried to solve this by creating public static readonly property Text in
every entity and
use EntityManager.GetText() method.
Is this best way or is there any better idea... more >>
Namespaces and Inheritance
Posted by Robert Cramer at 3/12/2008 8:39:08 PM
Is it perfectly acceptable, from a "conventions" or "best practices" point
of view to have a class in one namespace extend a class in another
namespace?
I just came across this state of affairs in the .NET Framework itself and,
at first, it seemed somehow like a "bad thing" (in part because... more >>
Why are threads so scary?
Posted by Jeffro at 3/12/2008 8:14:11 PM
I'm trying to learn threads so I created a simple dialog based MFC app
with an edit box, a Run button and an Exit button. Run starts a loop
that continually updates the edit control. How do I modify the code so
that the dialog responds to events? That is, so the Exit button will
work. Do... more >>
Thread Question - When do they die?
Posted by jehugaleahsa@gmail.com at 3/12/2008 7:09:13 PM
I have some code that looks like this:
int[] customerIds = { 1, 2, 3, 4, 5, 6, 7, 8 };
List<Thread> threads = new List<Threads>();
foreach (int customerId in customerIds)
{
Thread thread = new Thread(delegate()
{
// do calculation with customerId
});
threads.Add(th... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
which network am i on
Posted by rodchar at 3/12/2008 5:28:00 PM
hey all,
i have a test network that's exactly like my prod network (except for the
FQDN) and all i have to do is move my network cable from one network to the
other.
sometimes i forget which network i'm on while working on an application. do
you know of some different ways in csharp i can... more >>
How to automate another application?
Posted by Siegfried Heintze at 3/12/2008 5:18:01 PM
I have an application I want to automate. I don't believe it has COM
automation (how do I tell?)
Is there a .NET counterpart to COM automation? If so, how would I determine
if this application supports it?
The only way I can think to automate it is to enumerate all the windows on
the sys... more >>
ASP.NET GridView Control basic question
Posted by Johnny Jörgensen at 3/12/2008 5:09:14 PM
This is probably a stupid question, but I've never used the ASP.NET GridView
control before, so I hope you'll bear with me and give me a clue.
I've got a Gridview on my webform to show the contents of a database table.
It's configured to show both "edit" "delete" and "insert" options in the
co... more >>
2 applications using membership provider, how to setup things in IIS?
Posted by DotNetNewbie at 3/12/2008 3:49:35 PM
Hi,
I have one application that is a CMS that uses .NET membership.
Now on the same domain, I have to setup a ecommerce store.
I want the URLS to look like:
www.example.com <-- ecommerce application
www.example.com/articles/ <-- CMS Installed there
The CMS has the login page als... more >>
Factory method question
Posted by jonathan.broderick@gmail.com at 3/12/2008 3:39:39 PM
I'm needing a little bit of clarity on using the factory design
method.
Lets say I have two concrete classes that implement an interface. Then
I have two factories that instantiate objects of that type. I would
like to have the two factories adhere to a common interface for
creating the objec... more >>
Encoder - Removal??
Posted by Bsmengen at 3/12/2008 3:22:00 PM
I have a C# application that uses Windows Media Encoder 9 to stream multiple
programs. For each new program, I create a new instance of WMEncoder. After
successfully stopping the Encoder, what is the proper way to remove it for
Garbage Collection? Currently I set Encoder = null and Garbage ... more >>
arraylist
Posted by RobcPettit@yahoo.co.uk at 3/12/2008 3:07:11 PM
Hi, hopefully Ill explain my question ok. Im using an arraylist to get
an an array of values from an application, which allows me to use a
com interface to interact with its functions. I have no access to the
code. I use prices.Add(ba.getPrices());, prices bieng my arraylist. It
returns 1 elemen... more >>
Singleton Question
Posted by Chris Fink at 3/12/2008 1:49:01 PM
I am trying to implement a singleton pattern in my application. I need to
make sure that this class is both thread safe and ensure that only 1 instance
can created at any given time.
As you can see below I create a two instances of the singleton class, s1 and
s2. Both s1 and s2 are indeed... more >>
Linq oddity?
Posted by Chris Dunaway at 3/12/2008 1:20:21 PM
The following code is placed a new Windows Forms App and a
DataGridView and BindingSource are dragged onto the form:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Win... more >>
displaying data realtime in a textbox
Posted by auldh at 3/12/2008 1:08:04 PM
hello,
i'm not sure if this is possible. i have a small VS 2005 C# windows
application. it has a textbox and a button. once the user presses the button
it fires off many tasks. i want to use the "textbox" to give realtime update,
a status window.
it seems that in some part of the program t... more >>
How to override the Form.OnPaint method
Posted by Tom P. at 3/12/2008 12:02:32 PM
I am trying to take over the painting of a windows form but I can't
seems to override the OnPaint method... or the OnPaintBackground
method... or even the OnNotifyMessage method if there is a control
covering the client area. None of these are getting called in any way.
I've tried using SetStyle... more >>
BackgroundWorker and WebBrowser Control
Posted by James Klett at 3/12/2008 11:15:57 AM
System.Threading.ThreadStateException: ActiveX control
'8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the
current thread is not in a single-threaded apartment.
at System.Windows.Forms.WebBrowserBase..ctor(String clsidString)
at System.Windows.Forms.WebBrowser..ctor... more >>
How do I get DNS name and port in code
Posted by Michael Burgess at 3/12/2008 10:59:21 AM
Hi there,
I have some code thatr does the following:
Managers.AppUrl = String.Format("http://{0}:{1}{2}",Request.Url.Host,
Request.Url.Port, Request.ApplicationPath);
To assign the URL of an ASP.NET site to a property - this is called
from the startup code of the default page.
This wo... more >>
Optimize trigonometric calculations?
Posted by Andreas at 3/12/2008 10:16:34 AM
Hi,
I was debating if I should be posting this in the drawing newsgroup but
finally decided that it wasn't drawing related (even if that's what I'm
ultimatly doing) but instead optimization / math. In a sense it's not
c-sharp specific either but I hope someone can share some suggestions. So... more >>
SQL Statement In to SQL
Posted by Baffled at 3/12/2008 9:58:05 AM
Hi All,
How would I convert the SQL IN statement to LinQ
Select *
from TableName
where FieldName in (Value1, Value2)
or
Select *
from Table1
where Field1 in (Select Field1 from Table2)
Thanks... more >>
Transaction when using smo and DataContext of linq
Posted by shangjie.liu@micropatternusa.com at 3/12/2008 9:34:30 AM
In the operation,it is neccessary to create a new table by smo and then
insert some data into the new table by DataContext.Executecommand().
Is it possible to implement in a transaction? If no,any adivise?
Thanks.
... more >>
Access denied issues under Vista while using C# Registry classes
Posted by Dilip at 3/12/2008 9:28:11 AM
This is driving me batty. Why is this piece of code repeatedly
throwing an "access to registry key is denied exception"?
This is a small console application that is being run on Vista. I
fire up a command prompt (which is NOT running as an administrator)
and when I launch this app the abov... more >>
Identical binaries from same source code
Posted by tararot2 at 3/12/2008 9:27:51 AM
Hi,
I have to homologate my binaries so I need them to be byte-per-byte
identical after each compilation (if the source code is the same,
logically). Does anybody know how to achieve that with either compiler
options or modifying some parts of the binaries?
After some research I've succesfully ... more >>
cast of arrays with a given type
Posted by am72de@yahoo.de at 3/12/2008 9:21:08 AM
Hi all,
I have to write an editor for Visual Studio. It's one editor for
different kind of Arrays: Button[], TextBox[] and so on.
The intern array is Control[], so I can use it for all of the
inherited controls.
But now I don't know how to convert a Control[] back to the given
type.
Ple... more >>
String compare
Posted by Muhs at 3/12/2008 9:20:41 AM
Hi !!
i want to compare two strings and return the difference
For example, i have two strings,
string str1="then";
string str2="than";
it compared the two strings and returns 1, as only one character is
different (a and e).
Is there a function in c# that can do this??... more >>
Knowing which part of a Window is currently visible on the display
Posted by Ganesh at 3/12/2008 7:50:40 AM
Dear Experts,
I have an application that has several graphical components on it.
The state of these components is decided by some data which is
available in some data store. The graphical components periodically go
to the data base to see if the data has changed and accordingly change
their... more >>
Database application
Posted by Cdude at 3/12/2008 7:20:15 AM
Hello I need to deploy an application.The application has to connect
to a database that is already attached to the DB on the machine.How
can i check what DB's are on the machine select the one i want to
connect to.... more >>
The cpu usage is increased between com and atl
Posted by lightdoll at 3/12/2008 6:29:01 AM
hello everyone.
i made a singleton com with sink.
then i use the com in C# with sink.
-- win32dll -> atl com -> event of atl(if i don't use this code, it's ok) ->
C#
so i wrote my sample code below.
1.the client call the function of com in thread.
2.the function in COM will fire to C#... more >>
Threads (handlers) issue
Posted by csharpula csharp at 3/12/2008 5:48:36 AM
Hello,
I got the following question , part of my future application I will run
number of threads according to number of enteries in input xml file. How
can I dynamically build handlers which will wait for those threads if I
don't know before the runtime how many threads will be?
Thank u!
... more >>
Download the latest release of SQL Server 2008 Community
Posted by hentryhalt@gmail.com at 3/12/2008 4:39:21 AM
Download the latest release of SQL Server 2008 Community
Technology Preview (CTP) and discover new capabilities
to help support your mission-critical ...
http://downloadcorner.googlepages.com... more >>
Windows Forms apps and various versions of .NET and Visual Studio
Posted by richard d at 3/12/2008 3:04:15 AM
Hello everyone,
I'm writing a Windows Forms application (i.e. desktop) which I wish to
eventually distribute to a reasonably wide customer base (not
necessarily as wide as possible, but as wide as it makes sense for me
to do given my limited resources).
I am currently developing using VS 20... more >>
parallel (threads)
Posted by csharpula csharp at 3/12/2008 2:44:32 AM
Hello,
I build a console application which will run few actions in parallel. I
wanted to know what is the best way to implement it : by regular
threads,some thread interfaces or background workers? And where can I
find good example for that?
Thank you!
*** Sent via Developersdex http:/... more >>
Strings
Posted by csharpula csharp at 3/12/2008 2:42:30 AM
Hello,
What is the best way to compare strings is it str1==str2 or
String.Compare(str1,str2)? Thank you!
*** Sent via Developersdex http://www.developersdex.com ***... more >>
File Conversion
Posted by anant at 3/12/2008 1:54:02 AM
is there any way to change format of any kind of file to little
endian
or big endian in c#... more >>
|