DACLTSDK.CPP
上传用户:fuyouda
上传日期:2015-08-19
资源大小:6876k
文件大小:4k
源码类别:

家庭/个人应用

开发平台:

Visual C++

  1. #include "stdafx.h"
  2. #include "DACLTSDK.h"
  3. ASDAC_SETDATACHANGEPROC ASDAC_SetDataChangeProc;
  4. ASDAC_SETSHUTDOWNPROC ASDAC_SetShutdownProc;
  5. ASDAC_GETVERSION ASDAC_GetVersion;
  6. ASDAC_INIT ASDAC_Init;
  7. ASDAC_UNINIT ASDAC_Uninit;
  8. ASDAC_ACTIVECODE ASDAC_ActiveCode;
  9. ASDAC_GETSERVERS ASDAC_GetServers;
  10. ASDAC_CONNECT ASDAC_Connect;
  11. ASDAC_DISCONNECT ASDAC_Disconnect;
  12. ASDAC_GETSERVERSTATUS ASDAC_GetServerStatus;
  13. ASDAC_ADDGROUP ASDAC_AddGroup;
  14. ASDAC_REMOVEGROUP ASDAC_RemoveGroup;
  15. ASDAC_SETGROUPNAME ASDAC_SetGroupName;
  16. ASDAC_SETGROUPSTAT ASDAC_SetGroupStat; 
  17. ASDAC_GETGROUPSTAT ASDAC_GetGroupStat; 
  18. ASDAC_REFRESHGROUP ASDAC_RefreshGroup;
  19. ASDAC_ADDITEM ASDAC_AddItem;
  20. ASDAC_REMOVEITEM ASDAC_RemoveItem; 
  21. ASDAC_WRITEITEM ASDAC_WriteItem;
  22. ASDAC_READITEM ASDAC_ReadItem;
  23. ASDAC_ACTIVEITEM ASDAC_ActiveItem;
  24. ASDAC_VALIDATEITEM ASDAC_ValidateItem;
  25. ASDAC_GETNAMESPACE ASDAC_GetNameSpace;
  26. ASDAC_CHANGEBROWSEPOSITION ASDAC_ChangeBrowsePosition;
  27. ASDAC_BROWSEITEMS ASDAC_BrowseItems;
  28. ASDAC_GETITEMFULLNAME ASDAC_GetItemFullName;
  29. ASDAC_GETITEMPROPERTIES ASDAC_GetItemProperties;
  30. ASDAC_GETITEMPROPERTYVALUE ASDAC_GetItemPropertyValue;
  31. BOOL InitOPCDef()
  32. {
  33. hLibrary=LoadLibrary(TEXT("DACLTSDK.DLL"));
  34. if(hLibrary)
  35. {
  36. ASDAC_SetDataChangeProc=(ASDAC_SETDATACHANGEPROC)GetProcAddress(hLibrary,TEXT("ASDAC_SetDataChangeProc"));
  37. ASDAC_SetShutdownProc=(ASDAC_SETSHUTDOWNPROC)GetProcAddress(hLibrary,TEXT("ASDAC_SetShutdownProc"));
  38. ASDAC_GetVersion=(ASDAC_GETVERSION )GetProcAddress(hLibrary,TEXT("ASDAC_GetVersion"));
  39. ASDAC_Init=(ASDAC_INIT )GetProcAddress(hLibrary,TEXT("ASDAC_Init"));
  40. ASDAC_Uninit=(ASDAC_UNINIT )GetProcAddress(hLibrary,TEXT("ASDAC_Uninit"));
  41. ASDAC_ActiveCode=(ASDAC_ACTIVECODE )GetProcAddress(hLibrary,TEXT("ASDAC_ActiveCode"));
  42. ASDAC_GetServers=(ASDAC_GETSERVERS )GetProcAddress(hLibrary,TEXT("ASDAC_GetServers"));
  43. ASDAC_Connect=(ASDAC_CONNECT )GetProcAddress(hLibrary,TEXT("ASDAC_Connect"));
  44. ASDAC_Disconnect=(ASDAC_DISCONNECT )GetProcAddress(hLibrary,TEXT("ASDAC_Disconnect"));
  45. ASDAC_GetServerStatus=(ASDAC_GETSERVERSTATUS )GetProcAddress(hLibrary,TEXT("ASDAC_GetServerStatus"));
  46. ASDAC_AddGroup=(ASDAC_ADDGROUP )GetProcAddress(hLibrary,TEXT("ASDAC_AddGroup"));
  47. ASDAC_RemoveGroup=(ASDAC_REMOVEGROUP )GetProcAddress(hLibrary,TEXT("ASDAC_RemoveGroup"));
  48. ASDAC_SetGroupName=(ASDAC_SETGROUPNAME )GetProcAddress(hLibrary,TEXT("ASDAC_SetGroupName"));
  49. ASDAC_SetGroupStat=(ASDAC_SETGROUPSTAT )GetProcAddress(hLibrary,TEXT("ASDAC_SetGroupStat")); 
  50. ASDAC_GetGroupStat=(ASDAC_GETGROUPSTAT )GetProcAddress(hLibrary,TEXT("ASDAC_GetGroupStat")); 
  51. ASDAC_RefreshGroup=(ASDAC_REFRESHGROUP )GetProcAddress(hLibrary,TEXT("ASDAC_RefreshGroup")); 
  52. ASDAC_AddItem=(ASDAC_ADDITEM )GetProcAddress(hLibrary,TEXT("ASDAC_AddItem"));
  53. ASDAC_RemoveItem=(ASDAC_REMOVEITEM )GetProcAddress(hLibrary,TEXT("ASDAC_RemoveItem")); 
  54. ASDAC_WriteItem=(ASDAC_WRITEITEM )GetProcAddress(hLibrary,TEXT("ASDAC_WriteItem"));
  55. ASDAC_ReadItem=(ASDAC_READITEM )GetProcAddress(hLibrary,TEXT("ASDAC_ReadItem"));
  56. ASDAC_ActiveItem=(ASDAC_ACTIVEITEM )GetProcAddress(hLibrary,TEXT("ASDAC_ActiveItem"));
  57. ASDAC_ValidateItem=(ASDAC_VALIDATEITEM )GetProcAddress(hLibrary,TEXT("ASDAC_ValidateItem"));
  58. ASDAC_GetNameSpace=(ASDAC_GETNAMESPACE )GetProcAddress(hLibrary,TEXT("ASDAC_GetNameSpace"));
  59. ASDAC_ChangeBrowsePosition = (ASDAC_CHANGEBROWSEPOSITION)GetProcAddress(hLibrary,TEXT("ASDAC_ChangeBrowsePosition"));
  60. ASDAC_BrowseItems=(ASDAC_BROWSEITEMS )GetProcAddress(hLibrary,TEXT("ASDAC_BrowseItems"));
  61. ASDAC_GetItemFullName=(ASDAC_GETITEMFULLNAME )GetProcAddress(hLibrary,TEXT("ASDAC_GetItemFullName"));
  62. ASDAC_GetItemProperties=(ASDAC_GETITEMPROPERTIES )GetProcAddress(hLibrary,TEXT("ASDAC_GetItemProperties"));
  63. ASDAC_GetItemPropertyValue=(ASDAC_GETITEMPROPERTYVALUE )GetProcAddress(hLibrary,TEXT("ASDAC_GetItemPropertyValue"));
  64. return true;
  65. }
  66. else return false;
  67. }
  68. BOOL FreeOPCDef()
  69. {
  70. if(hLibrary)
  71. return FreeLibrary(hLibrary);
  72. else
  73. return FALSE;
  74. }