Click here to Skip to main content
15,901,505 members
Home / Discussions / C#
   

C#

 
GeneralRe: load images dynamically in to sysetem resourses Pin
Not Active21-Oct-09 4:05
mentorNot Active21-Oct-09 4:05 
GeneralRe: load images dynamically in to sysetem resourses Pin
Zap-Man21-Oct-09 4:42
Zap-Man21-Oct-09 4:42 
GeneralRe: load images dynamically in to sysetem resourses Pin
Not Active21-Oct-09 4:52
mentorNot Active21-Oct-09 4:52 
GeneralRe: load images dynamically in to sysetem resourses Pin
Zap-Man21-Oct-09 5:05
Zap-Man21-Oct-09 5:05 
GeneralRe: load images dynamically in to sysetem resourses Pin
Not Active21-Oct-09 5:19
mentorNot Active21-Oct-09 5:19 
GeneralRe: load images dynamically in to sysetem resourses Pin
Zap-Man22-Oct-09 7:29
Zap-Man22-Oct-09 7:29 
Questionushort* to IntPtr conversion Pin
Jason McPeak20-Oct-09 12:38
Jason McPeak20-Oct-09 12:38 
AnswerRe: ushort* to IntPtr conversion [modified] Pin
Richard Andrew x6420-Oct-09 12:58
professionalRichard Andrew x6420-Oct-09 12:58 
This is what you would do:

[DllImport( "DCamLIB.dll" )]private unsafe static extern bool DcamCapture( IntPtr imageBuffer, Int32 bufferSize );


IntPtr ShortVariable = Marshal.AllocHGlobal(4);

DcamCapture( ShortVariable, bufferSize );

Int16 Result = Marshal.ReadInt16( ShortVariable );


Hope this helps!

EDIT: I may not have gotten your scenario correct, but the concepts are the same. You declare the external function with IntPtr's, and pass IntPtr's. And you use the Marshal class to allocate and read from or write to unmanaged memory.

modified on Tuesday, October 20, 2009 7:07 PM

AnswerRe: ushort* to IntPtr conversion Pin
Luc Pattyn20-Oct-09 13:56
sitebuilderLuc Pattyn20-Oct-09 13:56 
GeneralRe: ushort* to IntPtr conversion Pin
Jason McPeak20-Oct-09 14:34
Jason McPeak20-Oct-09 14:34 
GeneralRe: ushort* to IntPtr conversion Pin
Jason McPeak21-Oct-09 3:29
Jason McPeak21-Oct-09 3:29 
GeneralRe: ushort* to IntPtr conversion Pin
Luc Pattyn21-Oct-09 3:51
sitebuilderLuc Pattyn21-Oct-09 3:51 
QuestionPassing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 12:24
JollyMansArt20-Oct-09 12:24 
QuestionRe: Passing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 12:29
JollyMansArt20-Oct-09 12:29 
AnswerRe: Passing List to form and back... Help plz. Pin
Christian Graus20-Oct-09 13:01
protectorChristian Graus20-Oct-09 13:01 
QuestionRe: Passing List to form and back... Help plz. [modified] Pin
JollyMansArt20-Oct-09 13:07
JollyMansArt20-Oct-09 13:07 
AnswerRe: Passing List to form and back... Help plz. Pin
Christian Graus20-Oct-09 13:24
protectorChristian Graus20-Oct-09 13:24 
GeneralRe: Passing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 13:38
JollyMansArt20-Oct-09 13:38 
AnswerRe: Passing List to form and back... Help plz. Pin
Luc Pattyn20-Oct-09 14:03
sitebuilderLuc Pattyn20-Oct-09 14:03 
GeneralRe: Passing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 14:14
JollyMansArt20-Oct-09 14:14 
QuestionRe: Passing List to form and back... Help plz. [modified] Pin
JollyMansArt20-Oct-09 14:19
JollyMansArt20-Oct-09 14:19 
QuestionRe: Passing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 14:23
JollyMansArt20-Oct-09 14:23 
QuestionRe: Passing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 14:20
JollyMansArt20-Oct-09 14:20 
AnswerRe: Passing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 14:42
JollyMansArt20-Oct-09 14:42 
GeneralRe: Passing List to form and back... Help plz. Pin
Luc Pattyn20-Oct-09 14:32
sitebuilderLuc Pattyn20-Oct-09 14:32 

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.