|
How to use RASENTRY to setup the entry to dial both the channels of ISDN. I want my dialer to dial both channels of ISDN after creating the Entry.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Hi!
I am writing a custom edit control:
class MyEdit : public CWnd {
....
};
void MyEdit::OnKeyDown(UINT ch, UINT flags)
{
CString text;
GetWindowText(text);
text += (TCHAR)ch;
SetWindowText(text);
Invalidate();
}
The problem is: What I got is not conformed to what is expected and a beep every input char.
e.g: [Keyboard]-->[Result]
a A
F4 s
What happend? How could I solve it?
Thanks,
Sovann.
Why waste time learning while ignorence is instantaneous ? [Hobbes]
|
|
|
|
|
the UINT ch being passed in isn't an ascii value, it's a virtual key code.
Open up WinUser.h and find the line
#ifndef NOVIRTUALKEYCODES (line 316 here)
all the codes are defined there. It looks like you'll have to make your own conversion function
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
The first parameter of OnKeyDown is a virtual-key code, not an ascii code. You will need to translate the virtual-key into the character you typed.
Jason Henderson start page ; articles
henderson is coming
henderson is an opponent's worst nightmare
* googlism *
|
|
|
|
|
funny echo in here
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Hi all,
Maybe this question should not be posted here, but considering your experience, i´m sure to get helped here ;);)
My question is if there is any way to override the default criteria of windows 2000 Password Police "Passwords must meet complexity requirements" ???
I have already done this under Windows NT 4.0, by creating my own Passfilt.dll, but under Windows 2000 this criteria seems to be moved into some of the operating system components, so after installing my Passfilt.dll, the achieved result is just a COMPLEMENT of the default criteria, not an OVERRIDE.
Thank you in advance.
|
|
|
|
|
You can modify password options from the "Local Security Settings" control panel applet ( in control panel -> Administrative tools )
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Ok,
Maybe i couldn't make me clear. I really intend to use this policy, but with my own criteria !!! Because in my scenario the default criteria is TOO restrictive, see :
- Passwords may not contain your user name or any part of your full name.
- Passwords must be at least six characters long.
- Passwords must contain elements from three of the four following types of characters :
English upper case letters, English lower case letters,
Westernized Arabic numerals, Non-alphanumeric characters (special characters).
Once i don't need all of this complexity, i'd like to completely redefine this criteria by myself.
This could be implemented trought a Password Filter, wich is a .DLL that provides password policy enforcement and change notification. So once created and properly installed, my PassFilt.dll whould be an OVERRIDE to the above criteria, that was implemented by the original Passfilt.dll (distributed with SP2). Under NT 4.0, i have already done this, and it functions !!!
But in Win2k, when passwords are changed, LSA call my .DLL, but either uses the default criteria, wich now implemented "i don't know where" causing it to be more restrictive yet. (
Anyway thank you for the reply ;);)
?
|
|
|
|
|
hey i want to change the text in my tabctrl by getting the text there already and changing it. i was trying something like:
TCITEM item;
int index;
CString newText;
if (m_tabView.GetItem(i, &item)) {
CString tabText = item.pszText;
// some mods to the title
}
but it always crashes, and running in debug mode, which i know not alot about, i see that item.pszText is a bad ptr, and the CString, so why dooes this work? what am i doing wrong.
thanks,
luke.
|
|
|
|
|
You have to set the item.mask values to specify which items about the tab you want to get. Set the mask first and it should return the correct values for you.
item.mask = TCIF_TEXT;
This is from memory, so may not be 100%
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
thanks, now i have
for (int i=0; i<4; i++) {
if (m_tabView.GetItem(i, &item)) {
CString blah = item.pszText;
AfxMessageBox(item.pszText);
and in release mode it brings up the right text for the first 2 tabs, then crashes, and in debug mode it doesn't even get into the if statement. and i have set item.mask = TCIF_TEXT;
but i'm not sure why it crashes after 2 in release mode(i have 4 tabs) and doesn't get into the if statement in debug. anyone?
thanks,
luke.
|
|
|
|
|
OK< this will be due to the following from MSDN:
pszText
Address of a null-terminated string that contains the tab text when item information is being set. If item information is being retrieved, this member specifies the address of the buffer that receives the tab text
So your code needs to be
char mybuffer[256]; // it may need to be bigger/smaller
item.pszText = mybuffer;
As the buffer pointer will be NULL in debug (instant fail) and random in Release, may/may not work.
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
Hello,
I need the definitions for the following constants:
SPDRP_DEVTYPE
SPDRP_ADDRESS
SPDRP_BUSNUMBER
SPDRP_BUSTYPEGUID
SPDRP_CAPABILITIES
SPDRP_CHARACTERISTICS
SPDRP_CLASS
SPDRP_CLASSGUID
SPDRP_COMPATIBLEIDS
SPDRP_CONFIGFLAGS
SPDRP_DEVICEDESC
etc... (all constants SPDRP_*)
Please, I know that these constants are defined in a SDK or DDK, I don't need this SDK/DDK! I just need the definitions of the constants which begin with SPDRP_.
Thanks in advance!
-Dominik
|
|
|
|
|
|
No, sorry, this does not help me.
I don't need the descriptions of the constants, but their definitions, e.g.
#define ... 0x...
Their numeric values.
|
|
|
|
|
You will find some of them in setupapi.h.
The others are in cfgmgr32.h which, I think, comes with the Windows DDK.
Gary Kirkham
A working Program is one that has only unobserved bugs
|
|
|
|
|
Dear friends,
I've developed an application in VC++/MFC. It is basically a text editor. You can type text message in it, and save the file. The speciality is that this application uses special fonts that i designed.
Actually, the problem is that, if i try to open the file on a computer where my font is not present, the file is obviously not readable.
Now what i want is that my application that generates this file, saves it as an image instead of text, so that it can me readable on some other machine where the font is not installed. Is it possible to save text file as an image (jpg, or gif)??? Is there any sample code present here ?? Or any other advice from your part ???
|
|
|
|
|
What about converting to .pdf or .ps? I think there are some utilities to convert it in codeproject.
Another solution would be to generate an image. For that, i think you can create an image object of some kind, like CBitmap (or CMemDC??), and PAINT in to it, like you would do if it was a printer. Of course, if your doc has multiple pages, it will require multiple images. After that, you can save the data to a file.
|
|
|
|
|
i have another question.
i develop my application in the 1024*768,the formview has not scrollbar and all controls are shown.
when i change to 640*480 or 800*600, the scrollbar show.
how can make the scrollbar disappear and all controls shown?
|
|
|
|
|
The size at which a formview will begin to show the scrollbars is based on the dialog template size you set when creating that. If the viewable area is smaller, then the view will automatcially add the scrollbars.
As you do not want scrollbars, you will have to make use of the CScrollView::SetScaleToFitSize function to resize the dimensions of the form. You would normally do this in the OnSize() for your form view. There is only one problem with this in that you will have to change the size/positions of some/all controls on the form to position them in positions in which they will be visible in the new form size.
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
One solution is to limit the size of the frame to a static minimum size. That way, you will not need scrollbars.
Kuphryn
|
|
|
|
|
Reasonable Developer
i wanted to download the SDK of Microsoft Project, i try my best but fail(it give overview of MS Project 2002) pls help me. So nice of u
|
|
|
|
|
Hi,
I've done a prog to shut down a computer after a period of time via InitiateSystemShutdown(). I got a problem in W2K -> windows shuts down and displays a messagebox: i it now safe to shut down the computer (or something like that). Is there any possibility to make w2k power down the system ? I got this problem only in w2k, w9x and xp works fine, nt4 not tested.
tia
-widi
|
|
|
|
|
I have been using this.. put this in one of you .h files..
BOOL MySystemShutdown()
{
HANDLE hToken;
TOKEN_PRIVILEGES tkp;
if (!OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
return( FALSE );
LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tkp.Privileges[0].Luid);
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0);
if (GetLastError() != ERROR_SUCCESS)
return FALSE;
if (!ExitWindowsEx(EWX_POWEROFF | EWX_FORCE, 0))
return FALSE;
return TRUE;
}
Then make a call to the function in you app..
MySystemShutdown();
I've tested it in windows NT and 2k.. havent tried it in 9x..
|
|
|
|
|
thanks,
that's what I've been looking for.
-widi
|
|
|
|