Click here to Skip to main content
15,905,867 members
Home / Discussions / C#
   

C#

 
AnswerRe: Getting "Input array is longer than the number of columns in this table." PinPopular
Rob Graham18-Jul-10 8:19
Rob Graham18-Jul-10 8:19 
Questionhelp: deploy c# windows application with sql server database Pin
pradeepwithu18-Jul-10 6:56
pradeepwithu18-Jul-10 6:56 
AnswerRe: help: deploy c# windows application with sql server database [modified] Pin
I Believe In GOD18-Jul-10 11:32
I Believe In GOD18-Jul-10 11:32 
Questioninheritance of atribute. Pin
prasadbuddhika18-Jul-10 1:43
prasadbuddhika18-Jul-10 1:43 
AnswerRe: inheritance of atribute. Pin
OriginalGriff18-Jul-10 1:50
mveOriginalGriff18-Jul-10 1:50 
GeneralRe: inheritance of atribute. Pin
Abhinav S18-Jul-10 6:42
Abhinav S18-Jul-10 6:42 
GeneralRe: inheritance of atribute. Pin
prasadbuddhika18-Jul-10 7:09
prasadbuddhika18-Jul-10 7:09 
QuestionProblem to update hierarchical data and display it in treeView. Pin
hdv21217-Jul-10 22:27
hdv21217-Jul-10 22:27 
AnswerRe: Problem to update hierarchical data and display it in treeView. Pin
Mycroft Holmes18-Jul-10 14:44
professionalMycroft Holmes18-Jul-10 14:44 
GeneralRe: Problem to update hierarchical data and display it in treeView. Pin
hdv21220-Jul-10 11:42
hdv21220-Jul-10 11:42 
Generalprogram c# Pin
danhco17-Jul-10 22:14
danhco17-Jul-10 22:14 
GeneralRe: program c# Pin
OriginalGriff17-Jul-10 22:30
mveOriginalGriff17-Jul-10 22:30 
QuestionHow can I syncronize paint events from different controls? Pin
Steven Solberg17-Jul-10 3:39
Steven Solberg17-Jul-10 3:39 
AnswerRe: How can I syncronize paint events from different controls? Pin
Luc Pattyn17-Jul-10 4:02
sitebuilderLuc Pattyn17-Jul-10 4:02 
GeneralRe: How can I syncronize paint events from different controls? Pin
Steven Solberg17-Jul-10 4:14
Steven Solberg17-Jul-10 4:14 
GeneralRe: How can I syncronize paint events from different controls? Pin
Luc Pattyn17-Jul-10 4:31
sitebuilderLuc Pattyn17-Jul-10 4:31 
GeneralRe: How can I syncronize paint events from different controls? Pin
Steven Solberg17-Jul-10 4:34
Steven Solberg17-Jul-10 4:34 
GeneralRe: How can I syncronize paint events from different controls? Pin
Luc Pattyn17-Jul-10 4:54
sitebuilderLuc Pattyn17-Jul-10 4:54 
GeneralRe: How can I syncronize paint events from different controls? [modified] Pin
Steven Solberg17-Jul-10 8:09
Steven Solberg17-Jul-10 8:09 
GeneralRe: How can I syncronize paint events from different controls? Pin
Steven Solberg22-Jul-10 22:24
Steven Solberg22-Jul-10 22:24 
QuestionManaged/Unmanaged code intraoperability: Casting between pointers Pin
Keith Vitali16-Jul-10 14:24
Keith Vitali16-Jul-10 14:24 
AnswerRe: Managed/Unmanaged code intraoperability: Casting between pointers Pin
Luc Pattyn16-Jul-10 14:43
sitebuilderLuc Pattyn16-Jul-10 14:43 
That does not make sense to me, for a couple of reasons.

1.
Your DataType is a managed type, so why would you want that as a parameter in an unmanaged callback? Pointers that cross the managed/unmanaged border should be understood on both sides, good examples would be int* for a simple array, or IntPtr for just almost everything. So you don't need AddrOfPinnedObject().ToPointer(), AddrOfPinnedObject() suffices.

2.
The GCHandle you create needs to stay alive, so it cannot be a local variable inside a callback method. Remember, you need to call Free() on it when done, otherwise the object remains pinned forever.
Note: if your callback were called more than once, a single class-level IntPtr would not be sufficient either.

FWIW: I have this unfinished article[^] on P/Invoke.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Managed/Unmanaged code intraoperability: Casting between pointers Pin
Nish Nishant16-Jul-10 14:46
sitebuilderNish Nishant16-Jul-10 14:46 
GeneralRe: Managed/Unmanaged code intraoperability: Casting between pointers Pin
Luc Pattyn16-Jul-10 15:00
sitebuilderLuc Pattyn16-Jul-10 15:00 
GeneralRe: Managed/Unmanaged code intraoperability: Casting between pointers Pin
Garth J Lancaster16-Jul-10 17:44
professionalGarth J Lancaster16-Jul-10 17:44 

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.