|
Neville Franks wrote:
I'm open to suggestions to tone it down further?
I don't have a problem with it at all
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
I don't have a problem with it at all
Thanks, I thought it was reasonably tame.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Hi, all:
I have an odd problem that I have been experiencing. I create a simple Dialog-base application and then add two buttons to it. Each button click calls creates a MODELESS dialog. I have a big OK button on each dialog and the OK button overlaps some. If I set both modeless dialog style in Resource Editor to Popup, everything works fine. If I change the style to Child, then the problems come in. Click on Button 1 to create Dialog Num1. Click on OK button on Dialog Num1 , the button on the main dialog gets the click, seems like the MODELESS dialog is behind the main dialog, even though visually it is on top. Also, Click on button 1 to create Dialog Num 1 and then click on Button 2 to create Dialog Num 2. If I don't move the dialogs, when I click on the OK button on Dialog Num 2, the message for button clicking goes to Dialog Num1 which is create first and underneath of Dialog Num2. It seems that Dialog Num 1 is on top of the Dialog Num 2, even though visually otherwise. Another issue is when those dialog get moved, the redraw does not work correcly. I tried use SetWindowpos with WndTop or WndTopMost, it does not affect the result. I try to use MoveWindow, SetFocus, same thing.
Is this a MFC bug, or simply the MODELESS dialog can not have Child style.
Any help or suggestion is highly apprecaited. thanks in advance.
Dion
|
|
|
|
|
DionChen wrote:
Is this a MFC bug, or simply the MODELESS dialog can not have Child style.
A modeless dialog can have a child style. It is kind of hard to follow your explanation but I can say that I have experienced some problems with modeless dialogs. However, you should use the pop-up style which is used for dialog boxes. Since you don't have any problems with the pop-up style then why do you worry so much?
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Is there a good quality SDK out there that someone could recommend to enable me to print PDF files from within my C++ application? Adobe doesn't provide me a way to set printer tray information (pass in a DEVMODE structure) and they frequently popup dialogs. I've found a ton of PDF SDK's out there, but none of them have a good set of printing functions. I need the ability to specify a printer and tray and know that no message boxes are going to pop; since this will run as an engine application. Thanks, Ron.
|
|
|
|
|
I'm working with dialog boxes for the first time in .net, and I can successfully show a dialog box from a starting dialog, but the second one always has additional Ok and Cancel buttons pasted into the upper right corner and the phrase "TODO: Place controls here." None of these things appear in the form editor. Anyone know how to get rid of them?
|
|
|
|
|
Null Monkey wrote:
Anyone know how to get rid of them?
You mean, is there an option to get rid of them? If that's your question, then my answer would be no. But if you just want to remove them from the dialog box, just click on the buttons and then hit delete. But I don't think this is your question.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
I've since stumbled accross the answer, but the problem was that I had already deleted those things, and at run time they would re-appear, (and they seemed to be kinda angry that I tried to delete them.) It turns out that apparently dialogs, at least in the version I'm using, are created with an html background that occasionaly, but not always contains the accursed two buttons and static text string. I just deleted the body of said html file and they went away...
|
|
|
|
|
I just realized that you were talking about .net. I don't have that platform, so my reply is irrelevant. Sorry about that.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Hi,
I am getting link error when I complied a program from Microsoft SDK that used PSAPI. I could not figure out whats going on and I tried using unicode and ANSI flags in link settings. No luck. Can someone help me out please? Here is the code
#include <windows.h>
#include <stdio.h>
#include <psapi.h>
void PrintProcessNameAndID( DWORD processID )
{
char szProcessName[MAX_PATH] = "unknown";
// Get a handle to the process.
HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
PROCESS_VM_READ,
FALSE, processID );
// Get the process name.
if (NULL != hProcess )
{
HMODULE hMod;
DWORD cbNeeded;
if ( EnumProcessModules( hProcess, &hMod, sizeof(hMod),
&cbNeeded) )
{
GetModuleBaseName( hProcess, hMod, szProcessName, sizeof(szProcessName) );
}
else return;
}
else return;
// Print the process name and identifier.
printf( "%s (Process ID: %u)\n", szProcessName, processID );
CloseHandle( hProcess );
}
void main( )
{
// Get the list of process identifiers.
DWORD aProcesses[1024], cbNeeded, cProcesses;
unsigned int i;
if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) )
return;
// Calculate how many process identifiers were returned.
cProcesses = cbNeeded / sizeof(DWORD);
// Print the name and process identifier for each process.
for ( i = 0; i < cProcesses; i++ )
PrintProcessNameAndID( aProcesses[i] );
}
Link Errors:
Linking...
ProcessInfo.obj : error LNK2001: unresolved external symbol _GetModuleBaseNameA@16
ProcessInfo.obj : error LNK2001: unresolved external symbol _EnumProcessModules@16
ProcessInfo.obj : error LNK2001: unresolved external symbol _EnumProcesses@12
Debug/ProcessInfo.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
ProcessInfo.exe - 4 error(s), 0 warning(s)
I am using Windows 2000 Professional SP4 and VC++ 6.0 with SP5. I got this sample from Platform SDK under PSAPI. Please help me out. I am lost.
Thanks in Advance,
Anil
|
|
|
|
|
Are you linking with psapi.lib?
Add the following statement to your cpp file.
#pragma comment(lib,"psapi.lib")
John
|
|
|
|
|
Hi John,
Thank you very much . It worked.
Anil
|
|
|
|
|
you need to link with psapi.lib. add it in the link settings.
|
|
|
|
|
Hi,
I have a basic HTML Browser built using the MFC Wizard. I am having a page where I have a set of images. On clicking the images, I am changing the title through Javascript.
Now in my HTMLViewerView.cpp, I override OnTitleChange to actually open up in full view the image clicked on. However, even navigate doesnt seem to work in OnTitleChange. Here's my code snippet...
void CMFCSlideViewerView::OnTitleChange(LPCTSTR lpszText)
{
CHtmlView::OnTitleChange(lpszText);
AfxGetMainWnd()->SetWindowText(lpszText);
CString title;
AfxGetMainWnd()->GetWindowText(title);
Navigate(_T("http://www.microsoft.com"));
}
Please note, I actually want to navigate to whatever is set in my title. However, even calling a standard URL doesnt work. I dont get any errors, my navigate call just doesnt navigate. Suggestions welcome.
Thanks in advance,
Vish
|
|
|
|
|
I'm looking for documentation of, or a helper library for, BSC files. Does such exsist? I'd like to write a utility that extracts information from the BSC and dumps it to an SQL database, and ultimately create something like LXR for applications built with developer studio.
|
|
|
|
|
Can't say I know of any documentation for BSC files. One problem with this approach is that you can't get any output until you have an app the will compile. In ED (see sig) I've written my own source parsers which build a database in background threads, so you have code navigation, lookup and browsing from the get go.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Yep, there are a number of products that re-parse the source code that way. The issue there is given the idiosyncracies of the MS compiler you can't ensure that your parser resolves references the same way MS's does. IOW, I want my info from the same compiler that builds the bits I give to my customers.
ED's a nice tool by the way, just not the right thing for me in this case.
|
|
|
|
|
How can I tell wether a button control is being held down or not? I can't seem to use the flag from WM_LBUTTONDOWN because I don't have the same flag parameter passed into my button handler
Any ideas?
Andy
|
|
|
|
|
It's being held down until you get a WM_LBUTTONUP message.
|
|
|
|
|
hmm tried what you said, what I really want is this, and I couldn't get it to work. I want to execute one bit of code when the button is pressed and then another when it is released. How can I do that?
Andy
|
|
|
|
|
Just a suggestion: you can perhaps subclass your own button class (derived from CButton) and add handlers for the WM_LBUTTONDOWN and the WM_LBUTTONUP messages. In these functions, send a notification message to the parent.
Hope this helps
|
|
|
|
|
is there any way to detect that a particular button is being held down. i.e. on the WM_LBUTTONDOWN message, how can I check wether a particular button is pressed in a similar way to say a checkbox?
Andy
ps what notification message do you mean?
|
|
|
|
|
Another suggsetion is to add handlers for the WM_LBUTTONDOWN and WM_LBUTTONUP messages in your dialog (or view) class. In these functions, test if the position (the point parameter) is on the button.
For this you can use CWnd::ChildWindowFromPoint (take a look at the documentation) and then call GetDlgCtrlID for the CWnd that is returned to see if this is your button.
You can also use flags to keep trace if the button is pressed or not.
Hope this helps
|
|
|
|
|
I have a CRecordset class, which I'm using to update an Access table. I am using MoveFirst() to set the pointer to record 1 and am iterating through the table with MoveNext(). Everytime before moving to the next record, I update a text field. After about the third record, I get a 'Multiple rows were updated' message. If I click 'ok' and keep going with my update program, eventually I come to the EOF. It takes about 1-2 minutes to reach the EOF of a 20 record table on a Pentium 4. What could be the cause the above message? Thx,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
Sounds like a unique identity problem. Does your table have a primary key and if so, are you using it when you do an update? If you are updating with a where clause that uses non-unique fields, then you very well may be updating multiple records. Say for instance you have a table with four columns--ID, NAME, COUNTRY, STATE
If you have two records that look like this:
ID NAME COUNTRY STATE
1 Bob USA CO
2 Bob USA VA
and you are doing an update like this:
UPDATE MYTABLE SET STATE="OK" WHERE NAME="Bob" AND COUNTRY="USA"
then you are going to have multiple updates with a single statement. What you should be doing is this:
UPDATE MYTABLE SET STATE="OK" WHERE ID=1
Just make sure that your where clause of your update is using a unique (record) identifier. Does that make sense?
Let me know if I'm off.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|