vs2008 使用silverlight xamlruntime.lib 问题
WINCE平台使用silverlight做界面,添加了xamlruntime.lib库后,编译报错
error LNK2019: 无法解析的外部符号 __GetUserKData,该符号在函数 GetCurrentThreadId 中被引用xamlruntime.lib
类似于这样的错,都是xamlruntime.lib库里的函数,总共300多个错呐。。。。
我在工程中添加了库文件,头文件也包含了,这是什么原因啊?
下面是我写的代码,整个工程就这点东西了:
#include "SESample.h"#include "xamlruntime.h"#include "xrdelegate.h"#include "xrptr.h"#include "pwinuser.h"#include "resource.h"int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow){ if (!XamlRuntimeInitialize()) return -1; HRESULT retcode; IXRApplicationPtr app; if (FAILED(retcode=GetXRApplicationInstance(&app))) return -1; if (FAILED(retcode=app->AddResourceModule(hInstance))) return -1; XRWindowCreateParams wp; ZeroMemory(&wp, sizeof(XRWindowCreateParams)); wp.Style = WS_OVERLAPPED; wp.pTitle = L"S4E Test"; wp.Left = 0; wp.Top = 0; XRXamlSource xamlsrc; xamlsrc.SetResource(hInstance,TEXT("XAML"),MAKEINTRESOURCE(IDR_XAML1)); IXRVisualHostPtr vhost; if (FAILED(retcode=app->CreateHostFromXaml(&xamlsrc, &wp, &vhost))) return -1; IXRFrameworkElementPtr root; if (FAILED(retcode=vhost->GetRootElement(&root))) return -1; IXRImagePtr imgCancel; if (FAILED(retcode=root->FindName(TEXT("BtnCancel"), &imgCancel))) return -1; return TRUE;}