> For the complete documentation index, see [llms.txt](https://nviasoft.gitbook.io/nviasoft-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nviasoft.gitbook.io/nviasoft-docs/documentation/c/3.-ezgem.md).

# 3. EZGem 기초 선언

### 3.1  네임스페이스 선언(Using 선언)

```csharp
using EZGemPlusCS;                            //EZGEM DLL을 사용하기 위한 참조
```

### 3.2 EZGEM DLL 변수 선언

```csharp
public partial class Form1 : Form
{
    //EZGEM DLL참조
    //m_gem. 입력시 모든 함수및 속성 사용가능
    //================================================
    public CEZGemPlusLib m_gem = new CEZGemPlusLib(); 
    //================================================

```

### 3.3 콜백함수 선언

장비가 켜질 때(Form\_Load), EZGemPlus 라이브러리에서 발생하는 각종 상태 변화와 호스트의 명령을              실시간으로 수신하기 위해 수신 함수를 등록하는 필수 초기화 과정입니다.

```csharp
private void Form1_Load(object sender, EventArgs e)
{
    // GEM 내부 이벤트를 받습니다.
    m_gem.OnEZGemEvent += new ON_EZGEM_EVENT(OnEventReceived);
    // HOST로부터 받은 메시지를 전달합니다. 
    m_gem.OnEZGemMsg += new ON_EZGEM_MSG(OnMsgReceived);
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nviasoft.gitbook.io/nviasoft-docs/documentation/c/3.-ezgem.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
