Click here to Skip to main content
15,912,977 members
Home / Discussions / C#
   

C#

 
GeneralInterfaces? Pin
mike montagne4-Feb-07 20:17
mike montagne4-Feb-07 20:17 
GeneralRe: Nested struct or Object property of a component? Pin
mike montagne5-Feb-07 17:51
mike montagne5-Feb-07 17:51 
AnswerRe: Nested struct or Object property of a component? Pin
Martin#4-Feb-07 22:51
Martin#4-Feb-07 22:51 
GeneralRe: Nested struct or Object property of a component? Pin
mike montagne5-Feb-07 10:29
mike montagne5-Feb-07 10:29 
GeneralRe: Nested struct or Object property of a component? Pin
mike montagne5-Feb-07 10:38
mike montagne5-Feb-07 10:38 
GeneralPreFilterProperties should not be relevant (?) Pin
mike montagne5-Feb-07 10:52
mike montagne5-Feb-07 10:52 
QuestiondataGrid dataset Pin
123456uio4-Feb-07 8:54
123456uio4-Feb-07 8:54 
QuestionSomewhat new to C#... Pin
JeremyLM4-Feb-07 8:04
JeremyLM4-Feb-07 8:04 
but a long time C/C++ programmer. I've ran in to a bit of a spot that I just can't seem to get a grasp on.

I have a callback in a C++ unmanaged DLL that I've written:
LRESULT CALLBACK eventListener(HWND hWnd, UINT msg, WPARAM wP, LPARAM lP)
{
switch(msg)
{
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hDc = BeginPaint(GetFocus(), &ps);

if(g_currVideo != NULL)
{
const VideoFrame& currFrame = g_frames[g_currentFrame].frame;

BITMAPINFO bi;
ZeroMemory(&bi, sizeof(bi));
bi.bmiHeader.biSize = sizeof(bi);
bi.bmiHeader.biWidth = currFrame.getWidth();
bi.bmiHeader.biHeight = currFrame.getHeight();
bi.bmiHeader.biPlanes = 1;
bi.bmiHeader.biBitCount = 24;

SetDIBitsToDevice(hDc, 0, 0, currFrame.getWidth(), currFrame.getHeight(),
0, 0, 0, currFrame.getHeight(), currFrame.getData(), &bi, DIB_RGB_COLORS);
}

EndPaint(GetFocus(), &ps);
return 0;
}break;
...
}

In C++, I would have no problem calling this, however, I am lost when it comes to doing it in C#.
The DLL in question relies on the callback to load and play back frames and samples of an uncommon video format.

In C#, I'm able to get it as far as loading that first frame and audio sample, however, without the callback, that's as far as I can go.

My question is how would I implement use of this callback this in C#?
AnswerRe: Somewhat new to C#... Pin
Christian Graus4-Feb-07 9:14
protectorChristian Graus4-Feb-07 9:14 
QuestionDataGridView virtual mode how to? Pin
SeMartens4-Feb-07 6:58
SeMartens4-Feb-07 6:58 
QuestionChange control properties from dll Pin
AceC0d3r4-Feb-07 6:57
AceC0d3r4-Feb-07 6:57 
AnswerRe: Change control properties from dll Pin
Dave Kreskowiak4-Feb-07 11:02
mveDave Kreskowiak4-Feb-07 11:02 
GeneralRe: Change control properties from dll Pin
AceC0d3r4-Feb-07 11:12
AceC0d3r4-Feb-07 11:12 
GeneralRe: Change control properties from dll Pin
Colin Angus Mackay4-Feb-07 14:12
Colin Angus Mackay4-Feb-07 14:12 
QuestionFloating Images Pin
dsl/fahk4-Feb-07 6:46
dsl/fahk4-Feb-07 6:46 
AnswerRe: Floating Images Pin
Christian Graus4-Feb-07 9:18
protectorChristian Graus4-Feb-07 9:18 
QuestionNewbie code problem please help? Pin
Wolf924-Feb-07 4:04
Wolf924-Feb-07 4:04 
AnswerRe: Newbie code problem please help? Pin
Colin Angus Mackay4-Feb-07 5:35
Colin Angus Mackay4-Feb-07 5:35 
AnswerRe: Newbie code problem please help? Pin
Ravi Bhavnani4-Feb-07 5:37
professionalRavi Bhavnani4-Feb-07 5:37 
QuestionDLLimport Problem Pin
snouto4-Feb-07 3:44
snouto4-Feb-07 3:44 
AnswerRe: DLLimport Problem Pin
Colin Angus Mackay4-Feb-07 4:04
Colin Angus Mackay4-Feb-07 4:04 
QuestionGuid as a Stored Proc parameter Pin
Ryno Burger4-Feb-07 3:42
Ryno Burger4-Feb-07 3:42 
AnswerRe: Guid as a Stored Proc parameter Pin
Colin Angus Mackay4-Feb-07 3:55
Colin Angus Mackay4-Feb-07 3:55 
QuestionCopying part of byte array to another byte array Pin
yarns4-Feb-07 2:00
yarns4-Feb-07 2:00 
AnswerRe: Copying part of byte array to another byte array Pin
Stefan Troschuetz4-Feb-07 2:55
Stefan Troschuetz4-Feb-07 2:55 

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.