Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
GeneralRe: display image from SQL Server into Picture control Pin
Xmen Real 15-Mar-09 15:36
professional Xmen Real 15-Mar-09 15:36 
QuestionDynamic buttons in flowlayout panel Pin
Jon Henry14-Mar-09 7:08
Jon Henry14-Mar-09 7:08 
AnswerRe: Dynamic buttons in flowlayout panel Pin
N a v a n e e t h14-Mar-09 7:42
N a v a n e e t h14-Mar-09 7:42 
GeneralRe: Dynamic buttons in flowlayout panel Pin
Jon Henry14-Mar-09 7:59
Jon Henry14-Mar-09 7:59 
QuestionMS remote for Media Player Pin
electriac14-Mar-09 6:29
electriac14-Mar-09 6:29 
QuestionFormat date to system timezone Pin
Tony Pottier14-Mar-09 6:24
Tony Pottier14-Mar-09 6:24 
AnswerRe: Format date to system timezone Pin
Christian Graus14-Mar-09 8:15
protectorChristian Graus14-Mar-09 8:15 
QuestionPInvoke void * parameter Pin
Jason McPeak14-Mar-09 5:32
Jason McPeak14-Mar-09 5:32 
Here is the unmanged definition:

//============================================================================
// DcamCapture()
// Start to acquire one image from the camera.
// ---------------------------------------------------------------------------
// [Argument]
// pImageBuff : /O: Specify the start address in the buffer where image
// data is to be stored.
// nBuffSize :I/ : Specify the buffer size (number of bytes).
// [Return values]
// If the function succeeds the return value is TRUE (1).
// If the function fails the return value is FALSE (0).
// To obtain detailed error information, use the DcamGetLastError function.
// [Note]
// 1. This function issues an instruction to start image acquisition.
// Since image acquisition is not complete even when this function ends,
// use the DcamWait function to check whether image acquisition is complete.
// 2. The necessary buffer size can be obtained with the DcamGetFrameBytes function.
//============================================================================
_DCAMLIBEXPORT BOOL _DCAMLIBSTDCALL DcamCapture( LPVOID pImageBuff, INT nBuffSize );


Here is my C# code which does not work:

class DCamLIB
{
private IntPtr ImageBuffer;

public DCamLIB()
{
ImageBuffer = new IntPtr( 0 );
}

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

public void Capture( Int32 bufferSize )
{
if ( !DcamCapture( out ImageBuffer, bufferSize ) )
{
throw new DCamLIBException( this );
}
}
}

No matter what ImageBuffer = 0.

Ideas?
AnswerRe: PInvoke void * parameter Pin
Luc Pattyn14-Mar-09 5:56
sitebuilderLuc Pattyn14-Mar-09 5:56 
GeneralRe: PInvoke void * parameter Pin
Jason McPeak14-Mar-09 7:02
Jason McPeak14-Mar-09 7:02 
GeneralRe: PInvoke void * parameter Pin
Luc Pattyn14-Mar-09 7:30
sitebuilderLuc Pattyn14-Mar-09 7:30 
GeneralRe: PInvoke void * parameter Pin
Jason McPeak14-Mar-09 8:16
Jason McPeak14-Mar-09 8:16 
GeneralRe: PInvoke void * parameter Pin
Luc Pattyn14-Mar-09 9:10
sitebuilderLuc Pattyn14-Mar-09 9:10 
GeneralRe: PInvoke void * parameter Pin
Jason McPeak14-Mar-09 14:10
Jason McPeak14-Mar-09 14:10 
GeneralRe: PInvoke void * parameter Pin
Luc Pattyn14-Mar-09 16:01
sitebuilderLuc Pattyn14-Mar-09 16:01 
AnswerRe: PInvoke void * parameter Pin
Jason McPeak14-Mar-09 7:12
Jason McPeak14-Mar-09 7:12 
QuestionCan not submit to the server. [modified] Pin
sohighthesky14-Mar-09 5:21
sohighthesky14-Mar-09 5:21 
AnswerRe: Can not submit to the server. Pin
Xmen Real 14-Mar-09 5:56
professional Xmen Real 14-Mar-09 5:56 
AnswerRe: Can not submit to the server. Pin
Navneet Hegde14-Mar-09 8:53
Navneet Hegde14-Mar-09 8:53 
QuestionHow to execute Class without Main? [modified] Pin
Akash Chavhan14-Mar-09 5:19
Akash Chavhan14-Mar-09 5:19 
AnswerRe: How to execute Class without Main? [modified] Pin
Eslam Afifi14-Mar-09 5:51
Eslam Afifi14-Mar-09 5:51 
AnswerRe: How to execute Class without Main? Pin
Xmen Real 14-Mar-09 5:53
professional Xmen Real 14-Mar-09 5:53 
AnswerRe: How to execute Class without Main? Pin
Christian Graus14-Mar-09 8:18
protectorChristian Graus14-Mar-09 8:18 
AnswerRe: How to execute Class without Main? Pin
PIEBALDconsult14-Mar-09 15:00
mvePIEBALDconsult14-Mar-09 15:00 
QuestionSockets in C# Pin
mrithula814-Mar-09 4:42
mrithula814-Mar-09 4:42 

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.