<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I add a SAS editor control to my Custom Task for code preview in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1906#M634</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what i finally did. It's so simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should look your book more often.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank's any way&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Mar 2013 13:41:38 GMT</pubDate>
    <dc:creator>Victor</dc:creator>
    <dc:date>2013-03-07T13:41:38Z</dc:date>
    <item>
      <title>How do I add a SAS editor control to my Custom Task for code preview</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1895#M623</link>
      <description>Hi every one,&lt;BR /&gt;
&lt;BR /&gt;
I am building a custom Task, and I would like to add a SAS editor control for code preview in my task. What control should I use? I don’t want to use the .NET TextBox.&lt;BR /&gt;
&lt;BR /&gt;
(When I add SAS.EG.Controls.dll to my .NET project reference and to the ToolBox, many SAS-supplied controls such as SASDatasetSelector appear, but there is no SAS editor control).&lt;BR /&gt;
&lt;BR /&gt;
Thanks for any help,&lt;BR /&gt;
&lt;BR /&gt;
Maurice</description>
      <pubDate>Fri, 01 Dec 2006 20:25:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1895#M623</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-12-01T20:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a SAS editor control to my Custom Task for code preview</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1896#M624</link>
      <description>Maurice,&lt;BR /&gt;
&lt;BR /&gt;
In the examples on our web site at &lt;A href="http://support.sas.com/eguide" target="_blank"&gt;http://support.sas.com/eguide&lt;/A&gt;, there are a few tasks that show this.  For example, the "SAS Catalog Explorer" and the "Simple SAS Program Editor" use the enhanced editor.&lt;BR /&gt;
&lt;BR /&gt;
The key assemblies are SAS.AxInterop.EDITORCONTROLLib.dll and SAS.Interop.EDITORCONTROLLib.dll.&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
      <pubDate>Fri, 01 Dec 2006 21:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1896#M624</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2006-12-01T21:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a SAS editor control to my Custom Task for code preview</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1897#M625</link>
      <description>Thanks Chris,&lt;BR /&gt;
&lt;BR /&gt;
I downloaded the examples, AxInterop.EDITORCONTROLLib.dll and Interop.EDITORCONTROLLib.dll must be referenced.&lt;BR /&gt;
But unlike the controls in the SAS.EG.Controls.dll, it seems not possible to add the editor control on the toolbox so that it can be drag and dropped on the form (Error message: “There are no components in ‘C:\Program Files\SAS\Enterprise Guide 4\SAS.AxInterop.EDITORCONTROLLib.dll’ that can be placed on the toolbox.”)....&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Maurice</description>
      <pubDate>Tue, 05 Dec 2006 16:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1897#M625</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-12-05T16:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a SAS editor control to my Custom Task for code preview</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1898#M626</link>
      <description>In EG 4.1, the assemblies have the "SAS." prefix in their names.&lt;BR /&gt;
&lt;BR /&gt;
I don't recommend using the designer to deal with the enhanced editor control.  Instead, I would use a placeholder control (like a panel) and then dynamically create the editor control when your form is loaded.&lt;BR /&gt;
&lt;BR /&gt;
For example, declare this:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
private AxEDITORCONTROLLib.AxEditorControl ctlEditor = null;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Then in OnLoad(), do this:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
ctlEditor = new AxEDITORCONTROLLib.AxEditorControl();&lt;BR /&gt;
ctlEditor.Location = panelPlaceholder.Location;&lt;BR /&gt;
ctlEditor.Visible = true;&lt;BR /&gt;
ctlEditor.Dock = panelPlaceholder.Dock;&lt;BR /&gt;
&lt;BR /&gt;
// add handler for when the control is finished being created&lt;BR /&gt;
ctlEditor.HandleCreated += new EventHandler(ctlEditor_HandleCreated);&lt;BR /&gt;
&lt;BR /&gt;
this.Controls.AddRange(new System.Windows.Forms.Control[] {this.ctlEditor});&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Then be sure not to reference the control's methods until the handle is created.  This is not uncommon when dealing with ActiveX controls via COM interop.  It might take a moment to initialize, and you cannot call into it before it's ready.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
// control is created - now open file&lt;BR /&gt;
private void ctlEditor_HandleCreated(object sender, EventArgs e)&lt;BR /&gt;
{&lt;BR /&gt;
	if (file.Length&amp;gt;0)&lt;BR /&gt;
		ctlEditor.OpenFile(file);&lt;BR /&gt;
	ctlEditor.SetLanguage(4); // set language to SAS for syntax coloring&lt;BR /&gt;
}&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
      <pubDate>Tue, 05 Dec 2006 18:43:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1898#M626</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2006-12-05T18:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a SAS editor control to my Custom Task for code preview</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1899#M627</link>
      <description>Is there any way to utilize the Editor control as as SAS-Log control?&lt;BR /&gt;
&lt;BR /&gt;
How to enable SAS-Log syntax-highlighting such as red error-messages? Can I use the SetLanguage method? But which integer value to set?</description>
      <pubDate>Tue, 17 Nov 2009 18:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1899#M627</guid>
      <dc:creator>Florian_Dymatrix</dc:creator>
      <dc:date>2009-11-17T18:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a SAS editor control to my Custom Task for code preview</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1900#M628</link>
      <description>If you are using EG 4.2, you can use the new SAS.Tasks.Toolkit library to simplify this.&lt;BR /&gt;
