all groups > c# > february 2004 > threads for tuesday february 24
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
DontLinger Dont work
Posted by L.J.SONG at 2/24/2004 11:53:41 PM
Hi
Anybody had ever used this statement?
/////
SetSocketOption(SocketOptionLevel.Socket,SocketOptionName,DontLinger,new
LingerOption(false,0))
////
Whernver I use this will got a excption only has a message read
"OptionValue"
... more >>
TreeView call perform DBLCLK
Posted by sonia NO[at]SPAM mer.co.il at 2/24/2004 11:28:06 PM
Hi. I need to perform DBLCLK on TreeView Node.
I try the following:
[DllImport("user32.dll")]
private static extern int SendMessage(IntPtr hWnd, uint msg, UInt32 wParam,
UInt32 lParam);
private const UInt32 WM_LBUTTONDBLCLK = 0x203;
pTreeNode.TreeView.SelectedNode = pTreeNode;
UInt3... more >>
public const string evaluates to null
Posted by Erik Tamminga at 2/24/2004 11:03:47 PM
Hi,
I'm totally bluffed: how can a 'public const string name = "myname";' ever
evaluate to null?
I have the following class:
public class MIB2
{
public const string org = "1.3";
public const string dod = org + ".6";
public const string internet = dod + ".1";
public con... more >>
Re: RichTextBox ?
Posted by CLR at 2/24/2004 10:33:47 PM
Folks,
When I single click on a single word, within a RichTextBox, how do I set
that word's background color ?
Regards,
Joe
... more >>
Error in Deserialization
Posted by Hector Martinez at 2/24/2004 9:26:05 PM
I have this error, what it means
"An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dl
Additional information: Exception has been thrown by the target of an invocation."... more >>
Problem with dynamic code generetion and cast.
Posted by Ya1000 at 2/24/2004 8:36:08 PM
I create an object with type A dinamicly and when I obtain it I tryed cast it to A and this action cause an exception
A a = (A)dynamicCreation(...); // this cause invalid cast exceptio
Thanks for any help ... more >>
Telling when a Socket is Disconnected
Posted by Nagash01WS6 at 2/24/2004 8:19:06 PM
Im working on writing an FTP application in C# to get a good
feeling for the .NET language and how threading / networking
classes all work. Thus far I have it working for the most
part in PASV mode. The only problem I have encountered is
when the server ends the connection, the
socket cant... more >>
String.Format function
Posted by winthux at 2/24/2004 8:12:05 PM
how should look string format that the String.Format() return result the
same like function sprintf("%08x%08x", a,b)??
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
c# and ms sql triggers
Posted by Artur Mucha - 96 Volt at 2/24/2004 7:55:34 PM
Hello,
does anyone know if it is possible to react on ms sql triggers in c# and how
to do it ???
AM.
... more >>
How to explicitly implement an interface event
Posted by Ohad Young at 2/24/2004 7:47:44 PM
Hi,
I have an interface with an event.
I'd like to explicitly implement the interface by a certain class.
However, I received the following error:
"An explicit interface implementation of an event must use property syntax"
Here is a code sample:
public interface IFoo
{
event Evenet... more >>
Problems with httpHandlers --> Help me please
Posted by Luis at 2/24/2004 7:47:05 PM
Hi,=20
I want to protected all files in my website, so I try to use =
httpHandlers, I put this in my WEB.CONFIG (at the end of page), but I =
can't protected the files type MDB, CSB, can someone help me? :
<httpHandlers>
<add verb=3D"*" path=3D"*.mdb" type=3D"System.Web.HttpForbiddenHand... more >>
Using SetPrinter in C# to set duplex option (in print prefs)
Posted by Joe M at 2/24/2004 6:46:09 PM
I was wondering if someone could lend me a hand with a C# problem I am having
I am trying to use the “setPrinter†api to change the duplex setting (under printing preferences on printer context menu) so that I can send a document to the printer in duplex mode
These are my declarations
[D... more >>
PropertyGrid control
Posted by SS at 2/24/2004 6:34:52 PM
Can I change the font and backcolor of individual cells of a propertygrid
control ??
And what if I want to make this change row-wise??
Say, show diff prop in diff colors??
... more >>
Serialization
Posted by Hector Martinez at 2/24/2004 6:26:06 PM
I need to serialize a class that have a field of type System.Windows.Forms.Panel it give me an exception saying that "...System.Windows.Forms.Panel is no marked as Serializable...", how can I resolve this problem if I need to save the panel field...
Thanx in advantage;... more >>
XML to plain text
Posted by Big D at 2/24/2004 5:16:04 PM
I have a simple xml file that contains, in part, content that is in HTML. I
am encompassing that content in <![cdata[]]> tags. This works fine.
However, my application needs to output the XML file (from a strongly typed
dataset) to plain text. I am doing
theText = myDataset.getXML()
Wh... more >>
XML Search
Posted by C# newbie at 2/24/2004 4:44:54 PM
Hi Guys,
I know XPath is a good method to search into an xml file but what if
you're looking for a specifc data which could be any where within the xml
file ? Should I consider all possibilities and paths in the xml file ?!!!
Isn't better to have a recurrsive method to traverse the whole... more >>
Question about IDispose
Posted by Alvin Bruney [MVP] at 2/24/2004 3:50:19 PM
with the using construct, exit from scope calls dispose on said object. But
what happens in a connection pooling scenario? Is the run-time smart enough
to realize that Object Pooling is being used so it will not call dispose and
instead flag the object similar to what close() does when pooling is... more >>
Why do CONTROLS end with an EXTRA line-break/space???
Posted by michael at 2/24/2004 3:35:02 PM
On my ASP.NET pages, it seems that _after_ any web or user control - an
extra (small) line break or space is inserted automatically right after the
Control. This is unwanted since it messes up vertical alignment preventing
me of having things "touch" each other. I have tried surrounding the
co... more >>
books
Posted by Mike at 2/24/2004 3:02:15 PM
I'm looking for any good database programming with C# books, any
recommadations?
Note: I'm just learning C# coming from VB back ground. I'm looking for
something that explains ADO.NET and C#. I don't want to know about the .NET
IDE or anything like that, I want the down and dirty of C#, etc.
... more >>
Add Controls to ListView
Posted by Alan at 2/24/2004 2:55:40 PM
Hi All,
Is it possible to add other controls to the ListView control in C# windows
forms. i.e. I want to add a button column so to speak to the list view. You
can do this sort of thing with the datagrid in asp.net, however I think the
datagrid in c# is overly complex for what I'm wanting to do... more >>
how to capture printscreen & alt-printscreen keystrokes
Posted by Segfahlt at 2/24/2004 2:54:31 PM
Anybody got any idea how to do this?
They don't get handled with the regular keydown/keypressed events
thanks,
bill... more >>
Attach external variable to control?
Posted by Julie J. at 2/24/2004 2:24:41 PM
When working w/ forms and controls, in 95% of the cases, the value of the
control is used somewhere in the program (duh!).
However, there doesn't seem to be an easy way to attach a value variable to
that control the automatically handles synchronization of the value w/ the
contol.
Here is a... more >>
SecurityAction.InheritanceDemand....
Posted by Earth Worm Jim at 2/24/2004 2:23:56 PM
I have a base class in an assembly that I want to add the following
attribute:
[StringNameIdentityPermission(SecurityAction.InheritanceDemand,
PublicKey="00024....e45e")]
The assembly is strong named and all the derived classes are in the same
assembly. The problem that arises is that at ru... more >>
converting String to uniqueidentifier
Posted by Sandra at 2/24/2004 1:46:06 PM
I am trying to convert a string into a uniqueidentifier by using the following code
string contrID = Request.Params["oId"
SqlGuid sqlID = SqlGuid.Parse(contrID
I am then putting sqlID into my SQL WHERE clause so it only pulls that record. I've double checked that the record I'm trying to pull ... more >>
Resolving ambiguous references
Posted by abbomb NO[at]SPAM hotmail.com at 2/24/2004 1:40:20 PM
Suppose I have the following in file1.cs (all code is compacted to
reduce the number of lines):
namespace B {
namespace C {
class D {
public static void Print() {
System.Console.WriteLine( "B.C.D.Print" );
}
}
}
namespace E {
class D {
public... more >>
COMException : Invalid procedure call or argument
Posted by Zoury at 2/24/2004 1:33:34 PM
Hi there!
I'm using a COM component from my C# application and I can't get it to work
properly. I get a COMException (Invalid procedure call or argument) on this
line :
//***
ArbreSaisieClass as = new ArbreSaisieClass();
bool bSubLevel = true;
bool bValid = false;
bool bCalcPrice = false... more >>
What is the difference between SyncRoot and Synchronized method in Queue?
Posted by chrisben at 2/24/2004 1:01:07 PM
Hi
I often use Queue.Synchronized method to create a queue for multithread writing. I also know I could use SyncRoot and lock to write Queue. Could anyone here please explain to me the pros and cons between those two approaches
Thanks a lo
Chris... more >>
need help
Posted by Mike at 2/24/2004 12:46:18 PM
I have an asp.net page in C# and this code does not when I point it to my
database, it works fine going against the pubs sql db but not mine
String selectCmd = "SELECT dbo.Task.emailAddress, dbo.Task.tasks,
dbo.Task.datePosted, dbo.Task.comments FROM dbo.Team INNER JOIN dbo.Task ON
dbo.Team.I... more >>
Opening a form in a Windows service
Posted by Andrew Mueller at 2/24/2004 12:40:47 PM
Hello,
Is there any way to make a form part of a windows service application
and launch it upon double-click of a system tray icon?
I already have the NotifyIcon working and have added an event to it for
the _DoubleClick.
I added a form and tried to open it with:
{Form ... more >>
DateTime truncation
Posted by JezB at 2/24/2004 12:37:37 PM
I want to compare two DateTime values but only down to seconds, so how do I
truncate DateTime values to second granularity ?
Similarly, I may want to truncate to the minute granularity.
I also may want to round to the nearest minute.
How do I do these things ? I'm sure it must be really simple... more >>
secure hash in c#
Posted by RR at 2/24/2004 12:36:28 PM
Hello I am trying to send an object over the network. However I want to be
able to sign the object. I looked at the sha hash function provided and it
takes in a byte array. I thought of converting the object into a stream
using binary formatter, then converting the stream into a byte array and
f... more >>
working with system apis
Posted by José Achig at 2/24/2004 12:36:14 PM
Hi
I have to use functions inside of system apis so I want the correct
dllimports declarations in c# for the following functions or information
about where I can get these statements.
+ OpenProcess
+ CloseHandle
+ EnumProcesses
+EnumProcessModules
+GetModuleFileNameExA
+GetProcessMemory... more >>
How to read the "view hidden/system files" Folder Options from within C#
Posted by Greg Bell at 2/24/2004 12:23:46 PM
Hi,
Can someone tell me where to look to enable me to read "Folder Options" user
settings for hidden/system files from within C#/VB.Net/Any other .NET
language. I'm pretty sure it must be part of the framework, but I'm buggered
if I can figure out which part. I've tried googling for it, but to... more >>
DataGrid Format Issue
Posted by Jim Heavey at 2/24/2004 12:15:38 PM
Hello, I have a datagrid which is bound to a datatable. I created the
"DataGridTableStyle" object and defined all of the columns that I wanted to
display. There was one column, however that I did not want to have
displayed and as such, I did not reference in the DataGridTableStyle.
When t... more >>
Like Operator in C#
Posted by Saradhi at 2/24/2004 12:01:27 PM
I want to check for a conditon as follows:
if ( name Like "sa*")
So, I need to use this * as a wild card and the above statement should =
return all those names which starts with sa.
I know that VB Like operator will do this one.
I want to know whether we have any similar one in C#?=20... more >>
calling a perl script from C#
Posted by Rick at 2/24/2004 11:51:08 AM
I am a newbie to C#, so bare with me. This seems like it should be an easy task
Thanks... more >>
Xml serialization
Posted by Noël Danjou at 2/24/2004 11:46:31 AM
VS.NET 2003, C# and .NET Framework 1.1.
Hello,
I am trying to serialize a small sample class using the XmlSerializer class.
** Here is the code:
DerivedClass myClass = new DerivedClass(5, "sample string");
Stream fs = File.Create("sample.xml");
XmlTextWriter writer = new XmlTextWriter(... more >>
about types
Posted by Owen at 2/24/2004 11:45:40 AM
Hello:
I want to know the class of object, to compare to some class, how can I do
that?
Owen.
... more >>
interface methods always virtual?
Posted by trnospam NO[at]SPAM earthlink.net at 2/24/2004 11:36:30 AM
If an object implements an interface, are interface methods always
virtual or only if accessed through the interface?
For example, if I have:
interface IFoo
{ public void Method1() }
and I have:
class Bar : IFoo
{
public void Method1(){} // IFoo method
public void Method2(){... more >>
windows2k source code download
Posted by messagedog at 2/24/2004 11:32:32 AM
http://activex.126.com
... more >>
sizeof
Posted by Brad Williams at 2/24/2004 11:31:44 AM
Why can't you take the sizeof a class? Would there be some implementation
problem for the compiler writers, or is it to stress that there is just no
point in knowing the size (since you obviously could never do pointer
arithmetic with reference-type objects)? I don't see how there would be an
... more >>
getting Extentionfile ...
Posted by genc ymeri at 2/24/2004 11:17:26 AM
Hi,
How can I get the extention name of one file when I have a file list ?
Thanks.
... more >>
Software-Studies in India
Posted by Jonas Knaus at 2/24/2004 10:59:43 AM
hi all
i am going to be soon in india on my travel around the world.
i was thinking of doing a software-school in india. (MSCD or something like
that)
does anyone of you have some experience n India or has some adresses?
thanks for your help
greetings
jonas
... more >>
Datagrid Column Widths - This should be easier
Posted by Tim Nelson at 2/24/2004 10:59:32 AM
I am missing something obvious here. I have a simple grid with 2 columns
pulled from an ADO.NET ODBC datasource. All that I want to do is lengthen
the columns in the grid so each field displays completely. Somehow
it appears the order in which you set your grid properties determines
whether
... more >>
Constructor order
Posted by Thomas Scheiderich at 2/24/2004 10:47:21 AM
I am curious as to 2 things.
One is the order that the constructors are handled and the other is why
the debugger doesn't show the static objects constructor (unless you set
a breakpoint.
For example, here is my code:
*********************************************************************... more >>
history of .NET Framework and its languages (ILAsm, C#)
Posted by Wiktor Zychla at 2/24/2004 10:40:46 AM
Hello,
are there any good references to .NET history? I would like to read some
more about the development of the ILasm language and the C# language. were
they developed separately? is it true that the first c# compilers targeted
JVM because the .NET RE was not ready at that time? how the ... more >>
MSMQ as timer
Posted by Kimmo Laine at 2/24/2004 9:58:14 AM
Hi,
is there a (built in) way to use MSMQ as a "timer":
MessageQueue mq;
// . . .
mq.ReceiveCompleted += new ReceiveCompletedEventHandler( MyMSMQHandler );
// . . .
private void Foo() {
mq.Send( /* Send MY_MSG_CODE without delay *& );
}
private void MyMSMQHandler( object sender,... more >>
Make changes to record
Posted by pcPirate at 2/24/2004 9:31:20 AM
Hi,
I have an application, the user are able to change records in this
application.
Also, there's a button called "What If".
After the user pressed the "What If" button, the user may change the records
and save it. When the user open the same record again, all the changes is
there. (Pls. n... more >>
convert to c++
Posted by bob NO[at]SPAM coolgroups.com at 2/24/2004 9:19:53 AM
byte[] salt = new byte[8] {0xA8, 0x9B, 0xc8, 0x32, 0x57, 0x35, 0xe3,
0x03};
PasswordDeriveBytes p = new PasswordDeriveBytes("thepass", salt,
"MD5", 21);
EncryptData(args[0], args[1], p.GetBytes(8), p.GetBytes(8));
Does anyone know how to convert this code to C++ code that doesn't use
the .... more >>
App path
Posted by JJ at 2/24/2004 8:00:44 AM
Hi,
I am using Application.startup path in debug mode and of
course its looking down into the debug directory instead
of Project directory. What command can I use to have it
looking in the project directory during debug mode? Or
better yet how do u guys handle path setup for apps? What ... more >>
No .NET framework
Posted by bob NO[at]SPAM coolgroups.com at 2/24/2004 7:39:38 AM
Is there any way to create a Csharp Console application that does not
require the user to have the .NET framework installed?... more >>
class-method in a thread
Posted by jarod1701 NO[at]SPAM gmx.de at 2/24/2004 7:31:08 AM
Hi,
I'm currently working on a little tool to copy files over the network
using FileStreams. I've written a class that takes care of that.
I create an instance of the class within the main program, specify
some properties and start a new thread which calls the StartCopy
method.
My idea was t... more >>
ListBox
Posted by Ryan Schoolman at 2/24/2004 7:19:05 AM
How can you get all the items out of the collection of a listbox?
--
Ryan Schoolman - Programmer & Application Architect
ryan@pclegends.com
PC Legends
http://www.pclegends.com
[w] 715.839.6855
[c] 715.379.0878
[h] 715.855.9003
... more >>
Calendar - Outlook Type
Posted by Martin Schmid at 2/24/2004 6:44:24 AM
Is there a Web Control that I can use to generate a calendar similar to an
Outlook calendar... I.e, if I have a event on a given date, show that event
on that day on the calendar... likewise, If I have an event spanning
multiple dates, show a bar across all the dates... and if there are several
... more >>
Inherits from webcontrol or webcontrols
Posted by Josema at 2/24/2004 6:36:07 AM
Hi,
I would like to know whats the difference of inherit from webcontrol or webcontrols
In wich cases its better the use of one or another
Thanks in advance
Regards
Josema.... more >>
Office 2003 Style Menu/VS.IDE 2003 Style Menu
Posted by BuddyWork at 2/24/2004 5:38:16 AM
Hello,
Is there anyway to get the menu's to appear like Office
2003 or VS.Net 2003 in .Net?
I was using Application.EnableVisualStyles() but this
works for textbox and buttons if the FlatStyle is System
but the menus are still in the old plain format.
Thanks... more >>
performance of typeof()
Posted by pn at 2/24/2004 5:36:09 AM
Hi
when comparing a Type object to several built-in types, do you recommend to use Type.GetTypeCode() instead of typeof() ? Is there a BIG performance difference
Example
if (type == typeof(int) || type == typeof(long) || type == typeof(decimal)) ..
-OR
int typeCode = Type.GetTypeCode(type)
i... more >>
How do you pronounce it?
Posted by Chiral at 2/24/2004 5:06:06 AM
How are you supposed to pronounce C#. I say 'C-sharp', but I don't know if that's right.... more >>
Newbie: try, catch problem
Posted by Sam Henson at 2/24/2004 3:11:08 AM
Hi
the following code should throw an exception, but it doesn't! can anyone tell me why
tr
IPAddress test = IPAddress.Parse("192.168"); //invalid inpu
catch(Exception mye
MessageBox.Show("error")
return
Any ideas
Sam Henson... more >>
voip application....
Posted by giorgio at 2/24/2004 2:51:53 AM
i must write a "simple" application, it should work like this scheme:
client:
acquire from mic->compress audio->send server:
server:
receive audio->decompress->play on speaker.
(the sound must go only from client to server)
i'm new user of c# and i can't find the right metohd to do... more >>
cursor
Posted by rammohan at 2/24/2004 1:38:49 AM
hello
how can we change cursor on particular text in
richtext box using c# i.e i want to change the cursor from
default to Hand when the mouse moves over a particular
text.
regards
--rammohan... more >>
|