用C++调用Windows Live Writer SDK
首先在自己的项目中把windows live writer的安装目录包含进去,然后导入"WindowsLiveWriter.Application.tlb"
这样就可以在项目中调用windows live writer所提供的一些sdk了!
{
::CoInitialize(NULL);
HRESULT hr;
IWindowsLiveWriterApplicationPtr pFun = NULL;
IWindowsLiveWriterApplication* pf = NULL;
hr = pFun.CreateInstance(__uuidof(WindowsLiveWriterApplication));
if(SUCCEEDED(hr))
{
hr = pFun.QueryInterface(IWindowsLiveWriterApplicationPtr::GetIID(),&pf);
if(SUCCEEDED(hr))
{
pf->BlogThisImageUrl("测试标题","http://www.baidu.com/img/logo.gif","abcdefg");
}
}
pFun.Release();
::CoUninitialize();
}
这样调用虽然能把要发表的内容加到windows live writer中,但是还需要手动的点击发布之后才能把文章发表到个人空间上,我没有找到另外其它的接口可以直接发表文章的!
这样就可以在项目中调用windows live writer所提供的一些sdk了!
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
这样调用虽然能把要发表的内容加到windows live writer中,但是还需要手动的点击发布之后才能把文章发表到个人空间上,我没有找到另外其它的接口可以直接发表文章的!
--kaixuan's cnblogs