위와 같은 에러가 발생하는 상황인데 현재 구현부는…
hwp.InitScan(0x04, 0, 0, 0, 0, 0);
for (var ctrl = hwp.HeadCtrl; ctrl != null && ctrl != hwp.LastCtrl; ctrl = ctrl.Next)
{
if (ctrl != null && ctrl?.CtrlID == "tbl")
{
hwp.SelectCtrl(ctrl?.GetCtrlInstID(), 0);
IDHwpAction hwpAction = hwp.CreateAction("TablePropertyDialog");
IDHwpParameterSet hwpSet = hwpAction.CreateSet();
hwpAction.GetDefault(hwpSet);
int w = 0, h = 0;
if (hwpSet.ItemExist("Width"))
{
w = hwpSet.Item("Width");
}
if (hwpSet.ItemExist("Height"))
{
h = hwpSet.Item("Height");
}
}
}
구현부는 이렇게 해놨는데 hwp.SelectCtrl(ctrl?.GetCtrlInstID(), 0); 이부분에 죽어 버리네요… 죽는 이유는…
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace HwpObjectLib;
[ComImport]
[TypeLibType(4160)]
[Guid(“1BE3D304-747E-4702-B02A-3F23B1A6F53C”)]
public interface IDHwpAction
{
[DispId(1)]
string ActID
{
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(1)]
[return: MarshalAs(UnmanagedType.BStr)]
get;
}
[DispId(2)]
string SetID
{
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(2)]
[return: MarshalAs(UnmanagedType.BStr)]
get;
}
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(15000)]
int GetDefault([In][MarshalAs(UnmanagedType.IDispatch)] object param);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(15001)]
[return: MarshalAs(UnmanagedType.IDispatch)]
object CreateSet();
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(15002)]
bool Execute([In][MarshalAs(UnmanagedType.IDispatch)] object param);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(15003)]
int PopupDialog([In][MarshalAs(UnmanagedType.IDispatch)] object param);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(15004)]
int Run();
}
아래한글 인터페이스에서
GetCtrlInstID() 이함수가 없어서 인거 같습니다. … 따로 추가할수 있는 방법이 있을까요 ? C# 이고 아래한글 2018로 개발중입니다.