|
Thank you all very much for your posts. Every little bit helps. I think I'm really starting to like this site as this is the second time I've made a post and got responses both times!
Thank you.
|
|
|
|
|
One thing to understand is that in ALL languages a character is a number. With C/C++ it's just more obvious about it. In pure C/C++ and Assembly, you are simply doing manually what high level languages do behind your back. (With CString and string in C++, you can also treat strings as "abstract" objects.)
* * *
For the text file question, look at cout , and its cousins, though I vastly prefer printf()/fprintf() and its cousins.
printf("%02d%04d/%02d/%02d%02d:%02d:%02d and so on
(One variant of this is printf("%.2d%.4d/%.2d/%.2d%.2d:%.2d:%.2d . I prefer the former, but you will run into the latter and should be aware of it.)
|
|
|
|
|
I need to remove security descriptors from certain registry keys.
What functions would be of interest for this operation?
( The problem is that even the administrator is being denied access to change key values, and I am going to try to manually remove all descriptors, hoping that this might fix it. )
|
|
|
|
|
Seems unlikely that'll work - you'll get 'access denied' status returns, I would have thought.
However, I think these should be of use - GetNamedSecurityInfo[^] to retrieve something's ACL, SetEntriesInAcl[^] to create a new ACL from that ACL, DeleteAce[^] to delete an ACE from an ACL and SetNamedSecurityInfo[^] to set the new ACL on the object.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank you for the information.
|
|
|
|
|
|
Thanks very much for those links. I'll read them carefully.
|
|
|
|
|
Hi All
i am posting one url with setting this "x-microsoftajax;Delta=true" header but i am getting "400" http error code, can someone please give me suggestions on it.....
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Can anybody tell my why MDI framework do not cross over through OnActivateFrame(int nCmdShow) ? I build a MDI test application ( doesn't matter CView based on ) and I override CMainFrame::OnActivateFrame(int nCmdShow) where I put a TRACE0("\n Here cross over OnActivateFrame \n"); statement and compile in Debug version , but Output window doesn't show anything ... can you tell my why ?I mention that SDI framework haven't this problem ...And for what I need that handler : to memorate window position ...
|
|
|
|
|
OnActivateFrame is an overridable method of CView, NOT the frame window class.
You may find OnActivate is the overridable method you're look for.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Good catch ! And in case that I not load a child window like this :
if(CCommandLineInfo::FileNew == cmdInfo.m_nShellCommand)
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
where should I load WINDOWPLACEMENT structure ? Anyway , thanks for answer !!
|
|
|
|
|
In the main frame's OnCreate, after you've called the base classes OnCreate handler, I would have thought.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Ok, I will try that , and let you now what I settle down ... thanks again !
|
|
|
|
|
Hello,
When I enter the left arrow key or the right arrow key nChar = 39 or 38 for the OnKeyDown() but nChar = 13 for OnKeyUp()
void CRICH::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
}
void CRICH::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
}
Why there is a change in nChar value for both the functions
Thanks
Pritha
|
|
|
|
|
What view base class were you using? It's entirely possible that the base class could be using PreTranslateMessage or something to alter the OnKeyUp handler?
I tried this with a view class derived from CView and the character code was always the same in OnKeyUp as in OnKeyDown.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hey thanks
But can you please tell me what is the use of PretranslateMessage(). I searched for it but didnt get any proper answer.
Pritha
|
|
|
|
|
See the documentation[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Dear all,
I am facing quite an annoying problem I can't solve. I have a std::valarray<MyT>, where MyT can be anything, and I need slices of it to work locally on them.
If the elements MyT contained in the valarray are big (not to say HUGE), the usage of std::slice is quite inconvenient, since temporary copies of the objects are created in the slice.
Same problem in case MyT is small (let's say MyT = int), but the slice contains a large number of elements, let's say 1e4 or 1e5.
An approach using references would be much more efficient than std::slice in my opinion (+ it would allow to modify the elements contained into the valarray), but I don't know how to implement an object like this. The only alternative to that I have in mind is to use std::valarray<T*>, but I don't really like the pointer syntax and I'd prefer to avoid it.
Any suggestions, please?
Thank you in advance to anybody willing to help & best regards
|
|
|
|
|
What specific capabilities of valarray are you using that make you prefer it to std::vector? Because I'd tend to prefer using std::vector (which is, post-TR1, guaranteed to store its data as an array) and represent slices as pairs of iterators.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Well, from some performance test I made quite a while ago (using MSVC++ 2005) I noticed that reading/writing into a std::valarray was quite noticeably faster than using std::vector. Since I am working on a numeric application which has to handle quite large amounts of data, the fastest container seems the most natural choice. Apart from execution time, there are no other reasons.
Shall I re-run my performance test using a compiler better than MSVC++ 2005?
Stuart Dootson wrote:
using std::vector (which is, post-TR1, guaranteed to store its data as an array)
What does this sentence exactly mean? What would happen scanning a pre-TR1 std::vector with an iterator? Or, perhaps worst, using pointers? Access to wrong memory places?
Thanks a lot for your suggestions!
|
|
|
|
|
Presuming a pre-allocated vector, read/write times should be the same for a valarray or a vector, I believe.
Pre-TR1, vectors were not guaranteed to store their elements in contiguous storage. They did, because that was the only reasonable implementation. That guarantee was added to TR1, meaning that you could rely on it being true, rather than having to know what your particular STL implementation did.
misterMF wrote: What would happen scanning a pre-TR1 std::vector with an iterator? Or, perhaps worst, using pointers? Access to wrong memory places?
Iterators are fine - they're guaranteed to be, so long as you don't change the number of elements in the vector. Pointers? Practically, you'd be fine, but you couldn't guarantee that using the standard.
BTW - you'll probably also find significant performance improvements by turning off checked iterators[^]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks a lot for the explanations!
Stuart Dootson wrote: Presuming a pre-allocated vector, read/write times should be the same for a valarray or a vector, I believe.
That's what I believed too, but I remember I noticed differences for large size arrays. Now it's a bit too late( ), but tomorrow I'll re-check read/write times for valarrays and fixed-size vectors.
|
|
|
|
|
You can't have an array of references as far as i know. You could try having an array of objects who have references to your "MyT-s" maybe. But why don't you like pointers? You can create a reference out of a pointer wherever you need to access the pointed object if you don't want to use the -> operator.
MyT &mightyReference = *mightyPointer;
mightyReference.Hello();
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Yes, I know that it's not possible to have an array of references (unfortunately).
Maybe the solution is to have an array of pointers and then to use the trick you suggest to make these pointers to look like references.
By the way, it's not that I really hate pointers, but I think that while going on with code development I'll have to create objects able to intereacte either with valarray<MyT> or with its slices (with same rules and same results). An example can be the following:
std::valarray<MyT> A(20);
std::valarray<<MyT> > B(10);
slice<std::valarray<MyT> > C(A,parameters);
C += B;
Thanx!
|
|
|
|