-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use WinRT ThreadEmulation for Threading on WinRT #1
Comments
I can't use c++ code in libcurl as it will give hundreds of errors We may want to look at the wrapper the mingw-w64 project has for some functions? |
You just need to write a c wrapper to the cpp code. Something similar to http://blog.eikke.com/index.php/ikke/2005/11/03/using_c_classes_in_c.html Since you are only dealing with a HANDLE returned by ThreadEmulation and simple Primitive data types (BOOL, VOID, DWORD), the C wrapper should be pretty simple. |
Ahh I see. I was looking at the VLC port and they do something similar. Thanks Dale this seems doable now |
2>asyn-thread.obj : error LNK2001: unresolved external symbol _InitializeCriticalSectionEx Down to 4 errors now. May need input on the winrtsock SO_KEEPALIVEFLAG |
FYI GetModuleHandle(W)(Ex) is not supported on WinRT On WinRT you should use LoadPackagedLibrary to load a DLL and GetProcAddress to get the function. Look at https://github.com/stammen/angleproject/blob/dev/src/libGLESv2/renderer/Renderer.cpp for an example |
Okay I've fixed all the errors, what happens is if you #include from a c file instead of a cpp file you don't get half he windows api on rt because a #define win32_rt doesn't get defined. I just prototyped the functions needed. It feels like MS headers are trying and force you to use c++ :/ Anyway this is now solved. I didn't need GetModuleHandle in the end :) We now have a dll and I have merged it in to cocos2d-x. I'll make a new pull request with WinRT support. I may chaned the thread emulation to what you have above because it crashes. Not quite sure how to add this but it should at least link on winrt and cocos2d-x for now :) |
http://blogs.msdn.com/b/shawnhar/archive/2012/03/12/createthread-for-windows-8-metro.aspx
Supports CreateThread(). I have used it in other projects.
The text was updated successfully, but these errors were encountered: