Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > OOP Powerplant for Mac > TXNFind Mlte
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 404 of 483
Post > Topic >>

TXNFind Mlte

by "vcmac" <projectleader@[EMAIL PROTECTED] > Jul 2, 2005 at 07:53 AM

I am using TXFind of MLTE for finding the text hello from TXNObject.
 If it finds the text I want to display Message Find.For that I have
written TXNFindPrc But It is not working eventhough word "hello" is
there.
 Follwing is the code.
 Pls suggest where I am wrong?




LMLTEPane *mltPane;
mltPane=dynamic_cast<LMLTEPane*>(theWindow->FindPaneByID(200));    
TXNObject txnobj;
txnobj=mltPane->GetTextObject();
 OSStatus stat;
TXNOffset * oStartMatchOffset=new TXNOffset;
TXNOffset * oEndMatchOffset=new TXNOffset;
TXNMatchTextRecord *record=new TXNMatchTextRecord;
  const char* text="hello";
record->iTextPtr=text;
 TXNFindUPP MyTXNFindUPP;
MyTXNFindUPP = NewTXNFindUPP (&MyFindCallback) ;
 record->iTextToMatchLength=strlen(text);
 record-> iTextEncoding=kTXNSystemDefaultEncoding;
TXNDataType type =    kTXNTextData;
  stat=TXNFind(txnobj,record,kTXNTextData,kTXNEntireWordMask
,kTXNStartOffset,kTXNEndOffset,MyTXNFindUPP,NULL,oStartMatchOffset,oEndMatchOffset);


////// Find Proc is as shown below 
pascal OSStatus MyFindCallback (
                                                    const
TXNMatchTextRecord * matchData,
                                                    TXNDataType
iDataType,
  					     TXNMatchOptions iMatchOptions,
   					     const void * iSearchTextPtr,
              				     TextEncoding encoding,
   					     TXNOffset absStartOffset,
   					     ByteCount searchTextLength,
  					    TXNOffset * oStartMatch,
   					    TXNOffset * oEndMatch,
   					    Boolean * ofound,
   					    UInt32 refCon
					)
{
StandardAlert(2,"\p Word Found",NULL,NULL,0);
}


////

-Hemant
 




 3 Posts in Topic:
TXNFind Mlte
"vcmac" <pro  2005-07-02 07:53:17 
Re: TXNFind Mlte
Ben Artin <macdev@[EMA  2005-07-02 12:17:03 
Re: TXNFind Mlte
David Phillip Oster <o  2005-07-03 07:24:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 19 23:45:48 CDT 2008.