| Home | Previous Lesson: Saving the OLE Control as Another File Next Lesson: Getting Image From the Database To OLE Control |
Calling LinkTo() allows you to link the OLE object to another object.
String lFileNameWithFullPath, lFileName
Integer lResult
lResult = GetFileOpenName( "Select Document to " + &
"link from OLE Control", + &
lFileNameWithFullPath, lFileName, "Doc", &
"Documents (*.doc), *.doc" )
If lResult <> 1 Then Return
lResult = ole_1.LinkTo( lFileNameWithFullPath )
If lResult <> 0 Then
MessageBox( "File Link Error", lResult )
Return -1000
End If
To see it in the action, run the application. Select 'Module > OLE Control Examples' menu option. Open a OLE Storage file in the OLE Control by clicking on the Open SubStorage CommandButton and click on the Link CommandButton.
| Home | Previous Lesson: Saving the OLE Control as Another File Next Lesson: Getting Image From the Database To OLE Control |