Hello Chris
Note I use VB 2008, Guide 4.3
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:
System.Runtime.InteropServices.COMException
Classe non enregistrée (Exception de HRESULT : 0x80040154 (REGDB_E_CLASSNOTREG))
------------------------------ Début des informations techniques------------------------------
System.Runtime.InteropServices.COMException (0x80040154): Classe non enregistrée (Exception de HRESULT : 0x80040154 (REGDB_E_CLASSNOTREG))
à System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
à System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
à System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
à System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
à System.Windows.Forms.AxHost.CreateInstance()
à System.Windows.Forms.AxHost.GetOcxCreate()
à System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
à System.Windows.Forms.AxHost.CreateHandle()
à System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
à System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
à System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
à System.Windows.Forms.Control.CreateControl()
à System.Windows.Forms.Control.SetVisibleCore(Boolean value)
à System.Windows.Forms.TabPage.set_Visible(Boolean value)
à System.Windows.Forms.TabControl.UpdateTabSelection(Boolean updateFocus)
à System.Windows.Forms.TabControl.OnSelectedIndexChanged(EventArgs e)
à System.Windows.Forms.TabControl.WmSelChange()
à System.Windows.Forms.TabControl.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Victor,
In EG 4.3 the process is different, but even easier. You can simply use the SAS.Tasks.Toolkit.Controls.SASTextEditorCtl class.
There are examples here:
http://go.sas.com/customtasksapi
See the SAS Program Runner project, for example.
Also, this is described in my book: Custom Tasks for SAS Enterprise Guide using Microsoft .NET
The book features an example in Chapter 12, and the source code for that project is available here (and described in this blog post😞
Custom Tasks for SAS Enterprise Guide using Microsoft .NET (Examples)
And finally, you can also see the same source code on GitHub:
cjdinger/SasDatasetToDataStep · GitHub
Specifically:
SasDatasetToDataStep/src/DS2DatalinesForm.cs at master · cjdinger/SasDatasetToDataStep · GitHub
Chris
This is what i finally did. It's so simple.
I should look your book more often.
Thank's any way
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.