&lt;BR /&gt;
The control you want is in SAS.Tasks.Toolkit.dll, and the control is:&lt;BR /&gt;
&lt;BR /&gt;
SAS.Tasks.Toolkit.Controls.SASTextEditorCtl&lt;BR /&gt;
&lt;BR /&gt;
It has a property that you can set:&lt;BR /&gt;
&lt;BR /&gt;
ContentType = SAS.Tasks.Toolkit.Controls.SASTextEditorCtl.eContentType.SASProgram;&lt;BR /&gt;
&lt;BR /&gt;
or &lt;BR /&gt;
&lt;BR /&gt;
ContentType = &lt;BR /&gt;
SAS.Tasks.Toolkit.Controls.SASTextEditorCtl.eContentType.SASLog&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
      <pubDate>Wed, 18 Nov 2009 13:41:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1900#M628</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2009-11-18T13:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a SAS editor control to my Custom Task for code preview</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1901#M629</link>
      <description>Dear Chris,&lt;BR /&gt;
&lt;BR /&gt;
unfortunately we are using EG 4.1. Is there another way using this version?&lt;BR /&gt;
&lt;BR /&gt;
Thanks, Florian</description>
      <pubDate>Tue, 24 Nov 2009 14:51:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1901#M629</guid>
      <dc:creator>Florian_Dymatrix</dc:creator>
      <dc:date>2009-11-24T14:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a SAS editor control to my Custom Task for code preview</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1902#M630</link>
      <description>Please, in the future, create a new forum post, rather than piggy-backing on a 3 year old post from another individual -- it's realistic to paste a link to the prior post but to simply REPLY to someone else's closed post is unreasonable.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 24 Nov 2009 17:08:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1902#M630</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-11-24T17:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a SAS editor control to my Custom Task for code preview</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1903#M631</link>
      <description>Okay, okay.  The magic number is....&lt;BR /&gt;
&lt;BR /&gt;
6&lt;BR /&gt;
&lt;BR /&gt;
Recommend that you set the properties in this order (assuming you like your log view to be read-only):&lt;BR /&gt;
&lt;BR /&gt;
editor.ReadOnly=true;&lt;BR /&gt;
editor.SetLanguage(6);&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
      <pubDate>Tue, 24 Nov 2009 21:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1903#M631</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2009-11-24T21:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a SAS editor control to my Custom Task for code preview</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1904#M632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Chris&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note&amp;nbsp;&amp;nbsp;&amp;nbsp; I use VB 2008, Guide 4.3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed your instructions to insert an editor in a Cutom Task. But on a machine equiped by only Enterprise Guide, i got this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System.Runtime.InteropServices.COMException&lt;/P&gt;&lt;P&gt;Classe non enregistrée (Exception de HRESULT : 0x80040154 (REGDB_E_CLASSNOTREG))&lt;/P&gt;&lt;P&gt;------------------------------ Début des informations techniques------------------------------&lt;/P&gt;&lt;P&gt;System.Runtime.InteropServices.COMException (0x80040154): Classe non enregistrée (Exception de HRESULT : 0x80040154 (REGDB_E_CLASSNOTREG))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid&amp;amp; clsid, Object punkOuter, Int32 context, Guid&amp;amp; iid)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.AxHost.CreateInstance()&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.AxHost.GetOcxCreate()&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.AxHost.CreateHandle()&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.Control.CreateControl()&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.Control.SetVisibleCore(Boolean value)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.TabPage.set_Visible(Boolean value)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.TabControl.UpdateTabSelection(Boolean updateFocus)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.TabControl.OnSelectedIndexChanged(EventArgs e)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.TabControl.WmSelChange()&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.TabControl.WndProc(Message&amp;amp; m)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 10:36:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1904#M632</guid>
      <dc:creator>Victor</dc:creator>
      <dc:date>2013-03-07T10:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a SAS editor control to my Custom Task for code preview</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1905#M633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Victor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In EG 4.3 the process is different, but even easier.&amp;nbsp; You can simply use the &lt;STRONG&gt;SAS.Tasks.Toolkit.Controls.SASTextEditorCtl&lt;/STRONG&gt; class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are examples here:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;A href="http://go.sas.com/customtasksapi"&gt;http://go.sas.com/customtasksapi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the SAS Program Runner project, for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, this is described in my book: &lt;EM&gt;&lt;A class="active_link" href="https://support.sas.com/pubscat/bookdetails.jsp?pc=61874"&gt;Custom Tasks for SAS Enterprise Guide using Microsoft .NET&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The book features an example in Chapter 12, and the source code for that project is available here (and &lt;A href="http://blogs.sas.com/content/sasdummy/2013/01/21/turn-your-data-set-into-a-data-step-program/"&gt;described in this blog post&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/onlinedoc/guide/customtasks/book/" title="http://support.sas.com/documentation/onlinedoc/guide/customtasks/book/"&gt;Custom Tasks for SAS Enterprise Guide using Microsoft .NET &lt;/A&gt;(Examples)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And finally, you can also see the same source code on GitHub:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/cjdinger/SasDatasetToDataStep" title="https://github.com/cjdinger/SasDatasetToDataStep"&gt;cjdinger/SasDatasetToDataStep · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifically:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/cjdinger/SasDatasetToDataStep/blob/master/src/DS2DatalinesForm.cs" title="https://github.com/cjdinger/SasDatasetToDataStep/blob/master/src/DS2DatalinesForm.cs"&gt;SasDatasetToDataStep/src/DS2DatalinesForm.cs at master · cjdinger/SasDatasetToDataStep · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 13:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1905#M633</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2013-03-07T13:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a SAS editor control to my Custom Task for code preview</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1906#M634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what i finally did. It's so simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should look your book more often.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank's any way&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 13:41:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-add-a-SAS-editor-control-to-my-Custom-Task-for-code/m-p/1906#M634</guid>
      <dc:creator>Victor</dc:creator>
      <dc:date>2013-03-07T13:41:38Z</dc:date>
    </item>
  </channel>
</rss>

