Click here to Skip to main content
15,919,245 members
Home / Discussions / C#
   

C#

 
AnswerRe: Still stuck: Button, Numeric UpDown, and Paint Event Pin
Judah Gabriel Himango28-Nov-05 7:34
sponsorJudah Gabriel Himango28-Nov-05 7:34 
GeneralRe: Still stuck: Button, Numeric UpDown, and Paint Event Pin
...---...28-Nov-05 13:14
...---...28-Nov-05 13:14 
QuestionCreating custom control.. dunno how to create click event Pin
2hdass28-Nov-05 6:10
2hdass28-Nov-05 6:10 
AnswerRe: Creating custom control.. dunno how to create click event Pin
Judah Gabriel Himango28-Nov-05 7:37
sponsorJudah Gabriel Himango28-Nov-05 7:37 
AnswerRe: Creating custom control.. dunno how to create click event Pin
Darryl Borden28-Nov-05 11:51
Darryl Borden28-Nov-05 11:51 
Questionerror Pin
papa198028-Nov-05 5:59
papa198028-Nov-05 5:59 
AnswerRe: error Pin
Judah Gabriel Himango28-Nov-05 7:39
sponsorJudah Gabriel Himango28-Nov-05 7:39 
Questionvoid pointers and buffers Pin
sjdevo3gsr28-Nov-05 5:56
sjdevo3gsr28-Nov-05 5:56 
I'm still interfacing to an unmanaged C++ camera library with this code
typedef struct<br />
{<br />
    void* pBuffer;<br />
    unsigned long bufferSize;<br />
} CamFrame;

In C++ all is have to do for varying bufferSize is
myCamFrame.pBuffer = new char[myCamFrame.bufferSize];
then later call
GetCameraFrame(camHandle,&myCamFrame);
In C# I have
[StructLayoutAttribute(LayoutKind.Explicit)]<br />
public struct CamFrame<br />
{<br />
    [FieldOffsetAttribute(0)]<br />
    private IntPtr pBuffer;<br />
    [FieldOffsetAttribute(4)]<br />
    private uint bufferSize;<br />
}<br />
and <br />
GetCameraFrame(IntPtr camHandle, ref MyCamFrame);<br />
<br />


What I can't work out is how to allocate the necessary buffer (e.g using byte[] ) and then get the void pointer. Some things I've tried compile but the call to GetCameraFrame goes off into la-la land somewhere. I suspect this related to marshalling.

Ideas anyone?


Stewart DIBBS
AnswerRe: void pointers and buffers Pin
leppie28-Nov-05 6:00
leppie28-Nov-05 6:00 
Questionproblem showing that a button's in focus Pin
melanieab28-Nov-05 5:24
melanieab28-Nov-05 5:24 
Questionautomate a login using AxWebBrowser Pin
mjmcinto28-Nov-05 4:34
mjmcinto28-Nov-05 4:34 
Questionget data from data set Pin
MffM28-Nov-05 4:31
MffM28-Nov-05 4:31 
AnswerRe: get data from data set Pin
Steve Maier28-Nov-05 4:40
professionalSteve Maier28-Nov-05 4:40 
Questionage = (byte)(generator.NextDouble() * 100 - 20); gives extremely high values Pin
ishlilith28-Nov-05 3:19
ishlilith28-Nov-05 3:19 
AnswerRe: age = (byte)(generator.NextDouble() * 100 - 20); gives extremely high values Pin
Guffa28-Nov-05 4:01
Guffa28-Nov-05 4:01 
GeneralRe: age = (byte)(generator.NextDouble() * 100 - 20); gives extremely high values Pin
ishlilith28-Nov-05 4:18
ishlilith28-Nov-05 4:18 
AnswerRe: age = (byte)(generator.NextDouble() * 100 - 20); gives extremely high values Pin
Michael Potter28-Nov-05 4:02
Michael Potter28-Nov-05 4:02 
GeneralRe: age = (byte)(generator.NextDouble() * 100 - 20); gives extremely high values Pin
Steve Maier28-Nov-05 5:16
professionalSteve Maier28-Nov-05 5:16 
QuestioneRROR AND HOW TO RAPAIR IT Pin
papa198028-Nov-05 2:51
papa198028-Nov-05 2:51 
AnswerRe: eRROR AND HOW TO RAPAIR IT Pin
Stanciu Vlad28-Nov-05 4:47
Stanciu Vlad28-Nov-05 4:47 
GeneralRe: eRROR AND HOW TO RAPAIR IT Pin
papa198028-Nov-05 5:22
papa198028-Nov-05 5:22 
AnswerRe: eRROR AND HOW TO RAPAIR IT Pin
leppie28-Nov-05 5:57
leppie28-Nov-05 5:57 
GeneralRe: eRROR AND HOW TO RAPAIR IT Pin
papa198028-Nov-05 6:09
papa198028-Nov-05 6:09 
GeneralRe: eRROR AND HOW TO RAPAIR IT Pin
leppie28-Nov-05 6:20
leppie28-Nov-05 6:20 
GeneralRe: eRROR AND HOW TO RAPAIR IT Pin
Stanciu Vlad28-Nov-05 6:37
Stanciu Vlad28-Nov-05 6:37 

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.