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

C#

 
AnswerRe: Selecting from datatable Pin
Giorgi Dalakishvili1-Dec-09 18:56
mentorGiorgi Dalakishvili1-Dec-09 18:56 
AnswerRe: Selecting from datatable Pin
dan!sh 1-Dec-09 19:07
professional dan!sh 1-Dec-09 19:07 
AnswerRe: Selecting from datatable Pin
Anurag Gandhi1-Dec-09 19:58
professionalAnurag Gandhi1-Dec-09 19:58 
Questionout of memory exception Pin
eswar pothula1-Dec-09 17:57
eswar pothula1-Dec-09 17:57 
AnswerRe: out of memory exception Pin
Saksida Bojan1-Dec-09 19:18
Saksida Bojan1-Dec-09 19:18 
Answerunreadable Pin
Luc Pattyn2-Dec-09 1:16
sitebuilderLuc Pattyn2-Dec-09 1:16 
QuestionReally need help with platform invoke Lotus Notes API in C# Pin
senorAli331-Dec-09 16:27
senorAli331-Dec-09 16:27 
AnswerRe: Really need help with platform invoke Lotus Notes API in C# Pin
Luc Pattyn1-Dec-09 16:51
sitebuilderLuc Pattyn1-Dec-09 16:51 
Hi,

is this the first P/Invoke call you are trying? or are there others that succeed/fail?
You should build it up, trying the simplest methods first.

Make sure to put all the P/Invoke stuff in a big try-catch and have the catch block show the full Exception.ToString()

If you don't need note_handle on the managed side (i.e. it gets a value returned by your first Lotus call, then needs to be passed to consecutive calls), then an IntPtr is fine.

Is item_value an input? or an output?

Passing a string as input is easy, just use string; you may want to add CharSet=CharSet.Ansi or CharSet=CharSet.Unicode to the DllImport attribute.

Passing a pointer to a number, an array, a struct takes some effort, as you must make sure the object can't get moved by the GC while native code is using it. I tend to use the GCHandle class for that, although simple cases can be solved using the fixed keyword.

BTW: I am preparing a couple of articles on P/Invoke; here[^] is a preliminary version for part 1, that might be useful.

Smile | :)

Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


QuestionMulticast Delegate using MethodInfo Pin
hobbel2221-Dec-09 12:29
hobbel2221-Dec-09 12:29 
AnswerRe: Multicast Delegate using MethodInfo Pin
N a v a n e e t h1-Dec-09 17:04
N a v a n e e t h1-Dec-09 17:04 
GeneralRe: Multicast Delegate using MethodInfo Pin
hobbel2221-Dec-09 23:50
hobbel2221-Dec-09 23:50 
QuestionIs their a better way than using the Try/Catch statement in this source? Pin
venomation1-Dec-09 9:07
venomation1-Dec-09 9:07 
AnswerRe: Is their a better way than using the Try/Catch statement in this source? Pin
OriginalGriff1-Dec-09 9:15
mveOriginalGriff1-Dec-09 9:15 
GeneralRe: Is their a better way than using the Try/Catch statement in this source? Pin
venomation1-Dec-09 9:24
venomation1-Dec-09 9:24 
GeneralRe: Is their a better way than using the Try/Catch statement in this source? Pin
OriginalGriff1-Dec-09 9:34
mveOriginalGriff1-Dec-09 9:34 
GeneralRe: Is their a better way than using the Try/Catch statement in this source? Pin
vtchris-peterson1-Dec-09 9:29
vtchris-peterson1-Dec-09 9:29 
GeneralRe: Is their a better way than using the Try/Catch statement in this source? Pin
venomation1-Dec-09 9:37
venomation1-Dec-09 9:37 
QuestionSandboxing with AppDomain Pin
softwarejaeger1-Dec-09 7:51
softwarejaeger1-Dec-09 7:51 
QuestionReading excel file in Vista x64 Pin
kmuthuk1-Dec-09 5:38
kmuthuk1-Dec-09 5:38 
AnswerRe: Reading excel file in Vista x64 Pin
Dave Kreskowiak1-Dec-09 5:47
mveDave Kreskowiak1-Dec-09 5:47 
GeneralRe: Reading excel file in Vista x64 Pin
kmuthuk1-Dec-09 5:55
kmuthuk1-Dec-09 5:55 
GeneralRe: Reading excel file in Vista x64 Pin
Dave Kreskowiak1-Dec-09 11:04
mveDave Kreskowiak1-Dec-09 11:04 
QuestionWrapped COM call works during Test, otherwise fails Pin
puromtec11-Dec-09 5:18
puromtec11-Dec-09 5:18 
AnswerRe: Wrapped COM call works during Test, otherwise fails Pin
Paulo Zemek1-Dec-09 6:07
mvaPaulo Zemek1-Dec-09 6:07 
GeneralRe: Wrapped COM call works during Test, otherwise fails Pin
puromtec11-Dec-09 6:31
puromtec11-Dec-09 6:31 

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.