all groups > c# > july 2005 > threads for friday july 15
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
converting byte to float
Posted by Aykut at 7/15/2005 11:18:54 PM
Hi
I have to convert byte value to float in C#.Float is in IEEE 754 format.
byte value is= 70 23 22 195 in a byte array.
and its float value is = -150.0909
what is the algoritm for this conversion?
thanks for help
... more >>
Unassigned Local Variable Error
Posted by John Smith at 7/15/2005 9:15:00 PM
In the following (pseudo)code, why is it that C# returns an
"unassigned local variable" error for nVar? It seems I have to
declare the variable outside foo() for the error to dissapear.
void foo()
{
int nVar = 0;
SqlDataReader rdr = objCmd.ExecuteReader();
while (rdr.Read())
... more >>
New to C#
Posted by louie at 7/15/2005 4:48:02 PM
I was wandering if anyone can help me find information [ websites ,etc ] ,
comparing C # to Java ++. I have been tring them both out and would like to
know were they disagree on format or structure. Also why one is better over
the other is used.
Thank you , and I hope someone can help me.
jh... more >>
Novice Question
Posted by at 7/15/2005 4:22:53 PM
I'm working on a C# ASP.NET Web App.
I'd like to allow the user to type a url into a textbox. The url should
point to a text-based file.
I'd then like to display the contents of that text-based file in another
textbox.
My problem is getting ahold of the text from the url. The other pa... more >>
Safely modifying variables in a multithreaded environment.
Posted by Frank Rizzo at 7/15/2005 4:00:53 PM
Hello,
I want to use a variable as a signal to the thread that it should stop
what it's doing (code below). As a rule, should I lock an object only
when I am writing to it or do I have to lock on reading as well? For
instance, consider the following code:
//running in a non-GUI thread
... more >>
adding an image resource
Posted by Don Tucker at 7/15/2005 3:13:02 PM
Hello, I have a Windows Application that needs to load multiple image files
in response to users clicking buttons. Currently, I just have these images
as .jpg files on disk, but I don't want to have to migrate the files
everywhere that the executable is installed. Is there a way to add them ... more >>
Using OLE
Posted by **Developer** at 7/15/2005 2:43:56 PM
I'm writing a simple editor using the RichTextBox.
I'd like to add OLE like WordPad has.
That is allow packages to be embedded or linked and thereby changed.
I'm reading the doc but would like to have some sample code to study.
Anyone know where there is sample code or How-To-Do-It tutor... more >>
SQL Transaction in C#
Posted by Gidi at 7/15/2005 2:14:03 PM
Hi,
I want to call a stored procedure that is in my SQL DataBase and i want to
do it with transaction so i could roll-back in case of need.
if i do a simple SP (like select * from table) and i don't send any
parameters i have no problem and it works, but if i'm sending parameters (and
i ne... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Getting value of last item in listview?
Posted by Jozef Jarosciak at 7/15/2005 2:05:43 PM
Hey guys,
I have a listview with 7 collumns and I need to retrieve value from the
first line and its 7th collumn.
Is there an easy way to retrieve it?
Thanks,
Joe
... more >>
How to reverse listview?
Posted by Jozef Jarosciak at 7/15/2005 2:01:46 PM
Hi, my program is adding (every hour) a line to listview and into its 7
columns.
Problem is that it is adding it to the bottom of the list, so after
couple of hours, my users need to scroll down to see the most recent
results.
What I'd like is to have some function to reverse listview order... more >>
Modifiers of controls in an inherited form question
Posted by Amil at 7/15/2005 1:27:03 PM
I have a form template: EditorTemplate with a toolstrip containing three
buttons: Add, Modify, Delete. All three buttons have their Modifier property
set to Public. Used to be that, in beta1, - from the the form: ItemEditor
that inherits from my template - I can double-click on the Add butto... more >>
How do i implement inheritance like this?
Posted by Amil at 7/15/2005 1:20:01 PM
// there are 2 forms inheriting from EditorTemplate
// ItemsEditor and CategoriesEditor
public EditorTemplate CreateForm(string inheritedFormName)
{
// EditorTemplate editor; // makes editor in scope, but not instanstiated.
if (inheritedFormName == "Categories")
CategoriesEditor editor... more >>
Hosting Javascript in .NET Windows Form App? (Somewhat Advanced)
Posted by John Puopolo at 7/15/2005 12:45:41 PM
All:
I am writing a .NET 1.1 Windows Forms app in C#. I would like to offer
users the ability to script the application via javascript.
In the "old days," I would have used the Active (ActiveX) Scripting
host (COM based) offered by Microsoft. Is this still the best way to do
it?
If this ... more >>
How to use EventArgs
Posted by Amil at 7/15/2005 12:34:03 PM
when i double-click on a button on a form as i am designing the form, the IDE
creates a method corresponding to a event assignment as follows:
this eventhandler: this.exitToolStripMenuItem.Click += new
System.EventHandler(this.exitToolStripMenuItem_Click);
is paired with: private void exitTo... more >>
Password Textboxes
Posted by John Owens at 7/15/2005 12:32:05 PM
I do something like this:
HttpCookie cookie = Request.Cookies[ "AuthInfo" ];
if( cookie != null )
{
tbUserName.Text = cookie.Values[ "UserName" ];
tbPassword.Text = cookie.Values[ "Password" ];
}
This works except tbPassword is a WebControls.TextBox and it's set to mode
"passwo... more >>
Updating databound textboxes immediately after a database change????
Posted by Jon S via DotNetMonster.com at 7/15/2005 12:29:29 PM
Hi all
I'm new to C# and ADO.Net. I've managed to insert, update and delete records
from a database but I need to know how to show these changes immediately.
For example : If I delete a record from the database, that deleted record
will remain in my forms textboxes until I restart the prog... more >>
Installation Project
Posted by Christopher Weaver at 7/15/2005 12:06:50 PM
Is there a way to get an installation project to create an "All Programs"
menu entry and desktop icon?
... more >>
two interfaces having methods with same names
Posted by don at 7/15/2005 11:53:03 AM
I have two existing interfaces having methods with same names. Now I have to
implement both intrfaces in one class. Is there any way I could implement
methods with same names in both interfaces without getting errors from the
compiler?... more >>
Best way to clone an ArrayList?
Posted by Chris Bellini at 7/15/2005 11:06:49 AM
I was just looking for some opinions on the best way to clone an
ArrayList object. For example, if class A contains an ArrayList, what
would be the best way to make a copy of it for class B (but not using
the class constructors):
class A
{
public A()
{
// constructor... more >>
COM+ server in .net
Posted by Jozsef Bekes at 7/15/2005 11:01:19 AM
Hi All,
I would like to know whether the following limitation exists in .net.
I want to implement a COM+ exe server to which I would like to connect with
a delphi, a vb6 and a c# client. When I try to add reference to the tlb in
C#, an error message appears stating the following:
Conver... more >>
overriding static and non static method
Posted by rlvladbob NO[at]SPAM yahoo.com at 7/15/2005 10:34:19 AM
Hi,
I've try to access a static method using an instance instead of a
class.
public class test{
public static void ShowAText(string ThisText)
{
System.Console.WriteLine("->{0}",ThisText);
}
public static void Main()
{
test.ShowAText("MyText");
}
}
This part work, the call ... more >>
MAPI control with C# causes exception when calling Send()
Posted by Drew at 7/15/2005 10:31:57 AM
Real simple code:
MSMAPI.MAPISessionClass session = new MSMAPI.MAPISessionClass();
session.SignOn();
if (session.SessionID != 0)
{
MSMAPI.MAPIMessagesClass message = new MSMAPI.MAPIMessagesClass();
message.SessionID = session.SessionID;
message.Compose();
message.RecipType ... more >>
how do i create a generic method for opening forms?
Posted by Amil at 7/15/2005 10:18:01 AM
example:
// form classes:
// ItemEditor
// CategoryEditor
private void OpenForm(string formClassName)
{
// I want to be able to instantiate a form based on the parameter.
if (formClassName == "ItemEditor" )
ItemEditor editor = new ItemEditor();
else if (formClassNam... more >>
Custom Attributes
Posted by mark at 7/15/2005 10:10:13 AM
Could someone please give me a practical example of how you HAVE used custom
attributes ... not just how you COULD use them. I understand the syntax,
but am not able to visualize a good use for them.
Thanks in advance.
Mark
... more >>
Static Readonly Properties and Thread Safety
Posted by The Crow at 7/15/2005 9:31:46 AM
for example i have static readonly SqlParameter and i want to clone them at
runtime. as clone operation will not write to SqlParameter object, just
reading, should i lock that object during read operations?
... more >>
Regular Expression in C#
Posted by Jianwei Sun at 7/15/2005 8:19:43 AM
Hi, guys,
I am trying to parse out the apratment number in a regular expression :
If I use
Regex regex = new
Regex(@"(?<AddressWithoutApartment>.+)(?<ApartmentSeperator>\bAPT|#|UNIT\b)(?<Apartment>.+)",
RegexOptions.ExplicitCapture);
I will be able to parse out "100 main ST # C)
B... more >>
No border style 2
Posted by Alvo von Cossel I at 7/15/2005 8:09:02 AM
hi,
sorry about the first message; i accidentally clicked post. anyway, i want
to make a modern looking app like quicktime that has not got that bar at the
top with the title in it and the controlbox. i have put a no border style
property on the form and have replace the control box with a ... more >>
noob question: how do i access the object sender properties
Posted by Amil at 7/15/2005 8:05:03 AM
based on the following code generated by the IDE:
private void toolStripButton1_Click(object sender, EventArgs e) {}
How do I convert sender to a ToolStripButton object so I can access its
properties?... more >>
Why can't C# use System.Void type?
Posted by Judah at 7/15/2005 8:00:07 AM
With generics in .NET 2, there are certain scenarios in which using
System.Void would be useful:
TReturnType MyFunction<TReturnType>()
{
return default(TReturnType);
}
Above is a simple function that would allow me to make a generic method that
would return any type I instanciate t... more >>
Please help
Posted by Zahir at 7/15/2005 7:30:55 AM
Hi :
I am developing an applicaiton with ASP.NET & C#, with remote web
server. It was working fine . But last two days when I bulid my
application it throws an error: "Cannot Save the file bin/holimart.pdb
to the web server. The server connection timed out." here holimart is
my project name. ... more >>
InteropServices: How to map .NET data type to LPVOID
Posted by LongBow at 7/15/2005 7:17:50 AM
Hello,
I am attempting to create an application that uses an existing driver
interface API using C#. I have an API that looks like
F32x_Read( HANDLE Handle, LPVOID Buffer, DWORD NumBytesToRead, DWORD
*NumBytesReturned)
Where the following arguments are described as
Handle - Handle to... more >>
Thread problem ( Pool)
Posted by Ricardo Luceac at 7/15/2005 6:31:28 AM
HI...
I have a queue of objects waiting to be analysed by a method, so I think
o using threads to analyse 3 objects at the same time...
The problem is:
I create the 3 threads, and execute them, the threads look in the queue,
pick an object and analyse it. But after the thread analyse ... more >>
auto generating mnemonics
Posted by Lukas Meusburger at 7/15/2005 5:13:03 AM
i have a problem auto-assigning mnemonics when dynamicly generating menues.
in some cases, two memorie entries get the same mnemonic key assigned
because the words begin with the same letter. this means, that they are more
or less useless
does anyone have an algorithm or some kind of code ... more >>
convert SqlBinary to Byte[]
Posted by megan at 7/15/2005 5:02:15 AM
I can easily get my byte array into the SqlBinary Sql servr field.
getting it out again is more difficult.
SqlBinary myBin = myBinaryObject; // object from SQL server field.
byte[] b= myBin ;
is not allowed.
... more >>
set reference to component in GAC ???
Posted by (cmrchs NO[at]SPAM yahoo.com) at 7/15/2005 4:08:53 AM
Hi,
in VisualStudio.NET : how can I set a reference to a component in the GAC ?
' cause the 'Add Reference' - dialog box doesn't show the components listed in the GAC
thanks
Chris
**********************************************************************
Sent via Fuzzy Software @ http://www... more >>
How Kill Running Application Process
Posted by Steve B. at 7/15/2005 4:05:03 AM
I think a user exited my local application incorrectly and now I can't
compile a new version of the application to the public network without
getting a "in use" error message. Also, can't rename or delete the exe
file/directory without "access denied"
How do I find out who/what is using th... more >>
Abnormal Thread Termination
Posted by Rahul Anand at 7/15/2005 3:39:04 AM
I have a problem in my multithreaded application. The problem is reproducible
very rarely, only once in 6000 similar execution (through same code path).
Problem: One of multiple threads gets abnormally terminated. It does not
goes through the try-catch-finally sequence. The mehtod gets hanged... more >>
FormBorderStyle
Posted by Alvo von Cossel I at 7/15/2005 1:34:04 AM
hi,
i have an applocation that i want to look modern. the forms border style is
set to none but i have a created bar at the top with the maximise buttons etc.
1. what code to i type in for the maximise button and the minimise button?
2. how do i make the window sizeable?
can someone help... more >>
Base keyword - HELP
Posted by Krishnan at 7/15/2005 12:00:00 AM
Hi,
Am having a base class that implements an interface (air code) :
class BaseClass : SomeInterface
{
void SomeInterface.ImplMethod()
{
// -- code here --
}
}
class Derived : SomeInterface
{
void SomeInterface.ImplMethod()
{
//NEED TO CALL BASE'S... more >>
Pass external delegate to a class constructor.
Posted by Marty at 7/15/2005 12:00:00 AM
Hi,
I would like to have my class to execute eventually an outside function.
I was thinking to pass to my class constructor a delegate object that
would be later used in my class to be triggered.
Does a delegate is the correct object to use to do that?
Thanks!
Marty... more >>
unit testing with NUnit
Posted by Edwin Yip at 7/15/2005 12:00:00 AM
Dear all,
coding a test classes for classes being tested is really boring, is there
any tool can generate 'test cases'?
... more >>
newbie: How do I set the return type for this method?
Posted by deko at 7/15/2005 12:00:00 AM
What I want to do is call the static method in the below class.
In pseudo code it might look something like this:
If (!GetImageFromDatabase.ExtractImage(strFileName,
strPathToImageFile))
{
// do something
}
In other words, if the method returns false, execute some code.... more >>
sprintf and C#
Posted by steve at 7/15/2005 12:00:00 AM
hey i wrote a progam a wihle back in c++ and i used the sprintf function as follows:
OVERLAPPED osWait = {0};
DWORD dwWritten;
char B[20];
sprintf (B, "\x02" "CB 0 1" "\x0D\x0A\x03");
WriteFile (m_hPort, B, strlen(B), &dwWritten, &osWait);
how do i change this to c#.. just the sprintf... more >>
Get all members of a SecurityGroup in AD?
Posted by Claus Konrad at 7/15/2005 12:00:00 AM
Hi
I've been informed that it is very troublesome to retrive all members in =
a domain (let's say "ABC"), that is member of a specific SecurityGroup =
(global or local)? I've been told that one has to loop through every =
single user in the domain and then ask "Is he member of the =
securityg... more >>
System.Security.Permission.RegistryPermission
Posted by Mohan at 7/15/2005 12:00:00 AM
Hi,
I have developed a .NET Windows application. I able to run(Execute) it
from the local drive of my PC. If I try to execute it from the
SourceControl(Clear case) or from Shared drives, then it is not starting the
application, but given the below error.
Request for the permission of ty... more >>
RequiredFieldValidator has no action
Posted by ad at 7/15/2005 12:00:00 AM
I want to combine a TextBox and a RequiredFieldValidator into to a web
custom control (name RequireTextBox ),
But when I use RequireTextBox in web form, the RequiredFieldValidator has no
action.
How can I do?
{
private TextBox box;
RequiredFieldValidator rv;
public string Text... more >>
|