Click here to Skip to main content
16,005,316 members
Home / Discussions / C#
   

C#

 
GeneralRe: putting an img... Pin
leppie1-Mar-03 6:17
leppie1-Mar-03 6:17 
GeneralButton events gets deleted! Pin
mirano1-Mar-03 1:35
mirano1-Mar-03 1:35 
GeneralRe: Button events gets deleted! Pin
James T. Johnson1-Mar-03 1:46
James T. Johnson1-Mar-03 1:46 
GeneralRe: Button events gets deleted! Pin
JProd1-Mar-03 18:42
JProd1-Mar-03 18:42 
GeneralAgain : How to save the TreeView Pin
j-hannemann28-Feb-03 22:35
j-hannemann28-Feb-03 22:35 
GeneralRe: Again : How to save the TreeView Pin
leppie28-Feb-03 23:20
leppie28-Feb-03 23:20 
GeneralRe: Again : How to save the TreeView Pin
j-hannemann2-Mar-03 10:29
j-hannemann2-Mar-03 10:29 
GeneralUnmanaged Callback Pin
leppie28-Feb-03 11:43
leppie28-Feb-03 11:43 
Hi

I have a problem with an unmanaged callback. First the C API.
BOOL CALLBACK YourRecordProc(
    void *buffer,
    DWORD length,
    DWORD user
);
...
//and an example
DWORD CALLBACK MyRecordingWriter(void *buf, DWORD len, DWORD user) {
    fwrite(buf,1,len,file); // write the buffer to the file
    return TRUE; // continue recording
In C# I define:
public unsafe delegate int UnsafeRecordCallBack(void* pbuffer, int length, int user);
And the callback function:
private unsafe int UnsafeProgress(void* buffer, int length, int user)
{
   //the callback get called from another thread
   //length in bytes is usually 18000-20000
   Trace.WriteLine(++COUNT, "caLLBACK count");
   return 1; //0 false, all others true
}
Now I debug this with native debugging set as well and this happens:
caLLBACK count: 1
caLLBACK count: 2
caLLBACK count: 3
caLLBACK count: 4
caLLBACK count: 5
caLLBACK count: 6
First-chance exception at 0x001b67b6 in RecordTest.exe: 0xC0000096: Privileged instruction.
Unhandled exception at 0x001b67b6 in RecordTest.exe: 0xC0000096: Privileged instruction.

Like WTF Confused | :confused: Unsure | :~ Dead | X| Eek! | :eek: WTF | :WTF: Eisha. Any suggestions? What Win32 Thread of the 2 zillion is the culprit? How can I trace what is happening here? It appears to crash quicker if I move my mouse.

I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
GeneralRe: Unmanaged Callback Pin
Stephane Rodriguez.28-Feb-03 20:05
Stephane Rodriguez.28-Feb-03 20:05 
GeneralRe: Unmanaged Callback Pin
leppie28-Feb-03 22:11
leppie28-Feb-03 22:11 
GeneralRe: Unmanaged Callback Pin
Stephane Rodriguez.28-Feb-03 22:29
Stephane Rodriguez.28-Feb-03 22:29 
GeneralRe: Unmanaged Callback Pin
leppie28-Feb-03 22:48
leppie28-Feb-03 22:48 
GeneralRe: Unmanaged Callback Pin
leppie1-Mar-03 6:44
leppie1-Mar-03 6:44 
GeneralRe: Unmanaged Callback Pin
Stephane Rodriguez.1-Mar-03 10:46
Stephane Rodriguez.1-Mar-03 10:46 
GeneralRe: Unmanaged Callback Pin
leppie1-Mar-03 11:26
leppie1-Mar-03 11:26 
GeneralRegular Expression question Pin
chronobyte28-Feb-03 10:38
chronobyte28-Feb-03 10:38 
GeneralRe: Regular Expression question Pin
Daniel Turini28-Feb-03 11:11
Daniel Turini28-Feb-03 11:11 
GeneralRe: Regular Expression question Pin
chronobyte1-Mar-03 7:14
chronobyte1-Mar-03 7:14 
GeneralRe: Regular Expression question Pin
Domenic Denicola1-Mar-03 11:17
Domenic Denicola1-Mar-03 11:17 
GeneralRe: Regular Expression question Pin
Daniel Turini2-Mar-03 2:47
Daniel Turini2-Mar-03 2:47 
GeneralSaving Treeview/Listview selections Pin
vlusardi28-Feb-03 10:06
vlusardi28-Feb-03 10:06 
GeneralRe: Saving Treeview/Listview selections Pin
Stephane Rodriguez.28-Feb-03 20:22
Stephane Rodriguez.28-Feb-03 20:22 
GeneralAdding MDAC and .net framework redistribution to an application. Pin
Anonymous28-Feb-03 9:58
Anonymous28-Feb-03 9:58 
GeneralRe: Adding MDAC and .net framework redistribution to an application. Pin
Stephane Rodriguez.28-Feb-03 20:15
Stephane Rodriguez.28-Feb-03 20:15 
GeneralOwnerDraw TreeView: OnPaint(...) Pin
STW28-Feb-03 4:49
STW28-Feb-03 4:49 

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.