|
the menu part or the dialog part ?
did you create your dialog ? in the resources and in the code ( generated by the wizard )
did you add the menu item ( in the resources ) ?
did you create an handler for the menu item ? ( can be created from the wizard )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I've made the menu, made the handler for the menu item, and made the actual dialog box (and a corresponding class). I'm having trouble making an instance of the dialog class and calling DoModal for some reason. It's quite baffling, actually.
Phillip
|
|
|
|
|
#include "MyDialogClass.h"
//...
CXXX::OnSomething()
{
CMyDialogClass dialog;
dialog.DoModal();
}
|
|
|
|
|
Fixed it! Thanks. (I didn't include the header -duh!)
Phillip
|
|
|
|
|
error C2065: 'CDialogRates' : undeclared identifier
It doesn't seem to recognize CDialogRates as a valid class.
Phillip
|
|
|
|
|
I created a service which creates a pipe to communicate with another app. The service starts on boot-up and I telnet into the PC to start the app. The app communicates fine when I telnet over. However, certain people cannot seem to get it to work. I checked the task manager to see if both processes are running; the app and the service. Could the issue be a permission thing?
|
|
|
|
|
I checked the User Profiles and found that I have admin rights while the person for which the app/service pipe com does not work has a standard user permission. Now the question is, does it not work becaus I need to create the service with a special permission settings? Or is it something with the app?
|
|
|
|
|
You might need to grant 'network access' privilege to the user account that can not create the pipe.
Also, they might need privilege to interact with the pipe created by the service. You might have to get involved with the security attributes passed to the calls opening and creating the pipe, especially if it is created by the service. The user might be getting 'access denied' to the pipe since it is created under system account privilege, and user does not have rights to access the pipe object.
|
|
|
|
|
Services typically run as the System account. To install a service, you need administrative rights. Once it is installed, though, so long as it is set to start at boot-up, it will run in the background regardless of what user is logged on.
Did I answer any of your questions?
"Fish and guests stink in three days." - Benjamin Franlkin
|
|
|
|
|
Is there a way to capture what has failed inside 'PageSetupDlg' windows function. This function fails after the user has hit print. His computer rebots.
Rob
|
|
|
|
|
Hi Kruis,
Did you customize the Dialog Box? If so, and building a statically linked EXE, the proper #defines are not included as a resource. In that case, you must switch to a dynamically linked EXE.
Jeff
|
|
|
|
|
Hi Jeff,
Thanks for the reply, this is the basic code that I am using to setup the dialog.
LPPAGESETUPDLG pgs;
// Get memory for the page setup dialog structure
pgs = (LPPAGESETUPDLG) calloc ( 1, sizeof (PAGESETUPDLG ) );
if ( pgs == NULL )
goto exit_func;
pgs->lStructSize = sizeof (PAGESETUPDLG);
pgs->hwndOwner = hwndOwner;
pgs->hDevNames = hdevnames;
pgs->hDevMode = hdevmodes;
pgs->Flags = PSD_DISABLEMARGINS;
// Display the dialog to the user
retval = PageSetupDlg ( pgs );
|
|
|
|
|
I need to take the analog output of a scanner radio (dicriminator tapped, so there should be no noise), read it into the computer, and convert to digital. My thinking is that I should be able to do this through software using the soundboard instead of using a seperate A/D converter into a serial port or other port.
Anybody have any experience at doing this, or any advice, as I have never tried anything like this project before?
Thanx,
Rick
|
|
|
|
|
Microphone?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hello friends,
what are the advantages of having virtual constructors and virtual destructors?
How they are called and what is the procedure of execution of them?
Thank you,
Neelesh K J Jain.
|
|
|
|
|
virtual destructor is an essential part of object-oriented paradigm. In inheritance, the virtual destructure allows the OS to delete the right object.
class a
{
public:
...
virtual ~a();
};
class b : public a
{
public:
...
virtual ~b();
};
b *pB = new b;
a *pA = dynamic_cast(pB);
// What get destroyed?
delete pA;
Kuphryn
|
|
|
|
|
Technically there is no such thing as a virtual constructor in C++. There are design patterns in the category of "creation patterns" that can be used to produce the virtual constructor idiom.
For an explanation of virtual destructors and many other things, read Scott Meyers Effective C++
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hai all,
I still could'nt find the solution. I'm using win32 vc++ and subclass for drawing my button bagkground. ie.
BOOL CALLBACK DialogProc (HWND hDialog, UINT message, WPARAM wParam,
LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
{
lpfnOldWndProc1 = (WNDPROC)SetWindowLong( GetDlgItem (hDialog,IDSTART ) ,GWL_WNDPROC,(LONG)SubClassStartFunc);
.
.
.
EnableButtons(hDialog, IDSTART , false );
.
.
}
void EnableButtons(HWND hDialog,int DlgItemID, bool flag)
{
HDC hdc = GetDC(GetDlgItem(hDialog,DlgItemID);
.
.// to change my drawing...suppose to gray my text.
.
EnableWindow(GetDlgItem(hDialog,DlgItemID),flag);
}
LRESULT APIENTRY SubClassStartFunc(HWND hWnd,UINT uMsg,WPARAM wParam,LONG lParam)
{
switch(uMsg)
{
case WM_PAINT :
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hWnd,&ps);
RECT rect;
GetClientRect(hWnd,&rect);
....//code for drawing background
SetBkMode(hdc,TRANSPARENT);
DrawText(hdc,"Start",5,&rect,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
EndPaint(hWnd,&ps);
break;
}
}
The problem is I could'nt change my drawing in original dilaog proc. ie inside the func EnableButtons(...) whatever I do its not affecting the button drawing. How should I do ? Suppose I want to change the text color when i enable and disable botton. Whatever I do in this function is affecting the button itself and not the drawing. And I have given the button property as ownerdraw.
Pls someone help.
|
|
|
|
|
WM_PAINT is sent as soon as the button needs to be redrawn. You are calling DrawText yourself, but not handling and button disabling. Furthermore, if you have an ownerdrawn button, you are not supposed to handle WM_PAINT.
To be honest, you seem to have mixed up things here. It might be easier to make a complete custom class if you are going to handle WM_PAINT . For owner draw buttons, you handle WM_DRAWITEM in the parent. But in any case, if you are drawing the button yourself, you must also include drawing code for the different states.
|
|
|
|
|
Hai all,
I still could'nt find the solution. I'm using win32 vc++ and subclass for drawing my button bagkground. ie.
BOOL CALLBACK DialogProc (HWND hDialog, UINT message, WPARAM wParam,
LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
{
lpfnOldWndProc1 = (WNDPROC)SetWindowLong( GetDlgItem (hDialog,IDSTART ) ,GWL_WNDPROC,(LONG)SubClassStartFunc);
.
.
.
EnableButtons(hDialog, IDSTART , false );
.
.
}
void EnableButtons(HWND hDialog,int DlgItemID, bool flag)
{
HDC hdc = GetDC(GetDlgItem(hDialog,DlgItemID);
.
.// to change my drawing...suppose to gray my text.
.
EnableWindow(GetDlgItem(hDialog,DlgItemID),flag);
}
LRESULT APIENTRY SubClassStartFunc(HWND hWnd,UINT uMsg,WPARAM wParam,LONG lParam)
{
switch(uMsg)
{
case WM_PAINT :
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hWnd,&ps);
RECT rect;
GetClientRect(hWnd,&rect);
....//code for drawing background
SetBkMode(hdc,TRANSPARENT);
DrawText(hdc,"Start",5,&rect,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
EndPaint(hWnd,&ps);
break;
}
}
The problem is I could'nt change my drawing in original dilaog proc. ie inside the func EnableButtons(...) whatever I do its not affecting the button drawing. How should I do ? Suppose I want to change the text color when i enable and disable botton. Whatever I do in this function is affecting the button itself and not the drawing. And I have given the button property as ownerdraw.
Pls someone help.
|
|
|
|
|
I want to programmatically disable "prompt me to save passwords" in IE's autocomplete. Does anyone know how to do this?
|
|
|
|
|
Registry:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
"FormSuggest PW Ask"="no"
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Does it only stop automatically filling the password or does it also stop saving the password in the protected storage for later use if we choose to enable the option back?
Thanks.
|
|
|
|
|
See if the bottom half of MSDN article Q229940 is of any help.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I came across another article on this subject - http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=348
This article doesnt talk about DisablePAsswordCaching mentioned in the MSDN article, but says that the password is always saved at SPW and "To remember or not remember is controlled by more complex binary values hidden deep under the Protected Storage key.".
Can someone shed light as to what this author means here and how it is different from DisablePAsswordCaching?
Thanks.
|
|
|
|