|
Hi,
I've got a 3rd party activex control embedded in a dialog App, occassionally the activex generates an unspecified error resulting in a blank error message box,
Whilst the errors aren't integral to my main application, And if necessary I can work arround them, The Messagebox is a pain, Anyone know how to silence an activex from doing this,
Regardz
Colin Davies
|
|
|
|
|
Geez, talk about a crappy ActiveX control! It just goes ahead and displays error messages when there's a problem and to top it off, the message is blank! I suggest you call these guys up and tell them to send you an improved version. If they refuse, tell them you'll be happy to disclose to the world what a "wonderful" product they have. That may get them going...
If you don't want to go that route, then I suggest you look at writing yourself a system-wide Hook DLL. Then when you detect the message box is about to come up, you can close it down quietly. That's one not-so-nice way to do it, but it's the only way I know of. I had to do something similar a couple of years ago and I got a great jump start from an article I found in CodeGuru -- I don't know if CodeProject has anything like it yet.
Good luck!
Alvaro
|
|
|
|
|
Alvaro, the ActiveX is actually a real popular one, on client machines its the swflash.ocx, I bet you have it and unfortunatly its free so I can't hound the makers. And actually it's my code that causes the errors, I'm asking it for a variable name that doesn't exist in its structure. Unfortunatly if I don't ask I don't know if it exists. I know this sounds illogical.
But there is no way of enumerating the variable structure it appears.
I'll see what I can do with a hook
Regardz
|
|
|
|
|
I have a 600MHz PIII with 256M Ram running windows NT server . Generally apps go along nicely . But if I do a carrige return or a delete at the top of a 16KB source file it takes 5 seconds to respond , and the processor goes from 2% utilisation to 50% .(memory usage stays constatnt around 75MB) I am pulling what little hair I have out in big chunks . Any ideas ?
|
|
|
|
|
Are you running any add-ins customizing the IDE?
|
|
|
|
|
If its an MFC based project you could try deleting the
.dsw(workspace ) file. Create a new blank workspace and insert the dsp file into this workspace.
robin
|
|
|
|
|
This typically happens because of the .NCB file created by VC++. Close down your project and delete this file (in your project's folder).
Let me know if it helps,
Alvaro
|
|
|
|
|
Hi!
I have the following problem:
I want to use paper tray 1 (special paper) to print the
first copy and tray 2 (normal white paper) to print the
second copy. I want to do this whithout making the user to
select trays manually.
I've found a struct DEVMODE that has a member
dmDefaultSource that looked promising, but I am not sure how
to set and use this variable. I am not even sure if this is the correct way to solve my problem.
I hope there is someone that can help me.
/Henrik
|
|
|
|
|
Check out this article on MSDN:
HOWTO: Change the Default Source of Printer Programmatically
http://support.microsoft.com/support/kb/articles/Q157/6/29.asp
Cheers,
Frank
|
|
|
|
|
I have a CPropertySheet with three embedded CPropertyPages. In each page when the user handles some controls, their state is saved in the parent CPropertySheet. When the PropertySheet is dismissed by pressing the OK button, the user selection should be saved in a file. But I do not want the caller of the CPropertySheet to do this saving. Rather I want the CPropertySheet to implement this saving. So I did the
following.
In the CPropertySheet, I manually added a BN_CLICKED message map entry for IDOK (ClassWizard does not do this). This command handler gets called but the OnKillActive() of the currently visible page is not called (which I badly need). Then I used ClassWizard to add the OnOk handler to one of the pages (and removed this from CPropertysheet). Only when this page is active, this OnOk gets called. When some other page is active, the sheet closes automatically.
I do not want to override OnOk() for every page that I add to this sheet, yet I still want the CPropertySheet to handle this message. What should I do?
Thanks,
|
|
|
|
|
Why don't you find out what the current page is when your sheet's OK handler is called and then call the active page's OnKillActive() yourself.
Then you only have to handle the OK once in the property sheet.
You would need to do this anyway if you were overriding something else that closed the sheet, so why not with the OK button handler you overrode in the sheet?
|
|
|
|
|
Hi,
if you like i can send you a CPropertySheet derived class that exactly does what you asked for.
Best regards
Holger
|
|
|
|
|
I am writing a WTL application similar to explorer with a treeview on the left of a splitter, and various views on the right hand side. The problem is the that the controls flicker like crazy and I can't stop them. Every single window in the chain from the MainFrame to the parents of the controls have WM_ERASEBKGND handled, but the controls themselves are still blanking out, and the windows continue to be flagged for erasure.
Has anyone worked out a truly flicker free solution to controls like CListViewCtrl and CTreeViewCtrl?
|
|
|
|
|
I know Visual C++'s intgrated profiler and VTune 4.5 from Intel.
Are there any other products out there, that are comparable to VTune (and maybe better)?
|
|
|
|
|
One to certainly consider is Rational Quantify for Windows NT
http://www.rational.com/products/vis_quantify/index.jtmpl
Here are some feature benefits from their page:
Automatically pinpoints application performance bottlenecks
Profiles all parts of your Windows® NT application — including components with or without source code
Quickly analyzes your executables -- no rebuild is required
Provides thorough and repeatable performance data
Supports Visual Basic, Visual C++ and Java applications
Companion tool for Rational Purify and Rational PureCoverage for Windows NT, and integrated with Rational Visual Test and Rational ClearQuest
Integrated with Visual Studio 6.0
|
|
|
|
|
I have some code that includes a function that draws a simple graph in a CButton using GDI calls (FillRectangle and Polyline). The purpose of this code is to allow selection of foreground and background colors. The "graph" in the CButton shows what the selection(s) will look like. I call the function in question when one of the color buttons is pushed and it works fine in those instances. So, I placed calls to the function in OnInitDialog (after the CDialog::OnInitDialog call), but it does not do the drawing. I've walked thru the code and it all appears to be executing correctly, but the graph is not displayed. Any ideas?
Thanks, so much.
|
|
|
|
|
Try initiating a redraw on it with an Invalidate.
Windows might not be thinking it needs to paint the control, or your MFC DC for the dialog is not valid yet.
At least after the dialog is inited, there will be a paint message in the queue for that control to execute the drawing.
|
|
|
|
|
try looking at OnCtlCOlor Function
AFter InitDialog it would call this function
which does the painting of all dialog controls
and the dialog
RObin
|
|
|
|
|
Hello fellow programmers
I have a simple question :
how can I determine the language of windows at run-time ??
Thanx in advance for any help
Have nice day !
|
|
|
|
|
I used the function ::GetLocaleInfo() from the Platform SDK in the past for my projects.
|
|
|
|
|
GetUserDefaultLangID() and GetSystemDefaultLangID()
GetUserDefaultLangID() gets you the language you've chosen from the keyboard (Alt+Shift to toggle between say Korean and French or whatever you have setup).
GetSystemDefaultLangID() gets you the fact that the box is
set up for Swahili or whatever.
The returned value is encoded in two parts, the primary
language and any appropriate sublanguage.
You'll need to lookup the language codes to determine the
values (For example English is 9 and is represented by LANG_ENGLISH).
Cheers
|
|
|
|
|
For those who have had experience with using the GridCtrl control, I was wondering if you knew how to incorporate bounds checking for individual cells into an app that used GridCtrl. Any suggestions would be appreciated! Thanks!
|
|
|
|
|
What sort of bounds checking are you referring to?
|
|
|
|
|
I am referring to the case where a user will enter a value/string into a cell and the program will check to make sure that the value/string is an appropriate entry. if not, a windows message box would pop up letting the user know the entry was innapropriate and the string would be reset. If anyone can help, please do! Thanks!
|
|
|
|
|
Hello,
I need to create a string from an int. The string should be always 6
characters long and prefixed by "0"'s if the int doesn't have 6 digits. For
example:
5 should become "000005"
8940 should become "008940"
I hope this explains what I'm going to do. Problem is, the algorithm will be
executed very heavily, so I need the fastest solution available.
Thanks for your help
Matthias
|
|
|
|