Click here to Skip to main content
15,898,134 members
Home / Discussions / C#
   

C#

 
GeneralRe: OpenCV Project ? Pin
Henry Minute13-Jul-09 9:01
Henry Minute13-Jul-09 9:01 
GeneralRe: OpenCV Project ? Pin
0x3c013-Jul-09 9:10
0x3c013-Jul-09 9:10 
AnswerRe: OpenCV Project ? Pin
Henry Minute13-Jul-09 9:20
Henry Minute13-Jul-09 9:20 
QuestionReading pdf file as text from the URL. Pin
aakar13-Jul-09 8:08
aakar13-Jul-09 8:08 
AnswerRe: Reading pdf file as text from the URL. Pin
Christian Graus13-Jul-09 8:25
protectorChristian Graus13-Jul-09 8:25 
Questiondecimal value being truncated when exporting data to excel from asp.net c# Pin
vijju0413-Jul-09 8:04
vijju0413-Jul-09 8:04 
AnswerRe: decimal value being truncated when exporting data to excel from asp.net c# Pin
Christian Graus13-Jul-09 8:26
protectorChristian Graus13-Jul-09 8:26 
AnswerRe: decimal value being truncated when exporting data to excel from asp.net c# Pin
paas13-Jul-09 8:33
paas13-Jul-09 8:33 
GeneralRe: decimal value being truncated when exporting data to excel from asp.net c# Pin
vijju0415-Jul-09 8:28
vijju0415-Jul-09 8:28 
AnswerRe: decimal value being truncated when exporting data to excel from asp.net c# Pin
PIEBALDconsult13-Jul-09 8:41
mvePIEBALDconsult13-Jul-09 8:41 
GeneralRe: decimal value being truncated when exporting data to excel from asp.net c# Pin
vijju0415-Jul-09 8:31
vijju0415-Jul-09 8:31 
QuestionSearching in XML Pin
zeeShan anSari13-Jul-09 7:56
zeeShan anSari13-Jul-09 7:56 
AnswerRe: Searching in XML Pin
PIEBALDconsult13-Jul-09 8:18
mvePIEBALDconsult13-Jul-09 8:18 
AnswerRe: Searching in XML Pin
Not Active13-Jul-09 8:19
mentorNot Active13-Jul-09 8:19 
AnswerRe: Searching in XML Pin
0x3c013-Jul-09 8:43
0x3c013-Jul-09 8:43 
GeneralRe: Searching in XML Pin
Not Active13-Jul-09 10:19
mentorNot Active13-Jul-09 10:19 
GeneralRe: Searching in XML Pin
0x3c013-Jul-09 19:54
0x3c013-Jul-09 19:54 
QuestionUnmanaged DLL: C# variable for C++ char** Pin
belier113-Jul-09 7:06
belier113-Jul-09 7:06 
AnswerRe: Unmanaged DLL: C# variable for C++ char** Pin
Luc Pattyn13-Jul-09 7:28
sitebuilderLuc Pattyn13-Jul-09 7:28 
Hi,

when mixing managed code and unmanaged/native code, I recommend you let the managed side do the array allocations (so they are real objects); doing so, all you need is one of two things:

1. the fixed keyword, which is OK if the array is used natively only while the native function executes; here the P/Invoke prototype takes a pointer where the native code expects a pointer.

2. the GCHandle class, which allows you to:
- pin the object, so the GC can no longer move it around
- get a pointer to it
- pass that pointer to the native function
- when done, free the GCHandle object.
Here the P/Invoke prototype takes an IntPtr where the native code expects a pointer.

BTW: for strings, there are easy shortcuts:
- read-only strings can be passed as string and accepted as char*
- read/write strings can be passed as StringBuilder (call ToString when done)

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: Unmanaged DLL: C# variable for C++ char** Pin
belier113-Jul-09 9:47
belier113-Jul-09 9:47 
GeneralRe: Unmanaged DLL: C# variable for C++ char** Pin
Luc Pattyn13-Jul-09 10:04
sitebuilderLuc Pattyn13-Jul-09 10:04 
GeneralRe: Unmanaged DLL: C# variable for C++ char** Pin
belier113-Jul-09 11:07
belier113-Jul-09 11:07 
GeneralRe: Unmanaged DLL: C# variable for C++ char** Pin
Luc Pattyn13-Jul-09 11:12
sitebuilderLuc Pattyn13-Jul-09 11:12 
GeneralRe: Unmanaged DLL: C# variable for C++ char** Pin
belier114-Jul-09 1:10
belier114-Jul-09 1:10 
QuestionGet local groups and users from server remotely with console app Pin
briancollins3213-Jul-09 6:50
briancollins3213-Jul-09 6:50 

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.