Hi! Using PB 4.2 and eVC on a Geode platform. I have
created simple app in eVC, which create new file on a HDD
and write some buffers into:

char buf[50000]; //BIG ENOUGH!!!
DWORD Written;
HANDLE f = CreateFile(L"\\Hard Disk\\myfile.txt",
GENERIC_WRITE | GENERIC_READ, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, 0);
DWORD Written;
if(f != INVALID_HANDLE_VALUE)
{
WriteFile(f, &buf[0], 500, &Written, NULL); //write 500
bytes
WriteFile(f, &buf[0], 600, &Written, NULL); //write 600
bytes
WriteFile(f, &buf[0], 700, &Written, NULL);
WriteFile(f, &buf[0], 800, &Written, NULL);
}
CloseHandle(f);

I debug my application, and see, that 500-byte buffer
writed OK, then 600-byte buffer.... 700... but when it
goes to 800-byte, system hangs up, HDD-led on a device
lights continiously, and PB throws message:

-----------------------------------
Runtime error in cemgr.exe
R6025
-pure virtual function call
-----------------------------------

Other buffer configuration give the same result, for
example 700, 800, 10000, last also hungs up.

I cant figure out what is wrong?? I'm not a newbie in
Win32 API and have used this function many times in
different apps (on a PC Windows). Everytime in works OK!

Release version of this app give the same result!

PLEASE HELP!!!

Re: Strange error writing buffers in file by Michael

Michael
Fri Dec 05 07:31:27 CST 2003

The problem is not in your app but in the debugger and/or communications
with the target device.

cemgr.exe is a desktop component that (among other things) manages
communications with the target device. The eVC debugger talks over it.
Sounds more like a bug in cemgr.exe than the debugger, but...

If your Geode platform is debug-enabled, you can debug using PB 4.2 kernel
debugger, though a breakpoint stops the entire system, not just your
application. If that's ok for your purposes, then I suggest using PB 4.2
debugger whenever possible - it's just a better debugger even for
application stuff (for example, eVC debugger can't trap exceptions and break
in DllMain).

Staying the eVC/cemgr.exe route, make sure you have the eVC service packs
installed (2 are available). You may also want to try different settings
for your connection (use eVC Tools\Configure Platform Manager...). You may
want to try a different transport than is currently configured.

Beyond that, check the MS knowledge base and/or report a bug to MS.

--

Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com


"HASH" <trafik@from.apollo.lv> wrote in message
news:d80201c3bb18$a4856280$a601280a@phx.gbl...
> Hi! Using PB 4.2 and eVC on a Geode platform. I have
> created simple app in eVC, which create new file on a HDD
> and write some buffers into:
>
> char buf[50000]; //BIG ENOUGH!!!
> DWORD Written;
> HANDLE f = CreateFile(L"\\Hard Disk\\myfile.txt",
> GENERIC_WRITE | GENERIC_READ, 0, NULL, CREATE_ALWAYS,
> FILE_ATTRIBUTE_NORMAL, 0);
> DWORD Written;
> if(f != INVALID_HANDLE_VALUE)
> {
> WriteFile(f, &buf[0], 500, &Written, NULL); //write 500
> bytes
> WriteFile(f, &buf[0], 600, &Written, NULL); //write 600
> bytes
> WriteFile(f, &buf[0], 700, &Written, NULL);
> WriteFile(f, &buf[0], 800, &Written, NULL);
> }
> CloseHandle(f);
>
> I debug my application, and see, that 500-byte buffer
> writed OK, then 600-byte buffer.... 700... but when it
> goes to 800-byte, system hangs up, HDD-led on a device
> lights continiously, and PB throws message:
>
> -----------------------------------
> Runtime error in cemgr.exe
> R6025
> -pure virtual function call
> -----------------------------------
>
> Other buffer configuration give the same result, for
> example 700, 800, 10000, last also hungs up.
>
> I cant figure out what is wrong?? I'm not a newbie in
> Win32 API and have used this function many times in
> different apps (on a PC Windows). Everytime in works OK!
>
> Release version of this app give the same result!
>