Article View: borland.public.cppbuilder.multimedia
Article #269Access Violation?!
From: Juampi David
Date: Thu, 23 Dec 2004 16:01
Date: Thu, 23 Dec 2004 16:01
45 lines
2333 bytes
2333 bytes
Hello! ... I'm workin' with DES on C++ Builder 5. When I try to change MediaSubType of one Video Group appears this "fatal error" messange: Project Projecto1.exe raised exception class EAccessViolation with messange 'Access violation at adress BAADF00D. Read of address BAADF00D'. Process stoped. Use Step or Run to continue. This is the Code: AM_MEDIA_TYPE mtGroup; mtGroup.majortype = MEDIATYPE_Video; mtGroup.subtype = MEDIASUBTYPE_RGB555; mtGroup.pbFormat = (BYTE*)CoTaskMemAlloc(sizeof(VIDEOINFOHEADER)); VIDEOINFOHEADER *pVideoHeader = (VIDEOINFOHEADER*)mtGroup.pbFormat; ZeroMemory(pVideoHeader, sizeof(VIDEOINFOHEADER)); pVideoHeader->bmiHeader.biBitCount = 16; pVideoHeader->bmiHeader.biWidth = 320; pVideoHeader->bmiHeader.biHeight = 240; pVideoHeader->bmiHeader.biPlanes = 1; pVideoHeader->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); pVideoHeader->bmiHeader.biSizeImage = DIBSIZE(pVideoHeader->bmiHeader); mtGroup.formattype = FORMAT_VideoInfo; mtGroup.cbFormat = sizeof(VIDEOINFOHEADER); mtGroup.bFixedSizeSamples = TRUE; mtGroup.lSampleSize = DIBSIZE(pVideoHeader->bmiHeader); IAMTimelineGroup *pGroup; pGroup->SetMediaType(&mtGroup); CoTaskMemFree(mtGroup.pbFormat); And the error appears when I add this line: pGroup->SetMediaType(&mtGroup); Could anyone explain me why this error appears?!!? Thanks!!! Juampi David
Technical Details
Message-ID:
<41caebfa@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10d0fc,83d0bed4519bc3d4,start X-Google-Attributes: gid10d0fc,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Juampi David" <multimedia@mdpsistemas.com.ar> From: "Juampi David" <multimedia@mdpsistemas.com.ar> Newsgroups: borland.public.cppbuilder.multimedia Subject: Access Violation?! Date: Thu, 23 Dec 2004 13:01:53 -0300 Lines: 47 Organization: MDP Sistemas Digitales X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 201.255.87.117 Message-ID: <41caebfa@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1103817722 201.255.87.117 (23 Dec 2004 08:02:02 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail