|
Hi, I'm searchig for a routine for Authenticating users that dial to a NT4/2000 server, using RADIUS protocol, because users passe through a router that server is connected to it.
Please help me.
Regards,
HAMED.
|
|
|
|
|
Hello!
The fact: I created a program with mfc the access an .mdb database through a Regular MFC DLL
statically linked (i must do that). I add th DLL to my core program, i execute all the function,
like insertion of record, etc through the dialogs in DLL and the db in the DLL.
When i close the app i always get an error cause "the memory could not be read". All works fine
but this message box.
This, only when i use CDaoRecordset (that i must use instead of CRecordset), cause when i call a
function that show ie a message box, the memory error dont appear.. sigh
Anyone has an idea on how to kill this problem?
|
|
|
|
|
Have you tried rebuilding the entire project? ( i.e. Clean / Rebuild all )
If putting a MessageBox in will make the problem go away, then it is quite likely that the program's stack is corrupted. You also need to make sure that the .lib file you are statically linking with is up to date. i.e. build the dll first, then use the up to date .lib file to build the executable. The joys of statically linking.
"Harland Pepper, would you stop naming nuts" - Harland Pepper
|
|
|
|
|
I have a need to build a string as follows; "DOMAINNAME\USERID". In looking through the MSDN docs on networking it appears that I can use the API function NetWkstaUserGetInfo(). The docs say you have to include the header lmwksta.h. When you do this and compile, that header causes a compile error and inside it's documentation it says you must include netcons.h before you include this file. Unfortunately that file, netcons.h, does not exist on my PC anywhere. I've tried searching for variations on the name but have still come up empty. Does anyone have a thought on what might be broken? Or another way for me to put this particular string together. Thanks.
Chris
|
|
|
|
|
You only need the header lm.h and do not forget to link with the Netapi32.lib library.
Cheers!!!
Carlos Antollini.
|
|
|
|
|
Thanks Carlos. With some more searching I found that there is a header file called lmcons.h. And in this file is a comment that it used to be called .. .. .. ta da. NETCONS.H
But I like your suggestion better. Just include lm.h and I should get all that will need. Thanks again.
Chris
|
|
|
|
|
How to detect the IP of the computer the programm is working on?
|
|
|
|
|
|
void CGetIPDlg::GetIP()
{
WORD wVersionRequested;
WSADATA wsaData;
char name[255];
CString ip;
PHOSTENT hostinfo;
wVersionRequested = MAKEWORD( 2, 0 );
if ( WSAStartup( wVersionRequested, &wsaData ) == 0 )
{
if( gethostname ( name, sizeof(name)) == 0)
{
if((hostinfo = gethostbyname(name)) != NULL)
{
ip = inet_ntoa (*(struct in_addr *)*hostinfo->h_addr_list);
}
m_IP.SetWindowText(ip);
UpdateData(FALSE);
}
WSACleanup( );
}
}
<pre>
BLaZe
ICQ # 110244345
email : mpblaze@iquebec.com
|
|
|
|
|
How can I set the background color of a CView derived class(to black for example), without doing something silly like drawing a view-spanning rectangle in OnDraw()
cheers
Bilal
|
|
|
|
|
Handle the WM_ERASEBKGND message. Inside the handler, use PatBlt to fill the window with desired color.
BOOL CYourView::OnEraseBkgnd(CDC* pDC)
{
CBrush backBrush(RGB(0, 0, 0));
CBrush* pOldBrush = pDC->SelectObject(&backBrush);
CRect rc;
pDC->GetClipBox(&rc);
pDC->PatBlt(rc.left, rc.top, rc.Width(), rc.Height(), PATCOPY);
pDC->SelectObject(pOldBrush);
return TRUE;
}
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi!!!
How it is possible that the following application had 1 thread when is running on Win NT and 2 when is running on Win2000!?
// TestWin2000.cpp : Defines the entry point for the console application.
//
#include <winsock2.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
WSAData wsData;
::WSAStartup(0x0202,&wsData);
char name[64];
gethostbyname((char*)name);
WSACleanup();
printf("\n");
return 0;
}
TIA,
Carlos Marcão
|
|
|
|
|
HELP! I'm launching a thread (code snippet below) that is supposed to monitor the directory c:\MyFolder for any file creations/deletions using ::FindNextChangeNotification. I'm getting a valid handle from the ::FindFirstChangeNotification but I am _not_ getting a change notification when I move a file into the directory or delete a file form the directory. I thought that the system records the change and the WaitForSingleObject call after the ::FindNextChangeNotification call would detect the change but nothing is happening. Any ideas? THanks.
unsigned __stdcall CEventChange::WatchThread(LPVOID pThis)
{
HANDLE hChange = ::FindFirstChangeNotification("c:\\MyFolder", TRUE, FILE_NOTIFY_CHANGE_FILE_NAME);
if(hChange == INVALID_HANDLE_VALUE)
{
// do error processing
return 1;
}
BOOL bReturn;
while(true)
{
bReturn = ::FindNextChangeNotification(hChange);
// check function status
if(bReturn != 0)
{
dwMessageId = WaitForSingleObject(hChange, 0);
if(dwMessageId == WAIT_OBJECT_0)
{
// process event change;
}
else if(dwMessageId == WAIT_FAILED)
{
// do error processing
}
}
else
{
// do error processing
}
Sleep(pThisObject->m_dwInterval);
}
::FindCloseChangeNotification(hChange);
return 0;
}
|
|
|
|
|
Try calling WaitForSingleObject immediately after FindFirstChangeNotification( ). After you have processed each change notification you should call FindNextChangeNotification( ).
|
|
|
|
|
Thanks for the reply. By making code change below, I was able to get the Change notification
// create a change notification handle with initial change notification filter
HANDLE hChange = ::FindFirstChangeNotification("c:\\Harris\\APServices", TRUE, FILE_NOTIFY_CHANGE_FILE_NAME);
if(hChange == INVALID_HANDLE_VALUE)
{
// do error stuff
return 1;
}
while(true)
{
// check if event is signaled
dwMessageId = WaitForSingleObject(hChange, 0);
if(dwMessageId == WAIT_OBJECT_0)
{
// process Event change
}
else if(dwMessageId == WAIT_FAILED)
{
// do error stuff
}
// request that the operating system signal a change notification handle
if(::FindNextChangeNotification(hChange) == 0)
{
// do error stuff
}
Sleep(pThisObject->m_dwInterval);
}
|
|
|
|
|
Hi all,
I'm trying to develop a visual report writer and ran into a few problems. First of all, I want to include metafile support. I want to play with the metarecords, but can't find any sample code. There used to be a sample in MSDN (Metafile GDI sample in SDK, named MFEDIT), but the source files seemed to be removed. Does anybody knows where I can find these sources, or other sample code ?
Second problem, I want to paint the contents of a rich text control in a metafile DC without using FormatRange/DisplayBand, because this simply creates a bitmap and clips it to the metafile DC. I want the metafile DC to contain all GDI calls from the rich text control.
Can anybody help me ?
When report writer is finished, I'll post it on the codeproject site.
Thx,
Danny.
|
|
|
|
|
Hi, I have two questions:
1-I like to know if there's any function in MFC that returns the point (CPoint) on a bmp image.
2- I have a bunch of bmp files , and i like to locate the point that the pixl intensity have changed, ( ex: from white to black),,, does anyone know how to do that?
thanks
Ehsan
Ehsan Behboudi
|
|
|
|
|
You can do it with GetPixel/SetPixel, after selecting the bitmap into a DC, but it is *slow*. Much better to use a DIBSection ( class wrappers here, and as part of paintlib ( www.paintlib.de )), which gives you a pointer to the data, which you can then traverse and check for value changes.
What do you mean by a CPoint ? I assume you mean the pixel value there ( GetPixel ) but when your question does not read that way. If it's something else, please clarify and I will try to answer.
Christian
#include <std_disclaimer.h>
|
|
|
|
|
Hi, I have two questions:
1-I like to know if there's any function in MFC that returns the point (CPoint) on a bmp image.
2- I have a bunch of bmp files , and i like to locate the point that the pixl intensity have changed, ( ex: from white to black),,, does anyone know how to do that?
thanks
Ehsan
Ehsan Behboudi
|
|
|
|
|
Does anyone have a guideline that I can use on how to create an NT service that will allow use of MFC? If so can you please point me in the right direction.
Thanks!
Roger Printy
Software Engineer
TeraNex
Orlando, FL
|
|
|
|
|
Please, but please, do not use MFC on services...
First of all a service can create a window on another desktop than yours... I'm wondering what MFC will do in CWnd::FromHandle...
Cristian 'Sardaukar' Amarie
Zero Software Group
|
|
|
|
|
If you just need to use MFC database classes in your service, you can check these Knowledge Base articles for more info:
Q152696
Q156138
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Most likely, you don't need to write your own NT service. Just write you program in MFC and uses a special NT service to run it.
|
|
|
|
|
Hi,
We use CreateEvent() API to create event object.
This Event Object is recognized in the local system.
When it comes to Remote Systems is there any API similar to CreateEvent() for notification?
Thanks.
Yamuna.E.
|
|
|
|
|
I have a constructor defined as shown:
CFirstClass:: CFirstClass(const CFirstClass &myClass)
{
// some code
CFirstClass* pAnotherFirstClass;
pAnotherFirstClass= &myClass; // error on this line
// code
}
The error states:
error C2440: '=' : cannot convert from 'const class CRegisterItem *' to 'const int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
pls help.
|
|
|
|