Double-Clicking on a document's icon will now open the app

// Once all that is done, then we'll be able to get this event via a Finder drag and drop.
  //  We instantiate the main window implicitly,

  Dim f as FolderItem
  Dim w as TextWindow
  w=New TextWindow //create new instance of TextWindow

'Double-Clicking on a document's icon will now open an empty document of our app

  'So far so good

// and pass the folder item to the same call that the main window uses when we drag a file to it directly.
  ' And here is where the problem lies  —

  f.OpenStyledEditField w.TextField
  w.Document=f  //assign f to document property of TextWindow
  w.title=f.Name  //assign name of f to Title property of w

 ‘An exception of class NilObjectException was not handled.
 'The application must shut down.


Yes, f is nil at this point. Use GetFolderItem or whatever to instantiate a folderitem. OpenStyledEditField is a method of FolderItem, ie., it doesn't return a folderitem. So you need to create the folder item before calling it.

Best,

Jack_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to