|
Do you mean my WDJ article, or something I wrote here ? My WDJ article impliments a replacement for AlphaBlend, and you should use that, even if you don't have OS worries. Mine don't leak memory......
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Oops, sorry - I read through your reply too fast. I was talking about the mpeg app. I will see if I can find your article.
Thanks again.
|
|
|
|
|
The article is here:
http://www.windevnet.com/documents/s=7628/wdj0109b/0109b.htm[^]
but the code that was published was an early version and leaks memory ( this was my first ever non-MFC Windows code and I took a few tries to figure it all out ). The ammended code is here:
http://www.windevnet.com/documents/s=7255/wdj0111j/0111j_l1.htm[^]
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Is it possible to call a specialized function of a base class ?
I mean:
class A
{
protected:
virtual int f() { return -1; };
public:
void DoFunc() { printf("\nValue: %d",f()); };
};
class B : public A
{
protected:
virtual int f() { return 1; };
};
int main()
{
B Inst;
Inst.DoFunc();
}
pure virtual function does not help because the MFC macro IMPLEMENT_DYNCREATE makes the
compiler think it get instantiated.
Is it possible to get the class A to print 1 instead of -1 ?
|
|
|
|
|
This code should print 1. I went as far as to try it myself and it does.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
I didnt know of that.
I always thought the function of the current namespace would be used.
Just tested it. It works. cooool
Thanks
|
|
|
|
|
No problem. That's what the virtual keyword is for, in front of your f() function. I suggest you read up on it.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
You mean?
A.DoFunc() == 1
No, class A knows nothing about class B.
B on the other hand knows about A because it is derived from it.
|
|
|
|
|
I wrote Inst.DoFunc() in the example.
This was not obvious to me. Inst.DoFunc() does indeed ignore f() member
in class A and uses the derived f() from B.
|
|
|
|
|
If it is public or protected it will work.
Jason Henderson start page ; articles
henderson is coming
henderson is an opponent's worst nightmare
* googlism *
|
|
|
|
|
You should have a new public (not private or protected) member function in class B, inside which you would call A's DoFunc() function...
There are no failures; there are only extended learning opportunities.
|
|
|
|
|
If you want to guarantee that the base class version will be called, rather than a virtual one from a derived class, you can do the following:
class A
{
protected:
virtual int f() { return -1; };
public:
void DoFunc() { printf("\nValue: %d",A::f()); };
};
Software Zen: delete this;
|
|
|
|
|
Hello!
After some fights with the taskbar at last I've been able to resize windows properly...
- If I use ShowWindow(SW_MAXIMIZED); then the window first appears on the normal workarea (up the taskbar) and then it gets well positioned all over the full screen (flickering).
- If I use:
<br />
this->SetWindowPos(&wndTopMost,0,0,::GetSystemMetrics(SM_CXSCREEN),::GetSystemMetrics(SM_CYSCREEN),SWP_SHOWWINDOW);<br />
this->ShowWindow(SW_SHOWMAXIMIZED);<br />
then the window is displayed properly and it gets maximized, but I can continue moving it.
PS:
it only don't work under win2k... unfortunately it's the OS in which the app must be installed.
Is there any way to make a window stay at the place in which I've left it?
thank you very much for your help!
|
|
|
|
|
You can do this:
Add the following to your message map:
ON_WM_NCLBUTTONDOWN()
Add the following to the //{{AFX_MSG section of the window header:
afx_msg void OnNcLButtonDown( UINT nHitTest, CPoint point );
Implment the following:
void CYourWindow::OnNcLButtonDown( UINT nHitTest, CPoint point )
{
}
When I did this, the window could not be dragged......
But, you'll need to do some work to get the caption buttons and system menu buttons to work......But this is a start......
Just trying to keep the forces of entropy at bay
|
|
|
|
|
Actually, all you need to do is in the non client click handler....i tested it with a dialog but any cwnd should do:
void CDummyDlg::OnNcLButtonDown( UINT nHitTest, CPoint point )
{
// swallow caption hits, let all others go through.....
//
if ( nHitTest != HTCAPTION )
CDialog::OnNcLButtonDown( nHitTest, point );
}
Just trying to keep the forces of entropy at bay
|
|
|
|
|
Direct, Easy and now working for me!
thanks!
|
|
|
|
|
You can also override WM_MOVING and WM_SIZING to force (or disallow) selective motion (hugging an edge, resizing to specific sizes only, etc).
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
infect i want to halt ctrl+alt+del after writing my gina dll?
but i could not sucessed yet.
can any body provide the link of related examples?
i have searched a lot but i could not sucessed to find it out .
i need some gina examples.
r00d0034@yahoo.com
|
|
|
|
|
Bonjour,
All you need I think ...
http://msdn.microsoft.com/msdnmag/issues/02/09/CQA/default.aspx
Simplicity is the supreme sophistication.
-------------------------------------------
http://www.borie.org/
|
|
|
|
|
|
i have used this function, it return sucessfully but the system is not login and desktop did not appear.
is there any step remains ?
or is there any mistake?
if yes plz tell.
i will be very thank full to you.
BOOL Successful;
HANDLE AccessToken;
DWORD ErrorCode;
char *BufferPtr;
::SetCursorPos(20,20);
Successful = LogonUser ("super", ".", "super", LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, &AccessToken);
r00d0034@yahoo.com
|
|
|
|
|
there are plenty of examples in MSDN that shows you how to implement that stuff...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I posted a threaad earlier on, but I still have probs
I need to enter a username, password and domain. Then it needs
to validate this info from a server (permissions, privileges,
groups etc..).
The code below works fine to logon to windows, but I need to check whether a user is part of a particular group? CAn anyone shed any light into the matter.
int AttemptLogon()
{
HANDLE hUser;
TOKEN_STATISTICS TStats;
TOKEN_GROUPS * pGroups;
PSID pLogonSid;
PLUID pLogonId;
HANDLE hUserToken;
DWORD size;
MiniAccount stAccount;
pLogonId = new LUID;
pLogonSid = new SID;
strcpy(stAccount.szUsername, "eric");
strcpy(stAccount.szDomain, "cognitronics");
strcpy(stAccount.szPassword, "");
if (LogonUser( (LPTSTR)stAccount.szUsername,
(LPTSTR)stAccount.szDomain,
(LPTSTR)stAccount.szPassword,
LOGON32_LOGON_INTERACTIVE,
LOGON32_PROVIDER_DEFAULT,
&hUser))
{
hUserToken = hUser;
//
// Now, grovel the token we got back for interesting
stuff:
//
GetTokenInformation(hUser,
TokenStatistics,
&TStats,
sizeof(TStats),
&size);
*pLogonId = TStats.AuthenticationId;
pGroups = (TOKEN_GROUPS*)LocalAlloc(LMEM_FIXED, 1024);
if (!pGroups)
{
CloseHandle(hUser);
return(WLX_SAS_ACTION_NONE);
}
//
// The tricky part. We need to get the Logon SID from
the token,
// since that is what Winlogon will use to protect the
windowstation
// and desktop.
//
GetTokenInformation(hUser,
TokenGroups,
pGroups,
1024,
&size);
if (size > 1024)
{
pGroups = (TOKEN_GROUPS*)LocalReAlloc(pGroups,
LMEM_FIXED, size);
GetTokenInformation(hUser,
TokenGroups,
pGroups,
size,
&size);
}
int n = pGroups->GroupCount;
for (int i = 0; i < pGroups->GroupCount ; i++)
{
if ((pGroups->Groups[i].Attributes &
SE_GROUP_LOGON_ID) == SE_GROUP_LOGON_ID)
{
CopySid(GetLengthSid(pLogonSid),
pLogonSid,
pGroups->Groups[i].Sid );
break;
}
}
LocalFree(pGroups);
return(WLX_SAS_ACTION_LOGON);
}
delete pLogonId;
delete pLogonSid;
int nLastError = GetLastError();
return(WLX_SAS_ACTION_NONE);
}
Does anyone have any ideas or sample source code.
Thankyou for your time
Rich
|
|
|
|
|
sorry for Inconveniences.
but plz solve my problem.
you say?
The code below works fine to logon to windows, but I need to check whether a user is part of a particular group? CAn anyone shed any light into the matter.
but the important thing for me is that you say
"The code below works fine to logon to windows"
did desktop appears after using this code please ans the above thread thats my question?
i will be very thank full to you.
r00d0034@yahoo.com
|
|
|
|
|
Richard Hudson wrote:
The code below works fine to logon to windows, but I need to check whether a user is part of a particular group? CAn anyone shed any light into the matter.
You can use some of the net* functions to check to see if a user is in a group.
I'm sorry, but I don't remember the exact function right now...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|