{"id":116,"date":"2010-04-17T22:58:13","date_gmt":"2010-04-18T07:58:13","guid":{"rendered":"\/blog\/?p=116"},"modified":"2023-09-21T09:41:14","modified_gmt":"2023-09-21T00:41:14","slug":"class%eb%a1%9c-%ec%9e%91%ec%84%b1%eb%90%9c-dll-%ec%82%ac%ec%9a%a9%eb%b0%a9%eb%b2%95","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=116","title":{"rendered":"class\ub85c \uc791\uc131\ub41c DLL \uc0ac\uc6a9\ubc29\ubc95"},"content":{"rendered":"\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">Class\ub97c \uc544\ubb34\ub7f0 \uc0dd\uac01\uc5c6\uc774 DLL(dynamic link library )\ub85c \ub9cc\ub4e4\uc5b4\ubc84\ub838\ub2e4.. -_-;;<\/SPAN><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\ub2e4\ub9cc\ub4e4\uace0 \ub098\uc11c \uc0ac\uc6a9\ud560\ub824\uace0 \ubcf4\ub2c8 \ub9c9\ub9c9\ud55c\uac83... T^T<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\uc774\ub9ac\uc800\ub9ac \ub4a4\uc9c0\uace0 \ub4a4\uc9c0\ub2e4 \uc54c\uc544\ub0b8 \ubc29\ubc95\uc774\ub2e4.<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\ub300\ub7b5 \ubc29\ubc95\uc740 \uc608\ub97c \ub4e4\uc5b4 \uc124\uba85\ud558\uba74<\/SPAN><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\uc0ac\uc6a9\ud560 \ud074\ub798\uc2a4 \uc774\ub984\uc744 CMy\uc774\ub77c \ud558\uba74<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/SPAN><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">- dll class header<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">class CMy<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">{<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">public:<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;CMy(); &nbsp; &nbsp; &nbsp; &nbsp;\/\/ \uc0dd\uc131\uc790<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;~CMy(); &nbsp; &nbsp; &nbsp; &nbsp;\/\/ \ud30c\uad34\uc790:\uc5f0\uacb0 \ud578\ub4e4\uc744 \ud574\uc81c\ud55c\ub2e4.<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/\uc0ac\uc6a9\ud560 \ud568\uc218\ub4e4....<\/SPAN><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;BOOL Connect(int Type, char *ConStr, char *UID=NULL, char *PWD=NULL);<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;BOOL Exec(); <\/SPAN><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;..... \uc911\ub7b5<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;void WriteBlob(LPCTSTR szSQL, void *buf, int size);<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">};<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ In dll<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ \ud074\ub798\uc2a4\ub97c \uc0dd\uc131\ud558\uc5ec \ub9ac\ud134\ud574 \uc8fc\ub294 \uc5ed\ud65c\uc744 \ud55c\ub2e4. \uc774\uac83\uc774 \ud575\uc2ec\uc778\ub4ef \ub9ac\ud134\uac12\uc73c\ub85c \ud074\ub798\uc2a4\ub97c \ud1b5\uc9f8\ub85c \ub118\uaca8\uc918\ubc84\ub9b0\ub2e4. \u3161.\u3161;;<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">extern \"C\" __declspec(dllexport) CQuery* CreateCMy()<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">{<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; return new CMy();<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">}<\/SPAN><br \/><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\uc704\uc640 \uac19\uc740 \ud615\uc2dd\uc758 #include\ud560 \ud074\ub798\uc2a4\ud5e4\ub354\ud30c\uc77c\uc744 virtual\ub85c \ud558\ub098 \ub9cc\ub4e0\ub2e4.<\/SPAN><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/SPAN><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">- dll class header<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">class CMy<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">{<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">public:<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;CMy(); &nbsp; &nbsp; &nbsp; &nbsp;\/\/ \uc0dd\uc131\uc790<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;virtual ~CMy(); &nbsp; &nbsp; &nbsp; &nbsp;\/\/ \ud30c\uad34\uc790:\uc5f0\uacb0 \ud578\ub4e4\uc744 \ud574\uc81c\ud55c\ub2e4.<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/\uc0ac\uc6a9\ud560 \ud568\uc218\ub4e4....<\/SPAN><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;virtual BOOL Connect(int Type, char *ConStr, char *UID=NULL, char *PWD=NULL);<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;virtual BOOL Exec(); <\/SPAN><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;..... \uc911\ub7b5<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;virtual void WriteBlob(LPCTSTR szSQL, void *buf, int size);<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">};<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\uc774\ub54c\ub294 dllexport \ub294 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\ub294\ub2e4. \ub2e8\uc21c \ud074\ub798\uc2a4\ub0b4\uc5d0\uc11c \uc0ac\uc6a9\ub420 \ud568\uc218\ub4e4\ub9cc \uc120\uc5b8\ub418\uc5b4\uc788\uc73c\uba74 \ub41c\ub2e4.<\/SPAN><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\uc774\uc81c \uc900\ube44\ub294 \ub2e4\ub418\uc5c8\uace0 \uc2e4\uc81c \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\uc740 \uc544\ub798\uc640 \uac19\ub2e4.<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">#include \"My.h\" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; \/\/include\uc5d0 \uc0ac\uc6a9\ud558\uae30 \uc704\ud574 \ub9cc\ub4e0\ud5e4\ub354 \uc120\uc5b8.<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">... \uc911\ub7b5<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">HINSTANCE hInst;<\/SPAN><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">hInst = LoadLibrary (\"dll\"); \/\/dll\uc744 \ub85c\ub4dc \ud55c\ub2e4.<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ \ud074\ub798\uc2a4 \ud3ec\uc778\ud130 \ud0c0\uc785 \uc9c0\uc815<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">typedef CMy* (*PFNCreateMy)();<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ DLL \uc5d0\uc11c \ud568\uc218 \uc77d\uc5b4\uc634<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">PFNCreateSQL pfnCreateMy = (PFNCreateMy)GetProcAddress(hInst, TEXT\"CreateCMy\"));<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ \ud074\ub798\uc2a4 \uc0dd\uc131 \ud568\uc218 \ud638\ucd9c CMMy\ub85c \ud074\ub798\uc2a4\ub97c \uc0dd\uc131\ud558\uc600\ub2e4. \uc774\uc81c \ubcf4\ud1b5 \ud074\ub798\uc2a4\uc4f0\ub4ef\uc774 \uc4f0\uba74\ub41c\ub2e4.<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">CMy* CMMy = (pfnCreateMy)();<\/SPAN><br \/><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/\uc774\ub7ec\ucf00.......<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">CMMy -&gt;Exec();<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/\uc885\ub8cc\uc2dc \ubc18\ub4dc\uc2dc delete\uc640 FreeLibrary\ud574\uc8fc\ub294 Sense... \uc78a\uc9c0\ub9d0\uc790...<\/SPAN><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">delete CMMy ;<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">FreeLibrary(hInst);<\/SPAN><\/P>\n","protected":false},"excerpt":{"rendered":"<p>Class\ub97c \uc544\ubb34\ub7f0 \uc0dd\uac01\uc5c6\uc774 DLL(dynamic link library )\ub85c \ub9cc\ub4e4\uc5b4\ubc84\ub838\ub2e4.. -_-;; \ub2e4\ub9cc\ub4e4\uace0 \ub098\uc11c \uc0ac\uc6a9\ud560\ub824\uace0 \ubcf4\ub2c8 \ub9c9\ub9c9\ud55c\uac83&#8230; T^T &nbsp; \uc774\ub9ac\uc800\ub9ac \ub4a4\uc9c0\uace0 \ub4a4\uc9c0\ub2e4 \uc54c\uc544\ub0b8 \ubc29\ubc95\uc774\ub2e4. &nbsp; \ub300\ub7b5 \ubc29\ubc95\uc740 \uc608\ub97c \ub4e4\uc5b4 \uc124\uba85\ud558\uba74 \uc0ac\uc6a9\ud560 \ud074\ub798\uc2a4 \uc774\ub984\uc744 CMy\uc774\ub77c \ud558\uba74 &nbsp; \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ &#8211; dll class header &nbsp; class CMy{public:&nbsp;CMy(); &nbsp; &nbsp; &nbsp; &nbsp;\/\/ \uc0dd\uc131\uc790&nbsp;~CMy(); &nbsp; &nbsp; &nbsp; &nbsp;\/\/ \ud30c\uad34\uc790:\uc5f0\uacb0 \ud578\ub4e4\uc744 \ud574\uc81c\ud55c\ub2e4. &nbsp; \/\/\uc0ac\uc6a9\ud560 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[18],"tags":[],"class_list":["post-116","post","type-post","status-publish","format-standard","hentry","category-development_language"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=116"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}