Skip to main content
nguyend40624345
Inspiring
February 24, 2016
Answered

How to use CAlert to print an object.

  • February 24, 2016
  • 1 reply
  • 317 views

I have a code block as below:

InterfacePtr<ITextFocus> iSelectionTextFocus(iTextFocus, UseDefaultIID());

  if (iSelectionTextFocus != nil){

  focusStart = iSelectionTextFocus->GetStart(nil);

  }

  InterfacePtr<IGTTxtEdtSnapshotInterface> iGTTxtEdtSnapshotInterface(iDocument,UseDefaultIID());

  if (iGTTxtEdtSnapshotInterface == nil || focusStart == kInvalidTextIndex){

  break;

  }

  iGTTxtEdtSnapshotInterface->SetStoryAndIndex(storyUIDRef,focusStart);

  TRACEFLOW(kGTTxtEdtPluginName,"Text story observer range == %d\n", focusStart);

From the code, I want o print out "focusStart" using CAlert::InformationAlert. But I got error when trying to write a line like this:

CAlert::InformationAlert(focusStart);

How can I solve this problem?

Note: The code block is get from file "GTTxtEdtStoryObserver.cpp" in InDesgin SDK under project "gotolasttextedit".

Regards,

Dung Tri

This topic has been closed for replies.
Correct answer nguyend40624345

I have use these lines of code to do the stuff:

std::string tempString("Text has changed at index: ");

  std::string index(std::to_string(focusStart));

  PMString message(tempString.c_str());

  message.Append(index.c_str());

  CAlert::InformationAlert(message);

This issue has solved!

Regards,

Dung Tri

1 reply

nguyend40624345
nguyend40624345AuthorCorrect answer
Inspiring
February 24, 2016

I have use these lines of code to do the stuff:

std::string tempString("Text has changed at index: ");

  std::string index(std::to_string(focusStart));

  PMString message(tempString.c_str());

  message.Append(index.c_str());

  CAlert::InformationAlert(message);

This issue has solved!

Regards,

Dung Tri