1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | /* 空のCLRプロジェクト */ #include <stdio.h> //printf とかで必要 #include <wmsdk.h> //HRESULT とかで必要 #pragma comment(lib, "wmvcore.lib") //IWMMetadataEditor とかで必要 #pragma comment ( lib, "ole32.lib" )//CoInitialize で必要 using namespace System; //Console::ReadLine()で必要 #ifndef SAFE_RELEASE #define SAFE_RELEASE(x) \ if (x != NULL) \ { \ x->Release(); \ x = NULL; \ } #endif int main( void ) { HRESULT hr = S_OK; IWMProfileManager* pProfileMgr = NULL; IWMProfileManager2* pProfileMgr2 = NULL; WMT_VERSION profileVersion; // Initialize COM. //hr = CoInitialize(NULL); /*if(FAILED(hr)) { printf("Could not initialize COM."); return 0; }*/ // Create a profile manager object. // プロファイルマネージャオブジェクトを作成します。 hr = WMCreateProfileManager(&pProfileMgr); if (FAILED(hr)) { printf ( "Could not create a profile manager object." ); return 0; } // Get the IWMProfileManager2 interface. // IWMProfileManager2インタフェースを取得します。 hr = pProfileMgr->QueryInterface(IID_IWMProfileManager2, ( void **) &pProfileMgr2); if (FAILED(hr)) { printf ( "Could not get the IWMProfileManager2 interface." ); SAFE_RELEASE(pProfileMgr); return 0; } // Release the old interface. // 古いインターフェースを解放します。 SAFE_RELEASE(pProfileMgr); // Get the current system profile version. // 現在のシステムプロファイルバージョンを取得 hr = pProfileMgr2->GetSystemProfileVersion(&profileVersion); if (FAILED(hr)) { printf ( "Could not retrieve profile version." ); printf ( "\nError code: 0x%X\n" , hr); SAFE_RELEASE(pProfileMgr2); return 0; } // Display the current version. // 現在のバージョンを表示します。 printf ( "Current version: " ); switch (profileVersion) { case WMT_VER_4_0: printf ( "WMT_VER_4_0\n" ); break ; case WMT_VER_7_0: printf ( "WMT_VER_7_0\n" ); break ; case WMT_VER_8_0: printf ( "WMT_VER_8_0\n" ); break ; case WMT_VER_9_0: printf ( "WMT_VER_9_0\n" ); break ; } // Set the system profile version to 8. // システムプロファイルをバージョン8に設定 profileVersion = WMT_VER_8_0; hr = pProfileMgr2->SetSystemProfileVersion(profileVersion); if (FAILED(hr)) { printf ( "Could not change profile version." ); printf ( "\nError code: 0x%X\n" , hr); SAFE_RELEASE(pProfileMgr2); return 0; } // Print verification. printf ( "Successfully set version to " ); switch (profileVersion) { case WMT_VER_4_0: printf ( "WMT_VER_4_0\n" ); break ; case WMT_VER_7_0: printf ( "WMT_VER_7_0\n" ); break ; case WMT_VER_8_0: printf ( "WMT_VER_8_0\n" ); break ; case WMT_VER_9_0: printf ( "WMT_VER_9_0\n" ); break ; } printf ( "-------------プログラム終了----------------" ); Console::ReadLine(); //入力待-ウインドウ維持 } |
2013年6月26日水曜日
システムプロファイルバージョンの変更:
To Change System Profile Versions
登録:
コメントの投稿 (Atom)
0 件のコメント:
コメントを投稿