|
You are correct, each thread will have its own copy of g_nLock that no other thread can see or modify. As such, it doesn't make sense to modify it with an Interlocked*() function.
The same would be true for any blob you associate with a TLS index via TlsSetValue().
Note: Be carefull using __declspec(thread) in dll's, read the MS docs (this may no longer be an issue in VS2010 ?).
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
|
hi
i want system Date and time with Milli second....
iam using
SYSTEMTIME st;
GetSystemTime(&st);
this one give wrong time...please any body
|
|
|
|
|
|
In the documentation for GetSystemTime[^] it states "Retrieves the current system date and time. The system time is expressed in Coordinated Universal Time (UTC).".
It's time for a new signature.
|
|
|
|
|
I use a SMTP client class in VC6 MFC project , it function , but it bother me some warnings :
:\program files\microsoft visual studio\vc98\include\utility(21) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,std::basic_string<char,std::char_traits<char>,std::allocator<char>
>,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,int>' : identifier was truncated to '255' characters in the debug information
d:\program files\microsoft visual studio\vc98\include\utility(21) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std
::basic_string<char,std::char_traits<char>,std::allocator<char> > &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,int>' : identifier was truncated to '255' characters in the debug information
and I have #pragma warning(disable:4786) in top of file , but obvious don't function ..... how to solve these warnings ?
|
|
|
|
|
I want to do this without lowering my compiler warning level , if is posible ...
|
|
|
|
|
It is a bug in VC6. For more information see here[^].
|
|
|
|
|
Thanks , I solved the problem inserting
#pragma warning(disable:4786)
before to
#include <vector>
this class use
std::vector <std:string> Attachement;
could I fix the problem without '#pragma warning(disable:4786)' ?
|
|
|
|
|
mesajflaviu wrote: #pragma warning(disable:4786)
This would be better:
#if _MSC_VER <= 1200
#pragma warning(disable:4786)
#endif
Don't inflict hacks on compilers that don't need them.
Steve
|
|
|
|
|
mesajflaviu wrote: could I fix the problem without '#pragma warning(disable:4786)' ?
IMO, No.
This warning is caused by STL itself and you can disable it only for STL headers. See this[^] article for details.
|
|
|
|
|
How to load Png image on the button control in MFC application.
Can anybody send me some source code, please..
Thanks..
|
|
|
|
|
See answer to the message below.
It's time for a new signature.
|
|
|
|
|
Hi want to create a button on which three png images will be there, one image for the reght side corner, one for the left side corner and one strip from the middle will be there, the middle strip I have to render according to length of the button( as button length will be changeable according to the button text(for multi language support)). I did that with .bmp file but I want to know how I can do with png file. one png Image I am able to add, but how to add all three?
Please help..
Thanks..
|
|
|
|
|
You have already been given the answer here[^], which part of the suggested solution are you having difficulty with?
It's time for a new signature.
|
|
|
|
|
Hi all,
When i m trying to open CFileDialog my application becomes not responding and gives this error
unhandled exception in test.exe (SECUR32.dll): 0xC0000005 Access Violation
and poiint out in Disassembly"75DD21DC push dword ptr [edi+0Ch]"
and in call stack "SECUR32! 685f21dc()"
i m using this code for CFileDialog
CFileDialog fDlg(FALSE, NULL,NULL, OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT,"Text Files (*.txt)|*.txt||");
if (fDlg.DoModal () == IDCANCEL)
return;
please help me how can i resolve it.
thanks in advance.
|
|
|
|
|
Check that you didn't missed to call "InitCommonControls" in your application initialization function.
Put a breakpoint and find the exact location where the crash occurs, you will defiantly find a NULL pointer or HANDLE (m_hWnd).
|
|
|
|
|
You haven't show the line in this code where that causes the fault. I've got a question: have you got any shell extensions installed?
Steve
|
|
|
|
|
uhen execute DoModal() of CFileDialog,this problem occur.
what type of shell extension?
|
|
|
|
|
The kind that's crashes! Call you post a call stack?
Steve
|
|
|
|
|
Call Stack is
SECUR32! 6c9121dc()
SECUR32! 6c91232a()
SECUR32! 6c912254()
SHELL32! 769b146c()
SHELL32! 76b7a2a0()
SHELL32! 7698236f()
SHELL32! 76b7a345()
SHELL32! 76b7a41e()
COMDLG32! 763e0323()
COMDLG32! 763e23f8()
SHELL32! 76c16feb()
SHELL32! 76c16f45()
SHLWAPI! 77760f49()
SHELL32! 76a9dcbd()
SHELL32! 76a9dbf9()
SHELL32! 76a9dbf9()
SHELL32! 76a9dbf9()
SHELL32! 76a9dbf9()
SHELL32! 76a9dbf9()
SHELL32! 76a9dbf9()
SHELL32! 76a77331()
SHELL32! 76a76a23()
SHELL32! 76a76eef()
SHELL32! 76a3d57d()
COMDLG32! 763bd124()
COMDLG32! 763b92cf()
COMDLG32! 763b9783()
USER32! 7621fd72()
USER32! 76214ae0()
USER32! 7621481f()
USER32! 762226da()
USER32! 7621fd72()
USER32! 7621fe4a()
USER32! 762209d3()
USER32! 7622b759()
Test! 01010bf0()
Test! 01012983()
Test! 01010d28()
Test! 01013133()
Test! 010131c2()
USER32! 7621fd72()
USER32! 7621fe4a()
USER32! 76220943()
USER32! 7620b19f()
USER32! 76232dad()
USER32! 76232eec()
USER32! 76232f10()
COMDLG32! 763b6eb8()
Test! 0101db54()
Test! 0100daec()
Test! 010163fa()
Test! 01016609()
Test! 0100f7b8()
Test! 01013ce6()
Test! 01014770()
Test! 01010d28()
Test! 01013133()
Test! 010131c2()
USER32! 7621fd72()
USER32! 7621fe4a()
USER32! 76220943()
USER32! 76220b36()
COMCTL32! 74d2b4b2()
COMCTL32! 74d2b514()
COMCTL32! 74d2b61f()
USER32! 7621fd72()
USER32! 7621fe4a()
USER32! 762209d3()
USER32! 7622b759()
Test! 01010bf0()
Test! 01010d3f()
Test! 01013133()
Test! 010131c2()
USER32! 7621fd72()
USER32! 7621fe4a()
USER32! 7622018d()
USER32! 7622022b()
USER32! 762151f5()
USER32! 76221891()
Test! 010158cd()
Test! 01011147()
Test! 0100f795()
Test! 0100e1c4()
Test! 0101b52c()
Test! 0101b70d()
Test! 0101b577()
Test! 0101b75a()
Test! 0100fdf9()
Test! 01002863()
Test! 01045af9()
Test! 010302ba()
KERNEL32! 762ed0e9()
NTDLL! 778d19bb()
NTDLL! 778d198e()
|
|
|
|
|
This isn't very helpful without symbol names! Try in a debug build and post the stack. If it only crashes in release mode (which is a clue in itself) turn on debug information for the release build and try again.
Steve
|
|
|
|
|
This problem not occur when i run application from Code,
but it occurs when i run the Application exe from purticular location.
i really dont know how this happens,coz its occur only from some location.
please help me for this.
thanks.
|
|
|
|
|
Like I said, get a stack trace with a build that has debug information. There's little point to having a stack trace with no symbol names.
Steve
|
|
|
|
|
Hello sirs
1.Most recently we are creating Tiff compression , When I compressed the TIFF Image using LZW which is opened Microsoft document Imaging / Microsoft Picture manager but the Compression ratio is such big as compared to JPEG / Old Style JPEG.
2. When I used JPEG Compression mode , the compression ratio is good but not opened Microsoft document Imaging / Microsoft Picture manager.
3. But When I used OLD JPEG Compression mode , the compression ratio is good and also its opened Microsoft document Imaging / Microsoft Picture manager...[testing in one sample file]
But I dont know how to create OLD style JPEG compression mode in Tiff Image.
This is my problem
Please replay me !
Thanks
Failure is Success If we learn from it!!
|
|
|
|