|
wow - cool. I will try that out next time I need it
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
BelMcGrady wrote:
can anyone please explain this code to me.
Sure, they are simply overriding what ToString() will produce when the ToString() method is called of the class instance it refers to. kind is some type defined within the class itself, where they are calling the ToString() method on the type of data type that kind represents. The (int)kind portion of the statement is simple a C-style cast of whatever value is held within the data type kind to an integer.
- Nick Parker My Blog | My Articles
|
|
|
|
|
i'm trying to track down why my app sometimes does not remove itself from memory when i hit the upper right hand X close button. what are some of the common things that don't get cleaned that would keep an app from closing down? i only create one other thread in my app, and i know that's not the problem because it wasn't even created yet at the times the app hung at close. thanks
|
|
|
|
|
actually, after further inspection, it appears it might be thread related. after a thread is created, it seems to not clean up sometimes. the thread is cleaned up by calling .Abort() on it. is this a guaranteed way to clean up a thread?
|
|
|
|
|
As MSDN states: "The thread is not guaranteed to abort immediately, or at all. This situation can occur if a thread does an unbounded amount of computation in the finally blocks that are called as part of the abort procedure, thereby indefinitely delaying the abort. To ensure a thread has aborted, invoke a Join method on the thread after calling Abort."
www.troschuetz.de
|
|
|
|
|
Are you hiding any forms? If the form is hidden it doesn't close, therefore the application stays open.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
hi, anyone knows how to delete a row or multiple rows in a datagrid?
Chris
|
|
|
|
|
a datagrid has it source binded to it, so when you delete an row from its datasource the row from the grid it will be deleted too.
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
Hi,
I use VS.NET 2003 to create a Crystal Report CallType.rpt and do the following
CallType rptCallType = new CallType();
crystalReportViewer1.ReportSource = rptCallType;
The report's data is from SQL Server. Every time I view the report using CrystalReportViewer, I am prompted for the database's password. Is there a way to save or fill in the password by code? I don't want to give the database's password to my application's users.
Thank you.
|
|
|
|
|
Hi,
iam using windows application. I have file named myfile.txt which can be located anywhere in my harddisk. I want to know whether there is anything equivalent in windows application for Server.Mappath to map to my file virtually.
Any furthur comments and suggestions are welcome.
Thanks in advance.
|
|
|
|
|
Unless you are somehow running your windows application inside IIS then the concept of a virtual path does not exist.
Perhaps you are confusing the concept with something else. Can you explain what you mean by "to map to my file virtually"?
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
virtually i mean that the file can be anywhere in my computer.I should to the location of my file by just specifying my filename.
|
|
|
|
|
A virtual path in the context of an ASP.NET application means that it is a URL, e.g. http://myserver.tld/mydir/myfile.txt
If your application is on your computer, and the file is on the computer then you just need to specify the file name, e.g. C:\mydir\myfile.txt
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
|
Hi,
I am trying to achieve a very simple task, using VS 2003 and C#. I have a touch screen app written in Delphi, which I want to rewrite in C#. On e of the things I need to do is to have a panel aligned to the bottom of the screen which I am going to use to put some buttons on. Sometimes the buttons don't fit on the panel so the user need to scroll left and right to display the different buttons.
I used the following method on the panel which scrolls the panel left and right:
Panel1.ScrollWindow(100, 0); // move right
and
Panel1.ScrollWindow(-100, 0); // move left
The problem I am having is that when the button goes out of seen, meaning that it's no longer visible it will disappear for good, therefore moving to the opposite direction doesn't bring it back.
Am I missing something, I have tried calling Invalidate and update to see if I can repaint the control, but it didn't work.
It looks like it's something very simple am missing, any help would be appreciated.
|
|
|
|
|
when I attach my device to the PC,the case DEVICETYPE.DBT_DEVTYP_DEVICEINTERFACE never occur.What's the trouble?
My code is:
const int WM_DEVICECHANGE = 0x0219;
public enum DEVICETYPE:int
{
DBT_DEVTYP_OEM =0x00000000,// oem-defined device type
DBT_DEVTYP_DEVNODE = 0x00000001, // devnode number
DBT_DEVTYP_VOLUME = 0x00000002, // logical volume
DBT_DEVTYP_PORT = 0x00000003, // serial, parallel
DBT_DEVTYP_NET =0x00000004, // network resource
DBT_DEVTYP_DEVICEINTERFACE =0x00000005 //device interface class
}
//the definition of other structures
protected override void WndProc(ref Message devicemsg)
{
_DEV_BROADCAST_DEVICEINTERFACE
DevBroadcastInterface;
DEVICEEVENT Eventtype;
_DEV_BROADCAST_HDR Whicheventtype;
_DEV_BROADCAST_VOLUME DevBroadcastVolume;
base.WndProc(ref devicemsg);
if(devicemsg.Msg == WM_DEVICECHANGE)
{
Eventtype = (DEVICEEVENT)devicemsg.WParam.ToInt32();
switch(Eventtype)
{
case DEVICEEVENT.DBT_DEVICEARRIVAL:
{
Whicheventtype = (_DEV_BROADCAST_HDR)Marshal.PtrToStructure(devicemsg.LParam,typeof(_DEV_BROADCAST_HDR));
switch(Whicheventtype.dbch_devicetype)
{
case DEVICETYPE.DBT_DEVTYP_DEVICEINTERFACE
{//this case can not be retrieved,why?
DevBroadcastInterface = (_DEV_BROADCAST_DEVICEINTERFACE)Marshal.PtrToStructure(devicemsg.LParam,typeof(_DEV_BROADCAST_DEVICEINTERFACE));
//do something here.
break;
}
case DEVICETYPE.DBT_DEVTYP_VOLUME:
{// but this case can be retrieved.
DevBroadcastVolume = (_DEV_BROADCAST_VOLUME)Marshal.PtrToStructure(devicemsg.LParam,typeof(_DEV_BROADCAST_VOLUME));
//do something here.
break;
}//end case DBT_DEVTYP_VOLUME
}//end switch(pDevBroadcastHdr.dbch_devicetype)
}//end case DBT_DEVICEARRIVAL
break;
}//end switch(Eventtype)
}//end if
}//end WndProc()
Why does the WndProc can not retrive the DBT_DEVTYP_DEVICEINTERFACE message device type?
Thanks!
|
|
|
|
|
Hi everyone,
I am looking for a free implementation of a line graph control.
What I want to do with the control:
I have a file which contains line by line of status information:
000000000 00
000000001 0A
000000015 FC
....
These values represent the pin status of a "simulated" chip.
The first nine digits are some kind of "cycle"-count and the 2 hex-digits represent the pin status (binary).
The above means:
On cycle 0, all pins are 0.
On cycle 1, pins 5 and 7 are 1, all others 0 (00001010)
etc.
I need to present this data as a line graph.
(approx. like this:
---____-__-_____---,
just w/ vertical lines in between )
Then, this line-graph control should accept some kind of data-grid containing the information for each line, so I can simply manipulate point information instead of having to implement that myself.
There should be captions along the X-axis, as well as some way to select a range which should be drawn (along with zooming/stretching and automatic captioning), so I can zoom "into" the graph without to much hassle.
This is no commercial program, but rather a project for vocational school, so I do neither have the time nor the resources to write up that control myself.
I do believe that I once ran across a control which was capable of doing to here on CodeProject, but I am currently unable to find it (I've been trying to find it again for 3h straight).
If this is the wrong section, I apologize, but I was pretty sure the control I saw had "C#" in its "description".
I appreciate any help
Cheers
Sebastian
|
|
|
|
|
I forgot:
Q: WHAT kind of program are you developing?
A: The text file mentioned above is used as input for some kind of electronics simulation software. There is no graphical editor included, so
the project is to write one.
This means, when it is done, I want to be able to graphically edit and display the information contained in those files.
Sorry
Cheers
Sebastian
|
|
|
|
|
Hello,
I'm implementing an exception management application block in C# and I'm facing a problem. I would like to get a reference to the caller object of another object method I'm currently in, if it is possible. Let me precise that I don't want this reference to be a parameter of my method. Could anyone help me?
Thanks,
Didier
|
|
|
|
|
Hopefully this code helps:
static void Method1a()
{
Method2();
}
static void Method1b()
{
Method2();
}
static void Method2()
{
StackTrace st = new StackTrace();
StackFrame frame = st.GetFrame(1);
Console.WriteLine("I am Method2, I was called from {0}",frame.GetMethod().Name);
}
If you call it like this:
Method1a();<br />
Method1b();
You get this output:
I am Method2, I was called from Method1a
I am Method2, I was called from Method1b
|
|
|
|
|
Hi,
how can I get the information whether the key Enter is pressed in the DataGrid? The events KeyDown or Keypress did not fire. If I press "G" for example or other simple letters both events are firering, but not if the specific key enter is pressed.
What can I do?
Thanx Steffen
|
|
|
|
|
when i'am using your project of the twain that return image from the scanner available there is a function called transfer that return arraylist of image handeler it's ok but the main problem which i face it is :
when i create a new object of Bitmap
then:
Bitmap testimage = new Bitmap(System.Drawing.Image.FromHbitmap(HBmp),Width,Hieght);
where HBmp-->> is the imageHandeler
it raise an exception:
System.Runtime.InteropServices.ExternalException' occurred in system.drawing.dll
so,any one can help??
thanks alot
|
|
|
|
|
This sounds like you are referring to someone's article, if that is the case, you may wish to ask your question in the forum attached to the bottom of their article, this way the author will receive you question via email.
- Nick Parker My Blog | My Articles
|
|
|
|
|
hello everybody,
in first time sorry about my english because is not very good.
I'm doing a program that has to control the number of pages people can print in the printer of my server. I'm using Active Directory to see the number of pages, and pause, resume and/or cancel the print job. the problem is when people print some copies of a document of word pad, acrobat reader or a page from internet explorer. in the windows print queue only appears the first copy and my program only see the fist copy too. this is a big problem because people can print 100 copies and pay only 1!!!!
how can i see the number of copies that one user has sended to print to the printer in the server?
thank's
sergio
|
|
|
|
|
This is a known issue in printer monitoring and the only bulletproof solution is to parse the sppol file and count the actual pages sent to the printer yourself.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|