MSDN c ++ metro tutorial:命名空间中名称dateconverter不存在“using:SimpleBlogReader”; [英] MSDN c++ metro tutorial: the name dateconverter does not exist in the namespace "using:SimpleBlogReader"

查看:55
本文介绍了MSDN c ++ metro tutorial:命名空间中名称dateconverter不存在“using:SimpleBlogReader”;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我一直在关注MSDN c ++地铁教程(简单的博客阅读器应用程序):

I've been following the MSDN c++ metro tutorial here(simple blog reader app):

< a href ="http://msdn.microsoft.com/en-us/library/windows/apps/hh465045.aspx"> http://msdn.microsoft.com/en-us/library/windows/apps/hh465045 .aspx

我被困在SimpleBlogReader第1.0部分的末尾,教程指示我添加DateConverter .h到项目。

And I'm stucked at the end of SimpleBlogReader part 1.0, where the tutorial instructs me to add the DateConverter.h to the project.

我收到编译错误:

1> ------ Rebuild All started:Project:SimpleBlogReader,Configuration:Debug Win32 ------

1>------ Rebuild All started: Project: SimpleBlogReader, Configuration: Debug Win32 ------

1>  pch.cpp

1>  pch.cpp

1>  App.xaml.cpp

1>  App.xaml.cpp

1>  MainPage.xaml.cpp

1>  MainPage.xaml.cpp

1>  XamlTypeInfo.Impl.g.cpp

1>  XamlTypeInfo.Impl.g.cpp

1> c:\users\yichaozh\documents\visual studio 2012 \projects\simpleblogreader\simpleblogreader\dateconverter.h (12):错误C2525:'SimpleBlogReader :: DateConverter :: Convert':参数'culture'在基函数上被命名为'language',并且必须在已发布的实现中匹配
(App.xaml.cpp)

1>c:\users\yichaozh\documents\visual studio 2012\projects\simpleblogreader\simpleblogreader\dateconverter.h(12): error C2525: 'SimpleBlogReader::DateConverter::Convert' : The parameter 'culture' is named 'language' on the base function and must be matched in a published implementation (App.xaml.cpp)

1> c:\users\yichaozh\documents\visual studio 2012 \projects\simpleblogreader\simpleblogreader\dateconverter.h(23):错误C2525: 'SimpleBlogReader :: DateConverter :: ConvertBack':参数'culture'在基函数上被命名为'language',并且在已发布的实现中必须是
匹配(App.xaml.cpp)

1>c:\users\yichaozh\documents\visual studio 2012\projects\simpleblogreader\simpleblogreader\dateconverter.h(23): error C2525: 'SimpleBlogReader::DateConverter::ConvertBack' : The parameter 'culture' is named 'language' on the base function and must be matched in a published implementation (App.xaml.cpp)

1> c:\users\yichaozh\documents\visual studio 2012 \projects\simpleblogreader\simpleblogreader\dateconverter.h(12):错误C2525:'SimpleBlogReader :: DateConverter ::兑换':参数'culture'在基函数上命名为'language',并且必须在已发布的实现中匹配
(MainPage.xaml.cpp)

1>c:\users\yichaozh\documents\visual studio 2012\projects\simpleblogreader\simpleblogreader\dateconverter.h(12): error C2525: 'SimpleBlogReader::DateConverter::Convert' : The parameter 'culture' is named 'language' on the base function and must be matched in a published implementation (MainPage.xaml.cpp)

1> c: \users\yichaozh\documents\visual studio 2012 \projects\simpleblogreader\simpleblogreader\dateconverter.h(23):错误C2525:'SimpleBlogReader :: DateConverter :: ConvertBack':参数'culture'在基函数上命名为'language',并且必须在已发布的实现中匹配
(MainPage.xaml.cpp)

1>c:\users\yichaozh\documents\visual studio 2012\projects\simpleblogreader\simpleblogreader\dateconverter.h(23): error C2525: 'SimpleBlogReader::DateConverter::ConvertBack' : The parameter 'culture' is named 'language' on the base function and must be matched in a published implementation (MainPage.xaml.cpp)

========== Rebuild全部:0成功,1失败,0跳过==========

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

基本上我认为我按照教程所说的做了所有事情,但仍然得到上述错误消息。

Basically I think I did everything as the tutorial said, but still get the above error messages.

我可以看到"local:DateConverter"在MainPage.xaml中有下划线,说:名称dateconverter在名称空间中不存在"using:SimpleBlogReader"。

And I can see "local:DateConverter" in MainPage.xaml is underlined, saying: the name dateconverter does not exist in the namespace "using:SimpleBlogReader".

是否还有人遇到此问题?

Does anyone have this problem as well?

推荐答案

您好,

您应该创建一个名为DateConverter.h的头文件,然后包含到MainPage.xaml.h

You should create a head file named DateConverter.h, and then include to MainPage.xaml.h

请按照本文档中的"创建一个实现IValueConverter的值转换器类"部分来实现
http://msdn.microsoft.com/en-us/library/windows/ apps / hh465045.aspx

Please follow the To create a value converter class that implements IValueConverter section in this document
http://msdn.microsoft.com/en-us/library/windows/apps/hh465045.aspx

您可以将代码复制到该头文件中。

You can copy the codes into that head file.

最好的问候,

Jesse

Best regards,
Jesse


这篇关于MSDN c ++ metro tutorial:命名空间中名称dateconverter不存在“using:SimpleBlogReader”;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