>From: David Fedor <[EMAIL PROTECTED]>
>Date: Mon, 31 Jan 2000 11:55:01 -0800
>>I have been accessing the screen variables directly...
>>...
>> winM = FrmGetWindowHandle(FrmGetActiveForm());
>> ptr = WinGetWindowPointer(winM)->displayAddrV20;
>> MemMove(&screenarray, ptr, 2000);
>First thing I notice: perhaps you didn't put it in your message, but PLEASE
>call ScrDisplayMode to find out if the screen is one-bit before you do
>this. You'll get very strange results if not. Second, make sure that winM
>and particularly ptr are nonzero. That's another very obvious way to fail.
>I imagine if you tried this on one of the color roms for 3.5 you'd see an
>immediate crash.
I set the screen to one bit mode at the opening of the form, so I
shouldn't need to check this in these routines. I did notice that 3.5
doesn't let us access the screen directly, which is why I'm fiddling
with this at all ;)
>Ok, that over with, what you should probably do instead is create an
>offscreen window, shove your data into it, and then use the standard
>WinCopyRectangle to move the data. The Signature sample shows how to
>create an offscreen window "by hand" and jam data into it.
I'm still having a problem with this- here is a simplified example of
what I did (this one just sets the memory to zero, whereas the real
one does some other steps afterwards):
WinHandle winM;
unsigned char *ptr;
WinHandle theWindowHandle;
Word theError;
theWindowHandle = WinCreateOffscreenWindow(160,
100, screenFormat, &theError );
if (!theError) {
MemSet((char *) theWindowHandle->gDeviceP->baseAddr, 2000, 0);
// 2000 = 160*100 / 8.
WinCopyRectangle(theWindowHandle, NULL, imagerect, 0, 0, scrCopy );
// Delete the window that we created with WinCreateOffscreenWindow
WinDeleteWindow( theWindowHandle, false );
}
Anyway, the program crashes with a bus error at the MemSet line. The
signature example uses the MemMove, so I know that the memory is not
protected. Why would this happen? Thanks in advance!
--
Thanks,
Dave Haupert
DDH Software, Inc
[EMAIL PROTECTED] http://www.ddhsoftware.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html