|
neodeaths wrote: void add_new_item(grahpic_card* gc_add);
You've misspelt graphic_card as grahpic_card!
BTW, you normally pass objects by const reference rather than pointer unless you have a good reason not to.
void add_new_item(const graphic_card& gc_add);
graphic_card gc;
add_new_item(gc);
Kevin
|
|
|
|
|
neodeaths wrote: ...but it have error...
And that error would be?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Hi
Imagine you have a parent class and some derived.
Is it possible to iterate through a mixed list these child classes?
And if so how to realise this?
At last it must be possible to enter the method of the child class fi derived.
THX Tim
|
|
|
|
|
Hi Everyone,
I have an MFC (MDI) application that has been deployed over the network, windows NT/2000 & xp OS. I need to integrate the application's login session with Windows login.
So the users don't have to login separately with the application.
At present, the system(application) has its own security features, so the users has to have at least two passwords(one for windows & other for appln), now i have to give an option for users to choose Windows login(User ID & password) as default for application.
Can any one please give me an Idea or refer to an article regarding this, i'm just hopeless.
Mo
-- modified at 8:27 Saturday 7th January, 2006
|
|
|
|
|
If I understand correctly, you want the program to log the user in based on their current log-in status in Windows. Try this code:
Header file:
#if !defined(AFX_USER_H__E9C9AE42_48F3_47E0_BA0C_ECA5F0DDD558__INCLUDED_)
#define AFX_USER_H__E9C9AE42_48F3_47E0_BA0C_ECA5F0DDD558__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CQOSUser
{
public:
CQOSUser();
virtual ~CQOSUser();
HRESULT GetUserInfo(CString & strLogonDomain, CString& strUserName, CString& strLogonServer);
};
#endif // !defined(AFX_USER_H__E9C9AE42_48F3_47E0_BA0C_ECA5F0DDD558__INCLUDED_)
CPP file:
#include "stdafx.h"
#include "QOSUser.h"
#include "windows.h"
#include "assert.h"
#include "lm.h"
#include "sstream"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
CQOSUser::CQOSUser()
{
}
CQOSUser::~CQOSUser()
{
}
HRESULT CQOSUser::GetUserInfo(CString & strLogonDomain, CString& strUserName, CString& strLogonServer)
{
HRESULT hResult = S_OK;
WKSTA_USER_INFO_1* pUserInfo = 0;
NET_API_STATUS status = ::NetWkstaUserGetInfo(0,
1,
reinterpret_cast<PBYTE*>(&pUserInfo));
if (NERR_Success == status)
{
ASSERT(0 != pUserInfo);
strLogonDomain = reinterpret_cast<PCWSTR>(pUserInfo->wkui1_logon_domain);
strUserName = reinterpret_cast<PCWSTR>(pUserInfo->wkui1_username);
strLogonServer = reinterpret_cast<PCWSTR>(pUserInfo->wkui1_logon_server);
status = ::NetApiBufferFree(pUserInfo);
ASSERT(NERR_Success == status);
}
else
{
hResult = E_FAIL;
}
return hResult;
}
Usage:
CString m_strUserDomain;
CString m_strUserName;
CString m_strUserServerLogin;
CQOSUser u;
u.GetUserInfo(m_strUserDomain, m_strUserName, m_strServerLogin);
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
-- modified at 8:52 Saturday 7th January, 2006
|
|
|
|
|
Hi Jystad,
Thanks Jystad, tried your code, but there were some syntax errors, anyway thanks for the clue, i can pickup from here.
Still i'm looking for some article regarding Windows Security & their API's. Could you refer me to any article?
thanks again
Mo
|
|
|
|
|
That code works perfectly in VC6 (I posted the entire class and all the includes are for ms files). If you're using something newer, your results will most certainly vary.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
You may also find this CP article helpful:
http://www.codeproject.com/system/logonsessions.asp#xx921819xx[^]
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Do you want to consider using GINA? I don't think you can get to the username/password without doing that
Vipin - MVP
|
|
|
|
|
using named pipes appear to use the credentials of the client and only allows a connection if they have the same credentials on the server machine or domain. I have not been successful when the client is not an administrator however. I am assuming regular user accounts do not have the rights to create named pipes on WinNT but thats really just a guess.
DCOM and COM+ have some interesting authentication services that appear (I've only read about them) to provide complete windows authentication for an application or interface. It appears to have most of the authentication stuff built right in and appears fully configurable on Windows 2000 Professional and above systems. COM+ seems to have a finer granularity for configuration.
|
|
|
|
|
If I need to display thumbnails of images, can the ListView/ImageList controls handle 1000's or even 10,000's of images? Is there a preferred way to do this with these controls, or am I better off writing my own custom control for this?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
Yeah, it can do that, but the listview/ctrl isn't eaxctly a speed demon when you get much higher than 20 or 30 items.
There may even be a class here on CP that is already extend to allow more functionality than the stock MFC control.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
While it can do it, you will probably end up using the list control in 'virtual' mode. I've got a debugging tool I'm working on right at the moment that I've switched the list control to virtual. Once the control gets past a few thousand items, adding/removing items starts consuming a lot of CPU.
Software Zen: delete this;
|
|
|
|
|
Definitely use it in virtual mode. And, if you can, use a trick I learned. Use a 1-image imagelist. When the control asks for the text of the sub-item that has the image, overwrite the image in the imagelist. I even stored the images compressed and uncompress them individually when the control asked for them. Works like a charm.
|
|
|
|
|
Hi,
I have a question about net share permission of remote PC in LAN.
We all know that when we add a network share in Win2K, the default share
permission is 'Full Control for Everyone'. But it is well known that these
net share are so dangerous for LAN virus attack.
I want to check if the share permission of some net share folder includes
'Full Control for Everyone' in my app?
All OS in our LAN includes Win2K and Win NT, without Win9x.
I tried NetShareEnum() and SHARE_INFO_502,but it seems that I could not get
the share permission property.
Any helps?
Thank you in advance.
|
|
|
|
|
Try to find a place to download the WFC library (by Sam Blackburn). There's a class in that lib that I think does exeactly what you need. The lib itself contains a lot of useful NT (and therefore XP) system stuff in it.
If you can't find it, let me know and I'll setup a place for you to download the copy I have.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Try to find a place to download the WFC library (by Sam Blackburn).
http://www.samblackburn.com/wfc/index.html[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Use NetShareEnum to enumerate the network shares on your server. Level 2 will give you the local path for each shared folder.
It sounds like you really want to know the permissions granted to the 'Everyone' group for each shared folder. For this, you will need to examine the access control list (ACL) for the shared folder. Use GetFileSecurity or GetNamedSecurityInfo to retrieve the discretionary access control list (DACL) for the folder. If you look in the MSDN here[^] you can find information on security, ACL's, etc.
Software Zen: delete this;
|
|
|
|
|
|
Sir
i want to know how to increment a int value when i press and hold a button , if i release the button increment must
stop. please help me to solve this problem.
thank u
Satishvarma
|
|
|
|
|
Try GetAsyncKeyState function!!!
|
|
|
|
|
|
E.Satish wrote: i want to know how to increment a int value when i press and hold a button , if i release the button increment must
stop
I don't want to blow my own horn, but here is my solution to this from years ago:
Simple Auto-Repeat (Fire Control) Button Control: http://www.codeproject.com/buttonctrl/repeatbutton.asp[^]
I haven't had occasion to use this since VC6 but it shouldn't be difficult to adapt to your needs.
|
|
|
|
|
how to transfer control to child thread repetedly.
please give me sollution ASAP
Bankey Khandelwal
Mobile : 98504-32990
Office : 020 25521888
Solversa Technologies
15, Yeshwant Ghadge Nagar,
Range Hill Road,
Pune - 03,Maharashtra,India.
|
|
|
|
|
Hello,
How do you mean "transfer control to child thread"? Why do you want to do this? The OS does this for you repeatedly...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|