home *** CD-ROM | disk | FTP | other *** search
- Path: s018h09.vse.cz!xvojm10
- From: xvojm10@vse.cz (Vojan Michal - SE,,student,UID=22358)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Datatypes problem
- Date: Wed, 17 Jan 1996 19:40:09 GMT
- Organization: University of Economy, Prague
- Message-ID: <xvojm10.3.30FD5099@vse.cz>
- NNTP-Posting-Host: s018h09.vse.cz
-
- I've got such a little problem with datatypes.
- Here's part of the source:
-
-
- void ReadPicture( STRPTR file )
- {
-
- Object *dto;
- struct DataType *dt = NULL;
- struct BitMap *bm = NULL;
- BPTR lock;
-
-
- if (lock = Lock(file, ACCESS_READ))
- {
- if (dt = ObtainDataType( DTST_FILE, lock, TAG_DONE))
- {
- if (dto = NewDTObject( file, DTA_DataType, dt, ..., TAG_DONE))
- {
-
-
- /*When here is some function ( I had AddDTObject here) that doesn't work
- with bm the bm was changed to random address from some strange reason. */
-
-
-
- GetDTAttrs( dto, PDTA_BitMap, &bm, PDTA_scrmode, &scrmode,
-
- TAG_DONE);
-
-
- /* Here I get correct BitMap pointer */
-
- depth = bm->Depth;
-
- .
- .
- .
- .
-
- }
-
-
- When I'm debugging it, GetDTAttrs returns pointer to BitMap but when
- running it returns NULL.
- Is there just some stupid error?
-
-
- Second question: where can I get some examples on datatypes. I've got just
- Autodoc and some includes and all I learned is from it.
-
- Thanks Michal
-
- P.S. You can also reply to michy@bajt.cz .
-