|
Thanks Mike,
The article does confirm what I got from the book. What I am still missing is how to get to the base class using debug steps.
I must be missing some options in my VC 6.0 because F11 just does not do anything visible and the program is stuck in last debug point. I will try just source code of the MFC base class next.
Vaclav
|
|
|
|
|
Up to a point, I think at the Win32 level, there is no more visible "code" to step into.
This signature was proudly tested on animals.
|
|
|
|
|
After raking a short brake from coding I came to the same conclusion.
It always amazes me how taking breaks from many “problems” gives person a different outlook on things. Was that covered in some famous book?
Thanks for your help.
Vaclav
|
|
|
|
|
I would like to use the CMFCtoolBars to replace CToolBars, so I am guessing I need to integrate the Feature Pack to my MFC application. Do I have to change all the base classes(CStatusBar, CWinApp...etc) to those from the feature pack if I only wanted to change the CToolbar, or can I change CToolBar only and still get it to work?
Thanks
|
|
|
|
|
I think you can just "plug'n'play".
This signature was proudly tested on animals.
|
|
|
|
|
I created a test application using LsaEnumerateLogonSessions and LsaGetLogonSessionData, which displays the number of interactive logged on users. It works fine on Windows XP, but it displays 2 interactive logged on users on Windows Vista, even though I have only one user: the Administrator.
Can anyone tell me why this happens?
Thanks!
|
|
|
|
|
Eikthrynir wrote: ...but it displays 2 interactive logged on users on Windows Vista, even though I have only one user: the Administrator.
Is the other a legitimate user, just not logged on?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I modified the application so that it displays also the user name. It's the same user...
|
|
|
|
|
The LogonId data members are different, even though the UserName data member are the same...
|
|
|
|
|
So it's showing Administrator twice? When I use that function on XP, it returns 6 sessions, even though I am the only one logged on to my machine. I don't have access to a Vista machine to see how it behaves.
What do NetWkstaUserEnum() and WTSEnumerateSessions() return?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
No need to check. I think I known what's happening. I modified the application to display other information too. The SessionId for each occurence of MyAdminUser is different: it runs both in Session 0 and Session 1 and that's why it is shown twice. On Vista (I guess Window 7 too) I only have to skip counting the user running in Session 0. Thus, I get the correct number of interactive logged on users. As I have seen, on Windows XP there is no need for this trick.
I consider this problem solved now.
But there is something strange that happened while I was testing on my Vista machine: I had MyAdminUser and MyLimitedUser both logged on; my application showed 3 users (Session 0 (MyAdminUser), Session 1 (MyAdminUser), and Session 2 (MyLimitedUser)); I logged off from MyLimitedUser and immediately ran the application; it still showed 3 users; after almost minute, when I re-ran the application, it correctly showed 2 users: MyAdminUser (Session 0) and MyAdminUser (Session 1). What I am trying to say is that it showed 3 users for almost a minute...
The strange thing is that I could not reproduce the problem. I tried to make it happen again, but I couldn't. I wonder why Windows needed so much time to update the number of interactive logged on users...
|
|
|
|
|
Eikthrynir wrote: I wonder why Windows needed so much time to update the number of interactive logged on users...
Caching?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi All,
I am having COLORREF variable and i need to apply 60% alpha value to this color.
COLORREF clrSelection = RGB(255,65,67);
My requirement is to apply alpha value as 64 to the 'clrSelection' variable. How to do this in C++,MFC?
Thanks in advance,
Mutpan.
|
|
|
|
|
AFAIK, you need to use GDI+ inorder to use alpha.
But you can keep the alpha value in COLORREF as
COLORREF clr = RGB( 1, 2, 3 );
BYTE alpha = 4;
clr |= ( alpha << 24 );
- ns ami -
|
|
|
|
|
I've got unmanaged DLL that is being called from C# application using Interop. I need to step into native DLL function either from C# or debug native DLL and break at some break point.
I set up Enable unmanaged code debugging in C# console.
The DLL function is called correctly, e.g. it prints the message to console.
But as I run DLL with F5 and it invokes C# console, the break points do not work.
Nor can I step into DLL unmanaged code from C# console.
Чесноков
|
|
|
|
|
Dear all,
I have got some source codes where used lots of EXIT_SUCCESS and EXIT_FAILURE for return values. I knew these EXIT_SUCCESS and EXIT_FAILURE are defined in stdlib.h/cstdlib.h; however, I don't see the source including both of the header files.
Of course, the source may include a header which include stdlib.h/cstdlib.h.
My question is how I can find where exactly the stdlib.h/cstdlib.h have been included.
Thanks.
|
|
|
|
|
BTW, I am using Visual Studio 2005.
|
|
|
|
|
Set the "Generate Pre-Processed File" option (Project Properties->Configuration Properties->C/C++->Preprocessor) to "With Line Numbers (/P)" and examine the .i files that are generated. These will be annotated with '#line items that indicate the original file that code came from.
[edit]Look for stdlib.h and you can find what includes it. afx.h, as far as I can tell.[/edit]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I'm looking for a method that mimics the functionality of fread without a file pointer. I want to read from a buffer into a buffer, for a number of bytes and move the pointer to the source buffer by the number of bytes returned - like fread.
Anyone done anything like this?
Thanks in advance
Jer 29:11
|
|
|
|
|
BYTE* pDest = <Destination Buffer>;
BYTE* pSrc = <Source Buffer>;
SIZE_T size = <Size to Read>;
MemoryRead(pDest, pSrc, size);
SIZE_T MemoryRead(BYTE* pDest, BYTE* pSrc, SIZE_T size)
{
CopyMemory(pDest, pSrc, size);
pSrc += size;
return size;
}
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Very cool and to the point. The key was to return the size - like fread.
Thanks much
Jer 29:11
|
|
|
|
|
I spoke too soon!
Actually, it doesn't quite work like fread. CopyMemory - defined as RtlCopyMemory needs size as an input. fread on the other hand returns the number of bytes read.
Thanks for responding but I still don't have the solution.
Jer 29:11
|
|
|
|
|
The reason is very clear. A file has an end and when you give a size, it will read either the mentioned size or till the end of the file. But a memory read either succeeds or fails.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
OK.
I just thought that there was a solution -perhaps you did too. I guess there's no way to do this
Jer 29:11
|
|
|
|
|
I use VC++9.0/VS2008. It seems template cannot work with operator. In Conversion Function, the operator's name cannot be or with template. Compiler probably doesn't have ability to deduce it. But the following code is really compilable in VC++6.0, which CString doesn't have template. Any suggestion? Thanks in advance!
Here is my code:
class TestString {
CString m_str;
public:
TestString(TCHAR* str):m_str(str) {}
operator CString() const {return m_str;}
};
int main(void)
{
TestString t1(_T("test1"));
TestString t2(_T("test2"));
CString strTest = t1 + t2;
return 0;
}
And Here is the error message:
1>------ Build started: Project: Test, Configuration: Debug Win32 ------
1>Compiling...
1>Test.cpp
1>c:\build\test\test\test.cpp(19) : error C3767: '+': candidate function(s) not accessible
1> could be the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(653)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(664)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(675)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2034)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2043)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2052)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2061)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2071)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2081)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2091)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(653)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(664)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(675)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2034)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2043)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2052)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2061)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2071)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2081)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2091)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(653)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(664)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(675)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(653)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(664)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(675)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2034)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2043)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2052)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2061)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2071)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2081)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2091)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2034)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2043)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2052)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2061)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2071)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2081)' : '+' [may be found via argument-dependent lookup]
1> or the friend function at 'c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2091)' : '+' [may be found via argument-dependent lookup]
1>c:\build\test\test\test.cpp(19) : error C2676: binary '+' : 'TestString' does not define this operator or a conversion to a type acceptable to the predefined operator
1>Build log was saved at "file://c:\Build\Test\Test\Debug\BuildLog.htm"
1>Test - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
modified on Tuesday, July 21, 2009 6:35 AM
|
|
|
|