|
NetUserChangePassword
is not for Win 9X Systems
the foll. is from the MSDN.
Requirements
Windows NT/2000 or later: Requires Windows NT 3.1 or later.
Windows 95/98/Me: Unsupported.
Header: Declared in Lmaccess.h; include Lm.h.
Library: Use Netapi32.lib.
|
|
|
|
|
OOPS!! I am sorry. You are right.
I recollect it now (I just opened the my old project code in soursafe
).
While changing the passwords, what I did was: For Win 9x I loaded Mpr.Dll and used some functions like PwdSetPasswordStatus, PwdChangePassword to change the network password. For other OSs I loaded NetApi32.Dll.
bye bye.
|
|
|
|
|
Srini Kella wrote:
I woudl like to be able to send their username and password to a server and validate it.
I understood you would like to validate user at the server
I guess your server is not running Win9x, so that scenario could work.
|
|
|
|
|
I'm learning MFC trough internet so I don't have a book. But I haven't found any tutorial on how to make a simple "open file" dialog. Where can I find one? Thanks
|
|
|
|
|
Just take a look here:
http://msdn.microsoft.com/library/en-us/vcmfc98/html/_mfc_cfiledialog.3a3a.cfiledialog.asp
http://msdn.microsoft.com/library/en-us/vcmfc98/html/_mfc_cfiledialog.3a3a.domodal.asp
Best regards,
Vladimir
|
|
|
|
|
I'm using CSTScreenBuffer class to load image and get bitmap handle, and I'm
manipulating bits to display Images on windows-CE based paltform( pocket PC2002).
It just works fine while i'm using small sized JPG images (around50-60KB)
, but it has problem with big sized JPG images.
i can't get any valid bitmap handle at all. handle is always NULL!!!
i tried so many ways to solve this problem all weeks.
can anybody give me any clue for this trouble!!!
Of course, i used VOImage class for my project. But it has low speed and quality...
And one more question - can i use memory-mapped related functions to read
JPG image file? i tried, but it failed. ((->>jpeg_read_header(&cinfo, TRUE);))
here's my source code
//*********************************************************************8
HBITMAP CPhotoListCtrl::LoadJPG(CString strFilePath)
{
CSTScreenBuffer sts;
FILE * pFile;
JSAMPARRAY pBuffer;
int nRowSize;
ByteArray imageData(320*240*3);
struct jpeg_error_mgr jerr;
struct jpeg_decompress_struct cinfo;
if ((pFile = _tfopen(strFilePath, _T("rb"))) == NULL) {
CString strError;
strError.Format(_T("Can't open file '%s'"), strFilePath);
AfxMessageBox(strError);
return 0;
}
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_decompress(&cinfo);
jpeg_stdio_src(&cinfo, pFile);
jpeg_read_header(&cinfo, TRUE);
jpeg_start_decompress(&cinfo);
nRowSize = cinfo.output_width * cinfo.output_components;
pBuffer = (*cinfo.mem->alloc_sarray)
((j_common_ptr) &cinfo, JPOOL_IMAGE, nRowSize, 1);
while (cinfo.output_scanline < cinfo.output_height) {
jpeg_read_scanlines(&cinfo, pBuffer, 1);
imageData.Append(pBuffer[0], nRowSize);
}
//************************************************************
HBITMAP hBitmap = sts.CreateBitmapByRGBArray(imageData.GetData(), cinfo.output_width, cinfo.output_height);
//***********************************************************
// ======>>> hBitmap is NULL !!!!
jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
fclose(pFile);
return hBitmap;
}
//*********************************************************************
|
|
|
|
|
Anyone got the function to do this? Its a pain in the arse!
Cheers.
Pete
|
|
|
|
|
time_t mktime(struct tm* ptr);
Maxwell Chen
People say "No news is good news". Then, no code is good code!?
|
|
|
|
|
|
There's probably a simple explaination..
On my spin button when I press the down arrow it increments the integer value in an edit box and when I press the top arrow it decrements it. How do I fix it so that up means up and down means down!
Thanks.
|
|
|
|
|
Assign a variable of type CSpinButtonCtrl (, and SetRange32(...) ), then it becomes what you want it to be......
Maxwell Chen
People say "No news is good news". Then, no code is good code!?
|
|
|
|
|
Excerpt from MSDN for CSpinButtonCtrl
Anonymous wrote:
"
Note The default range for the spin button has the maximum set to zero (0) and the minimum set to 100. Since the maximum value is less than the minimum value, clicking the up arrow will decrease the position and clicking the down arrow will increase it. Use CSpinButtonCtrl::SetRange to adjust these values.
"
|
|
|
|
|
have a program that has two views . rich edit view and edit view . I have done some syntax coloring in the rich edit view. But the probelm is that when I use the keys ctrl-x and ctrl-v in edit view the program gives debug assertion failure sighting some error in the viewrich.cpp . Can anyone help me
Samir Sood
Samir Sood
|
|
|
|
|
|
Hi..
I write a miltithreaded MFC application so a worker thread
performs a lengthy operation.
I want the worker thread to notifty the UI thread when it
finishes the operation. So I use SendMessage()
function.
the code is something like this:
<br />
class CInfo
{<br />
public:<br />
HWND hwnd;<br />
}<br />
In the dialog class :
<br />
private:<br />
CWinThread* m_pThread;<br />
CInfo info;<br />
<br />
void CMyDlg::OnStartWorkerBtn()<br />
{<br />
info.hwnd=this->m_hWnd;<br />
m_pThread=AfxBeginThread(CWorker::Work,&info,<br />
THREAD_PRIORITY_NORMAL,0,CREATE_SUSPENDED);<br />
<br />
m_pThread->m_bAutoDelete=FALSE;<br />
m_pThread->ResumeThread();<br />
}<br />
<br />
void CMyDlg::OnWorkerMessage()<br />
{<br />
}<br />
The worker thread code:
<br />
UINT CWorker::Work(void* arg)<br />
{<br />
CInfo* info=(CInfo*)arg;<br />
<br />
<br />
<br />
SendMessage(info->hwnd,WM_USER+1,0,0);<br />
}<br />
The code works fine in the debug version but an ( Access
violation ) error occures in the release version when the UI
thread receives the message while dragging the window with the
mouse.
can any one help with that?
|
|
|
|
|
Have you tried PostMessage instead?, it does not look like you need your worker thread to be blocked anyway.
Here are the remarks for SendMessage:
"If the specified window was created by the calling thread, the window procedure is called immediately as a subroutine. If the specified window was created by a different thread, Windows switches to that thread and calls the appropriate window procedure.
"
As to why this should be a problem?, i guess that is between God and Gates...
"It could have been worse, it could have been ME!"
|
|
|
|
|
thank you
but i do need to block the worker thread
any way the problem was solved
|
|
|
|
|
There are few problems that I see at the moment. First, don't use SendMessage betweem threads. It can lead to deadlocks. Use PostMessage or PostThreadMessage instead.
But your problem is not a deadlock, so this is only a suggestion.
I know that you HAVE to declare your custom messages handler function properly, because it can lead to such things like Access Violations in release versions. So I think this is your case. OnWorkerMessage should be full-declared, like this:
...
afx_msg LRESULT OnWorkerMessage(WPARAM wParam, LPARAM lParam);
ON_MESSAGE(WM_USER+1, OnWorkerMessage)
....
LRESULT CMyDlg::OnWorkerMessage(WPARAM , LPARAM )
{
...
}
Uncomment wParam and lParam if you want to use them
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
thank you Philip
it worked using SendMessage()
the problem was that I did not declare the function with parameters
thank you again
|
|
|
|
|
|
Hello guys!
there is a class named CMyClass as follow
CMyclass:CObject
{
public:
int m_iCount,m_iIndex;
CMyclass();
void ~CMyclass();
}
and definations: CMyclass ma,mb;
and statements: ma.m_iCount=3;
ma.m_iIndex=2;
How can I use "mb=ma;"?
Should I overide operator= ? and how?
Any suggestion is appreciable .
I'm learning learning and learning.
|
|
|
|
|
I just wrote a non-MFC code (actually a console one) to demonstrate operator overloading for you ...
#include <iostreamᡊe9ac73-238b-46be-991d-0f050c37248d
using namespace std;
class Base
{
protected:
static int _iIndex;
static Base* _pAddress;
int _iId;
Base* _pPrev;
public:
Base() {
_iId = ++_iIndex;
_pPrev = _pAddress;
_pAddress = this;
}
Base& operator==(Base& ref) {
ref._pPrev = this;
return *this;
}
int Bomb() {
cout << _iId << " -> ";
_sleep(500);
if(!_pPrev) {
cout << "\nChain broken!\n";
return 1;
}
return _pPrev->Bomb();
}
};
int Base::_iIndex = 0;
Base* Base::_pAddress = 0;
int main()
{
Base a[20];
a[19] == a[0];
return a[19].Bomb();
}
Maxwell Chen
People say "No news is good news". Then, no code is good code!?
|
|
|
|
|
You don't need to overload operator =, because you'll get one for free - you only want to copy integral types (int).
Is you want to overload it, then by all means do so, like this
CMyclass & CMyclass::operator=(const CMyclass & toCopy)
{
m_iCount = toCopy.m_iCount;
m_iIndex = toCopy.m_iIndex;
return *this;
}
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Use copy constructor.
Maxwell Chen
People say "No news is good news". Then, no code is good code!?
|
|
|
|
|
This is actually a trivial class, where you don't really need to overload operator=, since members are copied by default. If, however, your class contains pointers or references to objects, then you will need to overload the operator. This operator should always look for, and avoid, self assignments:
CMyclass & CMyclass::operator=(const CMyclass & toCopy)
{
if (this != &toCopy)
{
m_iCount = toCopy.m_iCount;
m_iIndex = toCopy.m_iIndex;
}
return *this;
}
|
|
|
|