Hi ,

   Thanks for The suggestions given to HTML viewer.

   In an application, I tried to display a text  in a window resource, but
each time it diplayed some garbage.

    Code used in the program to retrieve a record and display it on a window
is given below .
CurrentRecord  always has value 0 ( for test purpose ) .

Code :

if (CurrentRecord != noRecordSelected && DmNumRecords(TestDB) > 0) {
     // Get a handle for the first record.
     recHandle = DmGetRecord(TestDB,CurrentRecord);

     #ifdef saveForReference
        // Lock down the handle and get a pointer to the record data.
       recText = MemHandleLock(recHandle);

      // Allocate a new memory chunk that will contain a copy of the data.
     newHandle = MemHandleNew(StrLen(recText) + 1);

     // Lock down the handle and get a pointer to the memory chunk.
     newText = MemHandleLock(newHandle);

     StrCopy(newText,recText);
    // Unlock the new memory chunk.
    MemHandleUnlock(newHandle);

    // Unlock the database record.
    MemHandleUnlock(recHandle);

    // Release the record to the database system.
    // (The zero means that the record data hasn't been changed.)
    DmReleaseRecord(TestDB, CurrentRecord, 0);

  #endif

  FntSetFont(stdFont);
  WinSetUnderlineMode(noUnderline);
  WinDrawChars(testTxt,20,bounds.topLeft.x,bounds.topLeft.y);

            I pass 20 as the length of the string , b'cos using StrLen
function retuns  zero.
testTxt  is a CharPtr .

Do I have to do any conversion of the data got from the record , before
being displayed ?
Pl. suggest a better method if any.

TIA ,

  Alagesh
  mail : [EMAIL PROTECTED]




--------------------------------------------------------------
Robosoft Technologies, Mangalore, India

Reply via email to