Click here to Skip to main content
15,914,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generaldeveloping a ms-paint like application Pin
mayank3-Apr-01 17:16
mayank3-Apr-01 17:16 
GeneralRe: developing a ms-paint like application Pin
Christian Graus3-Apr-01 18:12
protectorChristian Graus3-Apr-01 18:12 
GeneralCString::ReleaseBuffer() Pin
3-Apr-01 16:52
suss3-Apr-01 16:52 
GeneralRe: CString::ReleaseBuffer() Pin
Michael Dunn3-Apr-01 18:39
sitebuilderMichael Dunn3-Apr-01 18:39 
GeneralRe: CString::ReleaseBuffer() Pin
Kannan Kalyanaraman3-Apr-01 20:44
Kannan Kalyanaraman3-Apr-01 20:44 
GeneralDEBUG vs. RELEASE Pin
Manfred Ramosch3-Apr-01 14:21
Manfred Ramosch3-Apr-01 14:21 
GeneralRe: DEBUG vs. RELEASE Pin
Christian Graus3-Apr-01 15:06
protectorChristian Graus3-Apr-01 15:06 
GeneralRe: DEBUG vs. RELEASE - closer description... Pin
Manfred Ramosch3-Apr-01 19:33
Manfred Ramosch3-Apr-01 19:33 
Thanks Chris - it's once again YOU to help me (try to) out of a problem.
OnPaint() is working now as it is supposed to...
Also thanks to all the other Gurus: 'Funky' Erik (Funkenbusch) and Lauren (I like the
colours of your homepage)...


The unhandled exception 0x00000005:Access Violation occurs in a WIN callback-function.
When I open some MIDI-Input with

midiInOpen(&hMidiIn, CurInDevice, (DWORD)MyCallback, NULL, CALLBACK_FUNCTION);
The 3rd parameter is the address of a callback-function which is called by the
Midi-Device-Driver everytime a MIDI-Event has arrived its input.

The callback works as follows:
void CALLBACK MyCallback(HMIDIIN hMidiIn, UINT wMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2)
{

int iResult;

switch(wMsg)
{

case MIM_DATA:
{
iResult = Zones->PostMessage(WM_MIDIEVENT);  //Zones is the Main-Window of my Dialog-based App
ASSERT(iResult);
break;
}

case MIM_MOREDATA: break;
case MIM_OPEN: break;
case MIM_CLOSE: break;

default:
ASSERT(0);

}
So the callback only posts a userdefined message

#define WM_MIDIEVENT   WM_USER+100
to my Dialog. The MessageMapEntry
ON_MESSAGE(WM_MIDIEVENT, OnMidiEvent)
is for now just a stub - doing nothing...
void CZones::OnMidiEvent()
{
}
When the first MIDI-Event arrives everything works fine, but as soon as the second
event drops in I may not move the mouse over the System-Menu or click the Dialog or move
over a checkbox in the dialog. As long as I don't move the mouse I can play as many notes
as I want...

BTW: When the Dialog is minimized everything works flawlessly too. But I only have to
right-click into the task-bar.....EHHHHHH

No context-menu for maximizing or closing - just my unhandled exception 0x00000005:ACCESS-VIOLATION


Any Ideas on that ?


The exception appears on two machines exactly at the same address.
In DEBUG-MODE everything works brilliant, no latency (MIDI-delays) no MIDI-drones (sounding
till you shut down your system) - no really professional...


Manfred

---

Programming is knowing...
GeneralCan anyone believe this...??? Pin
Manfred Ramosch4-Apr-01 5:24
Manfred Ramosch4-Apr-01 5:24 
GeneralRe: Can anyone believe this...??? Pin
Chris Losinger5-Apr-01 8:59
professionalChris Losinger5-Apr-01 8:59 
QuestionAre there performance issues(resource or otherwise) in using CStatic controls to display bitmaps? Pin
eric kaminski3-Apr-01 8:13
eric kaminski3-Apr-01 8:13 
GeneralUsing the system image list with CImageList Pin
3-Apr-01 8:09
suss3-Apr-01 8:09 
GeneralRe: Using the system image list with CImageList Pin
Michael Dunn3-Apr-01 8:46
sitebuilderMichael Dunn3-Apr-01 8:46 
GeneralRe: Using the system image list with CImageList Pin
3-Apr-01 9:43
suss3-Apr-01 9:43 
GeneralRe: Using the system image list with CImageList Pin
Michael Dunn3-Apr-01 12:59
sitebuilderMichael Dunn3-Apr-01 12:59 
QuestionHow to get the button click message ??? Pin
Vistac3-Apr-01 5:18
Vistac3-Apr-01 5:18 
AnswerRe: How to get the button click message ??? Pin
Masaaki Onishi3-Apr-01 6:18
Masaaki Onishi3-Apr-01 6:18 
GeneralRe: Hummmm. Pin
Masaaki Onishi3-Apr-01 16:35
Masaaki Onishi3-Apr-01 16:35 
AnswerRe: How to get the button click message ??? Pin
PJ Arends3-Apr-01 10:23
professionalPJ Arends3-Apr-01 10:23 
QuestionDirectX 8 information??? Pin
t_hamel3-Apr-01 5:17
t_hamel3-Apr-01 5:17 
GeneralLoading a Word Document Pin
3-Apr-01 3:38
suss3-Apr-01 3:38 
GeneralRe: Loading a Word Document Pin
Masaaki Onishi3-Apr-01 16:49
Masaaki Onishi3-Apr-01 16:49 
GeneralRe: Loading a Word Document Pin
3-Apr-01 23:13
suss3-Apr-01 23:13 
GeneralHostNames Pin
Furer Alexander3-Apr-01 3:24
Furer Alexander3-Apr-01 3:24 
GeneralRe: HostNames Pin
Anders Molin3-Apr-01 9:00
professionalAnders Molin3-Apr-01 9:00 

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.