# 2024버전 RegisterModule 문제

**URL:** <https://forum.developer.hancom.com/t/2024-registermodule/1655>\
**Category:** 한글 오토메이션\
**Created:** [7월 17, 2024, 10:30오전 UTC](https://forum.developer.hancom.com/t/2024-registermodule/1655 "2024-07-17T10:30:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![user282](https://avatars.discourse-cdn.com/v4/letter/u/4da419/32.png) [@user282](https://forum.developer.hancom.com/u/user282)\
**Post date:** [7월 17, 2024, 10:30오전 UTC](https://forum.developer.hancom.com/t/2024-registermodule/1655/1 "2024-07-17T10:30:43Z")

</div>

안녕하세요. 현재 2024 버전으로 c#에서 작업 중입니다.

RegisterModule 모듈을 사용함에도 지속적으로 팝업창이 뜨고 있습니다.

2020버전에서는 안그랬는데 2024로 넘어오면서 뜨고 있는 것 같습니다.

소스는 기존에 잘 사용하고 있던 소스를 사용하고 있었습니다.

달라진점은 2024부터는 ActiveX 버전을 사용할 수 없다고 하여 Object 버전으로 변경하였습니다.

```
HwpObject hwp = new HwpObject();

RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\HNC\HwpAutomation\Modules", true);
if (key == null)
{
    key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\HNC\HwpAutomation\Modules");
}
if (key.GetValue("FilePathCheckerModuleExample") == null)
{
    key.SetValue("FilePathCheckerModuleExample", pathChecker);
}

bool ss = hwp.RegisterModule("FilePathCheckDLL", "FilePathCheckerModule");
if (ss) Helper.Logger.WriteLog("보안승인 성공");
else Helper.Logger.WriteLog("보안승인 실패");

IDHwpAction act = hwp.CreateAction("Print");
IDHwpParameterSet set = act.CreateSet();

object format = Type.Missing;
object arg = Type.Missing;

hwp.Open(data.InputFileFullPath, format, arg);

act.GetDefault(set);
set.SetItem("FileName", data.OutputFileFullPath);
set.SetItem("PrintDevice", "Printer");
act.Execute(set);

```

위와 같은 소스인데도 계속 팝업이 뜨네요…

---

<div class="post-metadata">

**Author:** ![kosohn](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.developer.hancom.com/kosohn/32/2313_2.png) [@kosohn](https://forum.developer.hancom.com/u/kosohn)\
**Post date:** [7월 17, 2024, 10:45오전 UTC](https://forum.developer.hancom.com/t/2024-registermodule/1655/2 "2024-07-17T10:45:46Z")

</div>

아마도 보안 모듈이 2종류이고 이름도 같아서 그런 것 같습니다.  
원인과 해결방법이 맞는지 모르겠지만…  
오토메이션용 보안모듈 파일로 등록하셔서 사용해 보세요…

[오토메이션용 보안모듈](https://github.com/hancom-io/devcenter-archive/raw/main/hwp-automation/%EB%B3%B4%EC%95%88%EB%AA%A8%EB%93%88(Automation).zip)

---

<div class="post-metadata">

**Author:** ![user282](https://avatars.discourse-cdn.com/v4/letter/u/4da419/32.png) [@user282](https://forum.developer.hancom.com/u/user282)\
**Post date:** [7월 18, 2024, 12:43오전 UTC](https://forum.developer.hancom.com/t/2024-registermodule/1655/3 "2024-07-18T00:43:05Z")

</div>

보안모듈이 2종류 인가요? 현재 올려주신 파일만 있는 것으로 알고 있습니다.  
그리고 기존에도 오토메이션용 보안모듈로 사용하고 있었습니다.  
혹시 몰라 올려주신걸로 변경해도 동일하게 접근허용 팝업창이 뜨고 있습니다.  
2024에서는 제어가 안되는 걸까요?

레지스트리에는

 ![image](https://us1.discourse-cdn.com/flex016/uploads/hancom_dev_forum/original/2X/b/b5971ae8e452db49ff371fece9bfd1a5726f3e39.png)

이곳과 그 아래 HwpCtrl/Modules 까지 동일하게 등록해놨습니다.

---

<div class="post-metadata">

**Author:** ![kosohn](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.developer.hancom.com/kosohn/32/2313_2.png) [@kosohn](https://forum.developer.hancom.com/u/kosohn)\
**Post date:** [7월 18, 2024, 1:14오전 UTC](https://forum.developer.hancom.com/t/2024-registermodule/1655/4 "2024-07-18T01:14:30Z")

</div>

보안모듈이 오토메이션용과 컨트롤용… 2가지가 있어서  
전 user282님이 컨트롤용으로 사용하고 계신 줄 알았어요.

오토메이션용 모듈이 레지스트리에 등록 되었는걸 보니  
보안모듈 문제가 아닌 것 같네요.

---

<div class="post-metadata">

**Author:** ![jjeong](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@jjeong](https://forum.developer.hancom.com/u/jjeong)\
**Post date:** [7월 18, 2024, 2:04오전 UTC](https://forum.developer.hancom.com/t/2024-registermodule/1655/5 "2024-07-18T02:04:22Z")

</div>

안녕하세요.

RegisterModule의 두번째 파라미터는 레지스트리에 등록된 모듈의 문자열값 이름과 동일해야 합니다.

> bool ss = hwp.RegisterModule(“FilePathCheckDLL”, “FilePathCheckerModule”);

첨부해주신 코드의 두번째 파라미터는 “FilePathCheckerModule” 인데

스크린샷의 레지스트리에 등록 된 모듈의 문자열값 이름들은 다르게 설정되어 있네요.

보안모듈이 등록된 레지스트리 이름을 동일하게 맞춰주시면 될 듯 합니다.

추가로 궁금한 점 있으시면 문의주세요.
