|
LookupAccountSid() is but one way. NetUserGetInfo() is another.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
This is good, but it seems to work only for local users. It doesn't work for a user on a diffrent domain for exaple if my computer name is "Station" and it belongs to the "LAN" domain and there is a user on the domain "LAN" called "globalUser" and a user on the local machine called "localUser", the function fill fail if I try to look up the user "LAN\globalUser". Even more, NetUserEnum() will not show the user called "globalUser".
|
|
|
|
|
I can use the following to get all users on my PDC:
LPUSER_INFO_0 pUserInfo = NULL,
pUserInfoTemp = NULL;
NET_API_STATUS nStatus;
DWORD dwIndex,
dwEntriesRead,
dwTotalEntries,
dwResumeHandle = 0;
CString strText;
nStatus = NetUserEnum(_T("\\\\tulsant"), 0, 0, (LPBYTE *) &pUserInfo, MAX_PREFERRED_LENGTH, &dwEntriesRead, &dwTotalEntries, &dwResumeHandle);
if (nStatus == NERR_Success || nStatus == ERROR_MORE_DATA)
{
pUserInfoTemp = pUserInfo;
if (NULL != pUserInfoTemp)
{
for (dwIndex = 0; dwIndex < dwEntriesRead; dwIndex++)
{
if (NULL == pUserInfoTemp)
break;
strText = pUserInfoTemp->usri0_name;
m_cbUserList.AddString(strText);
pUserInfoTemp++;
}
}
}
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Yes, this works fine for local users but I want to list even the users on other domains. It must be possible beacause in Win2000 when I go to "Control Panel\Users and Passwords\Add\Browse"
it shows me a list of all users on my domain but NetUserEnum() only enumerates the users that are stored on my computer.
|
|
|
|
|
The code snippet I provided is for iterating the userlist on the listed domain controller. If it is not working for you, something else is at play. How are you using the NetUserEnum() function?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
NetUserGetGroups or IADsUser::Groups
|
|
|
|
|
I want to do some printing randomly, each time print a single line.
When I use EndDoc() or Escape(ENDDOC), the printer ends a page.
How could I do printing like the POS terminal printer?
|
|
|
|
|
When printing, anything rendered to the printer HDC between calls to the StartPage()/EndPage() calls will be printed for that page (as long as its on the actual printable area).
So you would be doing something like:
StartDoc()
while (pages_to_print)
{
StartPage()
while (output_for_this_page)
{
print_a_line
}
EndPage()
}
EndDoc()
If you need to print like a terminal, you need to keep track of the current Y position on the page. After every line printed, you increment y value by the height of the line. When y > pageHeight, you end the current page and start a new one.
StartDoc()
while (pages_to_print)
{
StartPage()
y = 0
while (output_for_this_page)
{
print_a_line at 0,y
y += lineHeight
}
EndPage()
}
EndDoc()
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
But if I do not call EndPage() or EndDoc(),I could not get the line.
I want to see something printed when I print a line. How? Thank u!
|
|
|
|
|
StartDoc / EndDoc - designed to protect multipage documents from interspersed with others. PrintJob is suspended until EndDoc is called.
>How could I do printing like the POS terminal printer?
For remote spoolers - you can not, should not, and will not be allowed to; local - open device e.g. par port/usb and write directly. Even if local with direct write it still likely not work with most modern printers: laser printers, etc ....
Brian
|
|
|
|
|
Hi
I have the following problem:
I have a client where there is defined a network connection (mapping) to another computer. This is active when you double click the drive otherwise you see that red cross in the explorer just below the driveletter.
I have searched the web on how i can automatically restore the connection .. i have come accross the following link:
'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wnet/wnet/wnetrestoreconnectionw.asp'
This is about the SDK 'WNetRestoreConnectionW'. There are almost no examples of using this SDK + this SDK won't work on Win95, 98 and Me computers.
Any good way of solving this problem?
Best regards
Jens
|
|
|
|
|
Considering all the desing guidelines of safe programming including exception handling, just wondering do we actually write the handler for each and every possible error/excepion in our code? Its certainly a good practice but how practical it is in terms of LOC that we put for handling the errors which may never occur as well.
Just consider this piece of code
LPTSTR l_strResConn = new TCHAR[NAME_LENGTH];
//check over the value
int l_nRet = LoadString(theApp->m_hInstance,....)
For every loadstring, I should check for the value of l_nRet. But practially in my code, I've just ignored it at every place.
|
|
|
|
|
You should start by writing ony a few than as you go along fixing bugs you end up writing all of 'em
Make ur own judgement and use common sense (but as you know common sense is not so common ! )
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Hi,
I have developed a custom activex control.when i try to register this activex control using the command regsvr32,i get the message "LoadLibrary("mystrings.ocx")failed.The specified module could not be found.
can some one tell me why this message comes and what is the solution for this.This message comes only in few machines.registration is successful in most of the machines.
Thanks in advance
|
|
|
|
|
Does ur OCX have any dependecies that might now be present at some machines ?
if there are you need to copy them as well
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Use Depends.exe that comes with visual studio to check wheather your module is able to get all the dlls that it depends on. i.e ? against a certain dll means that dll is not accessible and hence the registeration is failing.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
I may be stating the obvious, but did you try regsvr32 "C:\YourFullyQualified\PathToOcx\yourocx.ocx" ?
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Hi All,
Thanks for your answers.regsvr32 was not able to find one of the dependent modules.I had to copy both to a specific folder and register using absolute path of my ocx file
Thanks once again
Raghu
|
|
|
|
|
Dear all,
In the main application I use CDatabase to connect to SQlServer.After this, I pass the pointer to a variable in a dll using a function.
When I try to use ExecuteSQl or I try to open a CRecordset, the program fail with access violation in release version. If I use the debug version of the main program and the dll everything is fine.
Can you help me please with a solution to this issue?
Thank you very much.
|
|
|
|
|
Are you checking the pointer against NULL before dereferencing it?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Yes, the pointer is null in release version....
I don't have any ideea why...
|
|
|
|
|
Sorry, the pointer is not NULL...I have tested a diffrent pointer there.
The IsOpen() member of CDatabase work OK.The ExecuteSQL does not work I get an can not read at specified adress...
|
|
|
|
|
In the main program I use CCriticalSection and I submit the pointer to the dll. If I try to ust m_db->ExecuteSQL("SELECT * FROM TABLE1") in the dll I got the message "Connection in use".Why?
|
|
|
|
|
Hi
What service pack does msoutl85.h msoutl9.h and msoutl.h and their libs come in please?
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
I have a problem: I have a single document based MFC application for viewing images. At first I used CScrollView as base class, which worked well with formats supported by IPicture and tiffs. But now I would like to see also PDF -files, which seems to be possible with CHtmlView, it simply opens an Acrobat reader and attaches it into the form with navigate2 -function. But if I use navigate2 -function for bitmaps and tiffs, they don't seem to be attached to the form, but they'll be opened in a window of their own. And if I use the Render function of IPicture to draw images onto the form, they just flash on the screen and then disappear. It seems that the OnDraw() -function of CHtmlView won't be called automatically. Could anybody help me with this? Thank you.
|
|
|
|