Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.0 KiB

  1. // net_bindingTemplate_tModelInstanceInfos_get.h : Declaration of the net_bindingTemplate_tModelInstanceInfos_get class
  2. #ifndef __NET_BINDINGTEMPLATE_TMODELINSTANCEINFOS_GET_H_
  3. #define __NET_BINDINGTEMPLATE_TMODELINSTANCEINFOS_GET_H_
  4. class net_bindingTemplate_tModelInstanceInfos_getAccessor
  5. {
  6. public:
  7. LONG m_RETURNVALUE;
  8. TCHAR m_bindingKey[ 100 ];
  9. LARGE_INTEGER m_colinstanceID;
  10. TCHAR m_coltModelKey[ 100 ];
  11. TCHAR m_coloverviewURL[4001];
  12. TCHAR m_colinstanceParms[4001];
  13. CComBSTR m_connectionString;
  14. BEGIN_PARAM_MAP(net_bindingTemplate_tModelInstanceInfos_getAccessor)
  15. SET_PARAM_TYPE(DBPARAMIO_OUTPUT)
  16. COLUMN_ENTRY(1, m_RETURNVALUE)
  17. SET_PARAM_TYPE(DBPARAMIO_INPUT)
  18. COLUMN_ENTRY(2, m_bindingKey)
  19. END_PARAM_MAP()
  20. BEGIN_COLUMN_MAP(net_bindingTemplate_tModelInstanceInfos_getAccessor)
  21. COLUMN_ENTRY(1, m_colinstanceID)
  22. COLUMN_ENTRY(2, m_coltModelKey)
  23. COLUMN_ENTRY(3, m_coloverviewURL)
  24. COLUMN_ENTRY(4, m_colinstanceParms)
  25. END_COLUMN_MAP()
  26. DEFINE_COMMAND(net_bindingTemplate_tModelInstanceInfos_getAccessor, _T("{ ? = CALL dbo.net_bindingTemplate_tModelInstanceInfos_get;1 (?) }"))
  27. // You may wish to call this function if you are inserting a record and wish to
  28. // initialize all the fields, if you are not going to explicitly set all of them.
  29. void ClearRecord()
  30. {
  31. memset(this, 0, sizeof(*this));
  32. }
  33. };
  34. class net_bindingTemplate_tModelInstanceInfos_get : public CCommand<CAccessor<net_bindingTemplate_tModelInstanceInfos_getAccessor>, CRowset, CMultipleResults >
  35. {
  36. public:
  37. HRESULT Open()
  38. {
  39. HRESULT hr;
  40. hr = OpenDataSource();
  41. if( FAILED(hr) )
  42. return hr;
  43. return OpenRowset();
  44. }
  45. HRESULT OpenDataSource()
  46. {
  47. HRESULT hr;
  48. CDataSource db;
  49. hr = db.OpenFromInitializationString( m_connectionString );
  50. if( FAILED(hr) )
  51. return hr;
  52. return m_session.Open(db);
  53. }
  54. HRESULT OpenRowset()
  55. {
  56. return __super::Open(m_session, NULL, NULL, 0, DBGUID_DBSQL, false);
  57. }
  58. CSession m_session;
  59. };
  60. #endif // __NET_BINDINGTEMPLATE_TMODELINSTANCEINFOS_GET_H_