This is the C++ + MFC implementation of Agora RTC SDK examples for Windows. Before making any changes, read ARCHITECTURE.md to understand the structural rules.
# Build using Visual Studio (from command line)
cd windows/APIExample
msbuild APIExample.sln /p:Configuration=Release /p:Platform=x64
# Or open in Visual Studio and build manually
start APIExample.slnFor compile-time configuration, replace the APP_ID placeholder in
APIExample/APIExample/stdafx.h:
#define APP_ID "<#YOUR_APP_ID#>"When that placeholder remains, CConfig.cpp reads AppID.ini beside the built executable
and creates the file if needed. stdafx.h is tracked; never stage a real App ID in it.
Do NOT:
- Introduce C# or other languages — use C++ only
- Use WinForms or WPF — use MFC only
- Deviate from MFC naming conventions (
Cprefix for classes,m_prefix for members) - Use modern C++ patterns (lambdas, smart pointers) unless already present in the file being modified
- Forget to call
leaveChannel()andrelease()when closing an example - Update UI from background threads — always post messages to the main thread
- Share engine instances between examples — each example manages its own lifecycle
- Forget to implement
IRtcEngineEventHandlerfor event handling
All work must conform to the rules defined in ARCHITECTURE.md:
- Every example is a dialog class inheriting from
CDialogExorCDialog - Each example implements
IRtcEngineEventHandlerinterface - Each example manages its engine through
InitAgora()/UnInitAgora()on scene activation/exit - Message handlers are defined via
BEGIN_MESSAGE_MAP/END_MESSAGE_MAP - All examples are registered in
APIExampleDlg.handAPIExampleDlg.cpp - Configuration is managed centrally via
CConfigclass
- Language is C++ — do not introduce C# or other languages
- UI framework is MFC — do not introduce WinForms or WPF
- Use MFC conventions:
Cprefix for classes,m_prefix for member variables - Use message map pattern for event handling — do not introduce modern C++ patterns unless they already exist in the file being modified
- Match the code style, naming, and patterns of existing examples
For broader tasks, use the skills in .agents/skills/:
| Task | Skill | When to use |
|---|---|---|
| Find an existing example | .agents/skills/query-cases/ |
Need to locate a case by feature or API and verify its scene/dialog registration |
| Add or modify an example | .agents/skills/upsert-case/ |
Need to create a new API demo or update an existing one |
| Code review | .agents/skills/review-case/ |
Review example code for lifecycle, thread safety, and convention compliance |