all groups > c# > october 2005 > threads for friday october 14
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
PInvoke problem with int by reference
Posted by nicolasr at 10/14/2005 11:34:17 PM
Hi,
I have the following PInvoke problem:
I want to call the Win32 API SystemParametersInfo()
which has the following signature:
BOOL SystemParametersInfo(
UINT uiAction,
UINT uiParam,
PVOID pvParam,
UINT fWinIni
);
the pinvoke.net site suggests the following declaration:
... more >>
Time function
Posted by nick.stefanov NO[at]SPAM gmail.com at 10/14/2005 11:08:52 PM
Is there a time fuction in C# similar to ctime in C that can convert to
a calendar date and time from seconds from January 1, 1970. Thanks.
Nick
... more >>
Split stringbuilder in array
Posted by Arjen at 10/14/2005 10:31:17 PM
Hi,
How can I split a stringbuilder into arrays?
Let's say I have a stringbuilder with this value "test1234567".
Now I want an array with size 6. The value of the array have to be on index
0 "234567" and on index 1 "test1".
How can I do this?
Thanks!
... more >>
Asynchronous Delegates
Posted by Tobias Matzat at 10/14/2005 10:09:18 PM
Hi!
Is it possible to wait for the callback method to finish? When using a
WaitHandle only the call of EndInvoke is awaited. I would like to do
some calculations in the callback-method. But I don't know how to inform
the main thread that the calculations are done, besides defining an
even... more >>
Search Engine
Posted by Nirosh at 10/14/2005 10:00:37 PM
Hi All,
I want to write a Search Engine (Full text) for a content repository that
has content in XML | HTML format.
My plan is to use SQL full text seach, how is the perfomance here, if I have
1000 book, each have 10 MB of text data?
I need my search responce to send 10 replies at a time,... more >>
Generate fixed length unique number
Posted by David Dvali at 10/14/2005 9:48:04 PM
Hello.
How can I generate some fixed length unique number (for example 6 character)
based on some number like 1, 2, .. 45, 46, 47 (Generally I will use unique
ID of the database record as base number)?
Thank you.
... more >>
Declaring an array of char and reading char from Binary Stream
Posted by nick.stefanov NO[at]SPAM gmail.com at 10/14/2005 8:32:01 PM
Hello,
I am trying to read a binary file generated from Ethereal. I need a
structure to hold my frame and one of my variables which stores
source/destination address has to be of type char[6]. In my structure
i cannot figure out how to declare this. Trying char[] dest_addr = new
char[6] bu... more >>
Marshaling Delegates as Struct/Class Members
Posted by Bob at 10/14/2005 8:00:45 PM
I understand delegates do not need to be pinned, but its the class object
itself I need pinned. Take this code:
[StructLayout(LayoutKind.Sequential)]
public class TestObject
{
[MarshalAs(UnmanagedType.FunctionPtr)]
public AddDelegate Add;
[MarshalAs(U... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Sniffing Network Data
Posted by Nuno Magalhaes at 10/14/2005 7:39:13 PM
Is it possible using .NET (or any other language) to sniff/analyze data
that travels between other computers in the network?
If it is possible how it is done? Because I have some VoIP Phones
linked to a switch that have it's own IP and how do I analyze the data
that travels between each phone?... more >>
problems with arrays
Posted by hledman NO[at]SPAM gmail.com at 10/14/2005 5:35:12 PM
Hello,
Beginner here reading through murach's c# book and come to a point
where the book doesn't give a good example of what they want you to do
in the exercise.
I've created an array with 5 elements that all start with their default
value 0. I need to replace those 0's with values i enter in... more >>
limiting access to files with asp.net
Posted by Daniel at 10/14/2005 4:57:00 PM
limiting access to files with asp.net
is there any way i can make a file only accessible to certain users of my
website? my files are to large to copy to a temp directory and they are of
many types, .exe .xsl .xml etc. i want an href to each file but only allow
users who have the right login-i... more >>
C# Windows App - SSH
Posted by Jesse Charbneau at 10/14/2005 3:39:08 PM
Hi Everyone,
If I'm posting to the wrong group, please let me know. I have an
application that I am writing to communicate from a Windows host to a
UNIX server via SSH.
What I would like to do, is send one command at a time, but without
having to re-authenticate for each command. I am cu... more >>
How do I get my combox listing to display in sorted order by DataM
Posted by Alpha at 10/14/2005 3:26:01 PM
This is a Window based application. How do I get my combox listing to
display in sorted order by DataMember? I inserted a blank row to the dataset
table which is the datasrouce for the comboBox with valuemember wet to -1.
This is showing up at the bottom of the list. I want it to show at t... more >>
MSDN Question
Posted by jack at 10/14/2005 3:18:52 PM
Should I buy the MSDN Professional Subscription for Visual Studio 2005 from
microsft or can I buy a 7.0 subscription and transfer it? I want to get
Profession Premium subscription and Microsoft wants $2499. What 7.0
subscription can I buy to get Premium Professional?
Thanks
... more >>
Outlook send email
Posted by Max at 10/14/2005 2:54:11 PM
When you send an email programatically throgh Microsoft Outlook it goes into the
Outbox and stays there. I have an application that opens the email window and allows the
user to type a message and then hit the Send button. After that the window closes but
the message isn't sent like in Outlook Ex... more >>
Performance issue with loading image from url
Posted by Raj Chudasama at 10/14/2005 2:17:23 PM
i have a need to load image from URL. the image is really small (gif) and i
use the following code.
but the code is too slow any1 have any alternative way(S)?
here is the url
http://phone.avioninc.com/asterisk/wami/graphics/phoneringing.gif
-----------------------here is the performance co... more >>
visual studio 2003 trashes my code. fix?
Posted by Dica at 10/14/2005 2:17:08 PM
this is related to an earlier question i had. i'm trying to figure out
visual studio 2003 and c#. i started a simple app to try to learn the
basics and used many of the wizards to set up things like my database
connection strings, etc. once i had the basic form set up, i went to hand
edit the c... more >>
\n in C#?
Posted by James at 10/14/2005 2:10:40 PM
Hi all,
Probably the first thing most of you learn, but I don't know the
newline character for C#.
Thanks,
James
... more >>
? about reporting errors
Posted by Steve at 10/14/2005 1:50:09 PM
I have found myself being a bad programmer. I know I should trap errors and
exceptions and log them, but I'm not.... everywhere. I DO when the error
happens in my Form class because that is where I initially setup my error
log. I find now, after adding 30+ classes that when an error happens in... more >>
Keys enumeration
Posted by C Glenn at 10/14/2005 1:45:57 PM
I'm writing some code in a KeyUp handler and can't find the Keys
enumeration member for the semicolon ';'. I found Keys.OemSemicolon,
but that doesn't get what I'm after. Anyone out there know how to trap it?... more >>
Library events
Posted by Max at 10/14/2005 1:39:21 PM
I would like to load a library at runtime to do some work for the main application that calls it.
I would also like the main application to be notified when the library is done the work. Is this
possible? What kind of events should I look into. A link to some sample code or a site would
be helpfu... more >>
Assembly files
Posted by Max at 10/14/2005 1:36:54 PM
Is an assembly file a dll file or can it also be an executable file?
... more >>
"Versioning" a .MDB file
Posted by Jeffery Tyree at 10/14/2005 1:01:46 PM
A friend is developing a Access 2003 database. I am developing a simple
installer package using C#Net. We are looking for best methods, suggestions
and definately code examples for:
1. Setting a 'version number' type property of the Access .MDB/.MDE file
within Access/VBA
2. Then how... more >>
Application consumes close to 100% of CPU, how to profile and determine the cause
Posted by LordHog NO[at]SPAM hotmail.com at 10/14/2005 12:30:19 PM
Hello,
I recently wrote an application that is used for testing units in a
burn-in chamber. It uses two external library that require the use of
P\Invoke in order to work with them. There is a primary thread and a
secondary polling thread. Every once in a while the process will
consume clos... more >>
Getting multiple SELECTED values from stored procedure into an array?
Posted by Amy at 10/14/2005 12:25:37 PM
Hello,
I've been struggling to learn C#.NET for a while now. I've made some
progress, but I'm easily stumped. :(
What's stumping me today is this:
I've got a stored procedure (SQL) that returns one row from a table,
and up to 3 rows from another table. I want to read the values of the
t... more >>
Working with assemblies
Posted by Max at 10/14/2005 12:18:30 PM
I made a class library which I want to load when something happens.
How can I load this library and then pass in a paramter?
I tried:
Assembly asm = Assembly.Load("mylibrary");
Type t = asm.GetType("MyClass");
Object obj = Activator.CreateInstance(t, new object[] {myargument});
and I get... more >>
getting " Object type cannot be converted to target type." with dataAdapter using storedProc
Posted by Dica at 10/14/2005 12:17:05 PM
i'm getting an error when trying set my dataAdapter's selectCommand. the
sqlStatement is a storedProc which takes parameters, so it's constructed as:
sqlSelectCommand1.CommandText = "[uspProjectListUser]";
sqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure;
sqlSelectCo... more >>
Strong Typed Collections
Posted by farseer at 10/14/2005 12:10:26 PM
I'd like my collections to contain specific types of objects. Most of
the topics i read on this involves creating a custom collection class
that extends DictionaryBase or IEnumerable. But this means for every
object type i care about, i must create a custom collection class for.
Isn't there a ... more >>
Why SqlDataAdapter doesn't save the changes I made in a cell to DB
Posted by Alpha at 10/14/2005 11:41:02 AM
The string test = 'Exp'. I verified in Debug mode that test has 'Exp' in the
first line and the 2nd line of code. Showing that
dsVehicle.Tables["VehDetail"].Rows[prevRow]["Model"] has the proper changed
text from null string to 'Exp'. However, the numOfRows shows 0 after
execution. I exi... more >>
Apparent ViewState Problem
Posted by Bill at 10/14/2005 11:32:48 AM
I've been chasing this problem around for a few days now and its driving me
nuts. We keep getting these errors in our web application intermittently.
I can't cause the problem myself to attempt to reproduce. From the reading
I've done, people run into this when urlencoding and urldecoding im... more >>
session disconnected
Posted by Stanley Cheung at 10/14/2005 11:19:51 AM
Hi all,
I hava a strange problem.
After the system perform "DirectoryInfo.MoveTo", all the session and
viewstate has reseted.. it make my application auto logout....
is it a known bug in .net framework1.1?
anyone can help? Thanks in advanced.
steambun
... more >>
How to dynamically build font...?
Posted by Tim at 10/14/2005 10:58:01 AM
Hi Guys,
I want to build a font like so:
headerFont = new Font("Times New Roman", 10, FontStyle.Underline |
FontStyle.Bold);
It is going to be built dynamically from the DB. How do I build the styles
dynamically. In the above example it has underline and bold, it could also
have italics... more >>
Use of NotifyParentPropertyAttribute
Posted by Polo at 10/14/2005 10:55:52 AM
Hi,
Somebody can exlpain me how to use the attribute
[NotifyParentPropertyAttribute(true)]
At the moment I use [RefreshPropertiesAttribute(RefreshProperties.Repaint)]
to ensure that the parent of this property is redrawed.
Thank's in advance
Polo
... more >>
Equivilent of VB's DatePart
Posted by Ryan Ternier at 10/14/2005 10:39:32 AM
I'm trying to find an equivilent function to VB's DatePart function.
I have a Year, Month, the Day of week (Sunday, monday etc.) and the week
(week 1, week 2) and I need to find the date of that month.
Can anyone help me with this?
/RT
... more >>
scope issues
Posted by Chris at 10/14/2005 10:39:09 AM
Hi,
I am learning object oriented programming.
I am always running into scope issues in my C# ASP.NET applications.
example:
a public void methods:
My intellisense does not does up for all lot of methods for instance.
and I believe (not positive) that it gets even worse inside try bl... more >>
where to find system.windows assembly
Posted by Dica at 10/14/2005 10:09:39 AM
i need to create a clock object which is apparently in the clock class under
System.Windows.Media.Animation. i've tried adding a reference to this
assembly, but the closest thing i can find is System.Windows.Forms.
where can i find/install this assembly?
tks
... more >>
Importing non-COM dll
Posted by Steve at 10/14/2005 10:03:56 AM
First attempt at importing a DLL
Here is my class
<code>
public class TIGangProg
{
public TIGangProg(){}
[DllImport("GANG430.dll")]
public static extern int InitCom(string lpszComPort, int IBaudRate);
}
</code>
When I attempt to make a call to InitCom I get a DLLNotFound exce... more >>
InvalidCastException question
Posted by MounilK at 10/14/2005 9:59:13 AM
Hi all,
I have a form which has a TabControl and a Button. At runtime, on the
TabControl, I create a TabPage with a TextBoxes. Now, when I click the
button after entering some text in the textbox, I want to show the text in a
messagebox. I tried the following code but get an error.
foreach... more >>
problem using IEnumerable<T>
Posted by jcc at 10/14/2005 9:49:22 AM
Hi guys,
I'm a newbie to C#. My Visual Studio 2005 failed to compile the
following code with error as
'HelloWorld.A' does not implement interface member
'System.Collections.IEnumerable.GetEnumerator()'.
'HelloWorld.A.GetEnumerator()' is either static, not public, or has the
wrong return ty... more >>
test
Posted by Reza Razavipour at 10/14/2005 9:26:38 AM
this is reza testing...
... more >>
Static methods
Posted by CodeRazor at 10/14/2005 9:03:02 AM
Hi,
How is a static method different from a normal method (apart from the
obvious -- ie. you don't need to initialise the class to call the method).
thank you,
coderazor
... more >>
AppDomain.CreateDomain pb!
Posted by wavemill at 10/14/2005 8:40:04 AM
Hello!
I have a serializationEception. Impossible to deserialize the object.
I have try with app.AssemblyResolve but i have not found the solution.
My purpose is to launch my program directly from the memory.
// Bhe bytes in the assembly.
byte[] byteload = null;
// Open the file stream... more >>
C# 2.0 language grammar
Posted by Magius at 10/14/2005 8:17:12 AM
Hello,
I have a question about the correctness of the language grammar for the C#
2.0 specification. I am working with the grammar specified in the June 2005
ECMA-334 standard.
Basically, a using-namespace-directive is defined as follows:
using-namespace-directive:
using namespac... more >>
Intercepting system calls in .NET
Posted by Peter Olcott at 10/14/2005 7:59:47 AM
Is there any way to intercept system calls to windows such as TextOut and DrawText?
what kinds of system calls can be intercepted, and what is the mechanism to accomplish this?
... more >>
Lost Control.
Posted by John F at 10/14/2005 7:15:02 AM
Hello,
Ok, don't laugh, but I have a panel control on a form and it has lots of
other controls on it. I can't find it in the designer in VS.NET! I can go
to the properties window and select it. All the controls it houses are there
too. Yes, I did move all the controls on the form all ov... more >>
C# application seen as a Windows user....
Posted by Pete Wittig at 10/14/2005 7:11:18 AM
Hello,
I am wondering if it is possible to create a networked application with C#
that is seen as a windows user. For example, if Bob logged onto windows and
then started the application, any access to the network made through the
application would be seen as 'C# application user' and not ... more >>
Internet Explorer Extension (COM)
Posted by Milos at 10/14/2005 6:46:26 AM
Hello,
I need to create a IE Extension in C#. I want to add a button to IE standard
toolbar and then make IE call the DLL when button is clicked.
I have started with the following code
-------------------------------- code --------------------------------
[StructLayout(LayoutKind.Sequentia... more >>
Question about files
Posted by Gidi at 10/14/2005 5:11:07 AM
Hi,
I want to create a file and write into it. how can i set that the files will
be created where the program i'm creating was installed in a folder named
files? for example if i installed me program in d:\program i want to save my
file in d:\program\files.
Thanks,
Gidi.... more >>
using VB.NET created class in C# program
Posted by Stanley at 10/14/2005 3:30:01 AM
I have a class "clsABC" which is created by VB.NET. I am trying use it in the
C# program. Although I can add it in the project reference, I can't browse
the methods and properties in the coding.
Please see the following coding:
using clsABC
clsABC tmpClass = new clsABC();
tmpClass. <----... more >>
Error...
Posted by sonu at 10/14/2005 3:02:28 AM
I i am calling a window apllcation by making that window application
Control Dll.
i have used list box in side that control when i tried to populated
that listbox i got this error....
/////
The application attempted to perform an operation not allowed by the
security policy. the operation ... more >>
Arrrrgggg IBindingList!
Posted by Maxus at 10/14/2005 2:44:35 AM
Hi People,
I'm implementing one of those typed collection thing that we all love
so much :) anyhows.. Problem is this I want make it use generics. So I
implement ICollection<T>, IList<T> and I think "hell yeah thats the
stuff!" So then I think "well lets add some neat data binding stuff" So
I... more >>
Windows Service does not start
Posted by mpriem at 10/14/2005 1:50:24 AM
Hi,
I am developing my very first Windows Service.
I want to query AD every 5 minutes to generate a Report which I will
use in a website.
I use the following testcode, but the service won't start in a timely
fashion. What am I doing wrong?
using System;
using System.IO;
using System.Coll... more >>
A first chance exception of type 'System.InvalidOperationException
Posted by Juanjo at 10/14/2005 1:35:01 AM
Hi all
I get the following error:
'A first chance exception of type 'System.InvalidOperationException'
occurred in system.dll
Additional information: The requested Performance Counter is not a custom
counter, it has to be initialized as ReadOnly.'
My code c#:
using Microsoft.Practices... more >>
DateTime
Posted by Curious at 10/14/2005 12:37:05 AM
Hi,
I have a class that has some fields. One of the fields is of type
DateTime. From the constructor of the class, I am passing
DateTime.Now; The value being stored is the following: 01/01/0001
00:00:00
Thats not the correct date and time.
Then when I try Console.WriteLine(DateTime.No... more >>
How do update data more convient?
Posted by Jason Huang at 10/14/2005 12:00:00 AM
Hi,
I need to update my data based on the textboxes input on my windows form.
But I feel the following sql requery is to long and cumbersome.
Is there some more convient way to do the Update thing?
Thanks for help.
Jason
Here are some of my codes:
public void UpdateData(string strU... more >>
Newbie Question
Posted by S Shulman at 10/14/2005 12:00:00 AM
I added the following declaration withing a namespace but not within a class
[DllImport("user32.dll", EntryPoint="SendMessage", CharSet=CharSet.Auto )]
public static extern int SendCharFmtMsg( IntPtr hWnd, int Msg, int wParam,
ref CHARFORMAT2 cf2 );
And UI get the following compiler er... more >>
How to make a "Modal Object" ?
Posted by Steph. at 10/14/2005 12:00:00 AM
How can I make a "ModalObject" that will react like a ModalForm ? I =
mean an object that will run in it's own message loop and return a value =
(a string value) when closed.
=20
Example :
=20
private void SomeFunction()
{
ModalObject modalObject =3D new ModalObje... more >>
Selecting a Node in a TreeNode from a TreeView
Posted by Stefan at 10/14/2005 12:00:00 AM
Hey guys !
Can someone pls help me and tell me how it is possible to Select a Node =
in =
2nd row?
I got a treeview which is build like follows:
node2.Nodes.Add("blah", "blubb");
node1.Nodes.Add(node2);
treeview.Nodes.Add(node1);
now I want "blubb"-node to be selected. How can I... more >>
Hosting Forms + events question
Posted by Darren Guy at 10/14/2005 12:00:00 AM
Hello
I have a main form that has a tab control. Each tab will host a form
So after creating each child form, I run the following code to attach it to
a tab
frm.Owner = this;
frm.TopLevel = false;
frm.WindowState = FormWindowState.Maximized;
frm.FormBorderStyle = FormBorderStyle.None;
... more >>
Dump variable contents similar to PHP var_dump() or print_r() function?
Posted by ChuckDemon at 10/14/2005 12:00:00 AM
Is there a .NET class or function to dump the contents of a
variable/array/object/whatever to the console?
Console.WriteLine( dump_variable( my_var ) );
Thanks.... more >>
|