Harbour dialect error XS1510 A REF or OUT value must be an assignable variable
Posted: Wed Jun 21, 2023 2:30 am
Hello XSharp sleuths;
I have a library with common functions. In this case, I'm adding a function to send emails; my pervious post regarding using Outlook eened up 'working; but not as I had wanted; I wanted the email to be created in the Outlook user's 'Drafts' folder; I changed the code and have it working no problem in native c# .Net in VS. But then I tried to bringing it over to my Harbour dialect project and am getting error:
"XS1510 A REF or OUT value must be an assignable variable " on the line with in the code below. I'm assuming the issue is the 'folder' object I'm passing.
The project dialect is Harbour; I’ve added the following references:
XSharp.Core
XSharp.RT
Microsoft.Office.Interop.Outlook
I have:
Thanks for any tips.
I have a library with common functions. In this case, I'm adding a function to send emails; my pervious post regarding using Outlook eened up 'working; but not as I had wanted; I wanted the email to be created in the Outlook user's 'Drafts' folder; I changed the code and have it working no problem in native c# .Net in VS. But then I tried to bringing it over to my Harbour dialect project and am getting error:
"XS1510 A REF or OUT value must be an assignable variable " on the line with
Code: Select all
mail := (Outlook.MailItem)
oApp:CreateItemFromTemplate(@"E:AppsHarborClipperTargetDataTestsOutlookTemplatesMicheledefault.oft, folder)
The project dialect is Harbour; I’ve added the following references:
XSharp.Core
XSharp.RT
Microsoft.Office.Interop.Outlook
I have:
Code: Select all
using Outlook := Microsoft.Office.Interop.Outlook
using System.Runtime.InteropServices
FUNCTION SendEmail() AS VOID
LOCAL oApp AS Outlook.Application
oApp := Outlook.Application{}
LOCAL folder AS Outlook.Folder
folder := (Outlook.Folder) oApp:ActiveExplorer().Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderDrafts)
LOCAL mail AS Outlook.MailItem
mail := (Outlook.MailItem) oApp:CreateItemFromTemplate(@"E:AppsHarborClipperTargetDataTestsOutlookTemplatesMicheledefault.oft", folder)
mail:Subject := "testing 123"
RETURN