|
|
Home » U++ Library support » U++ Core » Some fixes in InVector.hpp and Vcont.cpp
|
|
Re: Some fixes in InVector.hpp and Vcont.cpp [message #43725 is a reply to message #43717] |
Sat, 27 September 2014 06:35 |
kasome
Messages: 78 Registered: July 2008 Location: Taiwan
|
Member |
|
|
Hi Mirek,
Thanks for the reply, I already upload the entire UppDLL project in the following download link, which can be compiled by using VS2012
http://www.mediafire.com/download/05ejdu5dm0uoddc/TestUppDLL .rar
Just use VS2012 to open the following two solutioin file and run on Windows 7
TestUppDLL\WithModification\UppLib_WithModification.sln ------> no crash
TestUppDLL\WithoutModification\UppLib_WithoutModification.sl n ------> crash
The only difference between "UppLib_WithModification" and "UppLib_WithoutModification" is the modification of InVector.hpp and Vcont.cpp as mentioned.
Notice:
Do not use or test the compiled U++ dll on the Windows XP or before Windows Vista, the reason is the follwoing:
Rules and Limitations for TLS
PRB:Calling LoadLibrary() to Load a DLL That Has Static TLS
Quote:On Windows operating systems before Windows Vista, __declspec( thread ) has some limitations. If a DLL declares any data or object as __declspec( thread ), it can cause a protection fault if dynamically loaded. After the DLL is loaded with LoadLibrary, it causes system failure whenever the code references the __declspec( thread ) data. Because the global variable space for a thread is allocated at run time, the size of this space is based on a calculation of the requirements of the application plus the requirements of all the DLLs that are statically linked. When you use LoadLibrary, you cannot extend this space to allow for the thread local variables declared with __declspec( thread ). Use the TLS APIs, such as TlsAlloc, in your DLL to allocate TLS if the DLL might be loaded with LoadLibrary.
[Updated on: Sat, 27 September 2014 06:39] Report message to a moderator
|
|
|
|
|
Re: Some fixes in InVector.hpp and Vcont.cpp [message #43730 is a reply to message #43728] |
Sat, 27 September 2014 20:32 |
kasome
Messages: 78 Registered: July 2008 Location: Taiwan
|
Member |
|
|
Hi Mirek,
Performing the following steps:
VS2012:
modify
C:\Program Files (x86)\Windows Kits\8.0\Include\um\ObjIdl.h
change
#include "rpc.h"
to
#include "C:\Program Files (x86)\Windows Kits\8.0\Include\shared\rpc.h"
VS2013:
modify
C:\Program Files (x86)\Windows Kits\8.1\Include\um\ObjIdl.h
change
#include "rpc.h"
to
#include "C:\Program Files (x86)\Windows Kits\8.1\Include\shared\rpc.h"
Somehow, when VS2012/VS2013 read the line #include "rpc.h", it will try to include the wrong file MSVS_Ultimate++\upp\uppsrc\Core\Rpc\Rpc.h, and that cause error.
[Updated on: Sun, 28 September 2014 08:04] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Nov 01 00:22:01 CET 2024
Total time taken to generate the page: 0.01713 seconds
|
|
|