Click here to Skip to main content
15,890,717 members
Home / Discussions / C#
   

C#

 
GeneralRe: Execute program automatically at a prescribed time daily. Pin
javid4u23-Jul-07 0:53
javid4u23-Jul-07 0:53 
QuestionGeneric Edit/Copy, Paste, Cut items in WinForms Pin
AndrusM23-Jul-07 0:05
AndrusM23-Jul-07 0:05 
AnswerRe: Generic Edit/Copy, Paste, Cut items in WinForms Pin
Christian Graus23-Jul-07 0:14
protectorChristian Graus23-Jul-07 0:14 
QuestionDeleting temporary file Pin
-spy-22-Jul-07 23:57
-spy-22-Jul-07 23:57 
AnswerRe: Deleting temporary file Pin
blackjack215023-Jul-07 0:05
blackjack215023-Jul-07 0:05 
AnswerRe: Deleting temporary file Pin
Luc Pattyn23-Jul-07 1:52
sitebuilderLuc Pattyn23-Jul-07 1:52 
AnswerRe: Deleting temporary file Pin
L Henson23-Jul-07 2:42
L Henson23-Jul-07 2:42 
QuestionCursor Dispose Problem Pin
Keshav V. Kamat22-Jul-07 23:43
Keshav V. Kamat22-Jul-07 23:43 
Consider my code below


Cursor m_OldCursor;<br />
void OnCursorChanged(object sender, EventArgs e)<br />
{<br />
	if(m_OldCursor != null)<br />
	{<br />
		m_OldCursor.Dispose();<br />
	}<br />
	m_OldCursor = new Cursor(this.Cursor.CopyHandle());<br />
}<br />
<br />
void ProcessMouseMove(EventArgs e)<br />
{<br />
	// m_OldCursor is used here too. <br />
	// hence cannot be declared everytime in <br />
	// OnCursorChanged.<br />
}

I know it is wrong to use a object after it is disposed. but every single
time the CopyHandle() method is invoked, it creates a handle. since there
is a restriction on the number of handles that windows can manage, i need
to dispose this handle after its use. if not then the application will
crash. If instead of Cursor, it was a control then i could have used the DestroyHandle property.

Could you suggest me any other way to do the same.

thanks in advance.

Keshav Kamat Smile | :)
India

AnswerRe: Cursor Dispose Problem Pin
Luc Pattyn23-Jul-07 2:01
sitebuilderLuc Pattyn23-Jul-07 2:01 
QuestionPdf File Creation Pin
karthikeyanic22-Jul-07 23:32
karthikeyanic22-Jul-07 23:32 
AnswerRe: Pdf File Creation Pin
blackjack215022-Jul-07 23:55
blackjack215022-Jul-07 23:55 
GeneralRe: Pdf File Creation Pin
javid4u23-Jul-07 0:16
javid4u23-Jul-07 0:16 
Questiondatagrid problem Pin
srinivassam22-Jul-07 23:28
srinivassam22-Jul-07 23:28 
AnswerRe: datagrid problem Pin
satsumatable23-Jul-07 0:33
satsumatable23-Jul-07 0:33 
GeneralRe: datagrid problem Pin
srinivassam23-Jul-07 1:24
srinivassam23-Jul-07 1:24 
QuestionWhich one to use? Pin
Hum Dum22-Jul-07 23:09
Hum Dum22-Jul-07 23:09 
AnswerRe: Which one to use? Pin
Guffa22-Jul-07 23:32
Guffa22-Jul-07 23:32 
QuestionMessage Queue Manipulation Pin
M. J. Jaya Chitra22-Jul-07 22:49
M. J. Jaya Chitra22-Jul-07 22:49 
Questionusing user control Pin
cyn822-Jul-07 22:04
cyn822-Jul-07 22:04 
QuestionThreads and modules... Pin
Arish rivlin22-Jul-07 22:04
Arish rivlin22-Jul-07 22:04 
AnswerRe: Threads and modules... Pin
Stephen Hewitt22-Jul-07 22:14
Stephen Hewitt22-Jul-07 22:14 
GeneralRe: Threads and modules... Pin
Arish rivlin22-Jul-07 22:28
Arish rivlin22-Jul-07 22:28 
GeneralRe: Threads and modules... Pin
Stephen Hewitt22-Jul-07 22:33
Stephen Hewitt22-Jul-07 22:33 
GeneralRe: Threads and modules... Pin
Arish rivlin23-Jul-07 0:16
Arish rivlin23-Jul-07 0:16 
GeneralRe: Threads and modules... Pin
Luc Pattyn23-Jul-07 2:08
sitebuilderLuc Pattyn23-Jul-07 2:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.