|
How is your "GetDocument" call defined?
"But, daddy, that was back in the hippie ages..." My twelve year old son - winning the argument.
"Stan, you are an intelligent guy who responds in meaningful ways" Paul Watson 16/10/01
|
|
|
|
|
I'm sorry, I don't think CMainFrame is throwing this error. If you look at the build output it should list the module thats throwning the error. For example, every module, such as your app class, which includes mainframe is also going to need to include the filedoc.h.
So in your app class do this...
#include "filedoc.h"
#include "mainfrm.h"
Or you can put filedoc.h in your mainfrm.h, although that is not the best thing to do. If this is a simple/small app though doing that should cause no problems.
You can also do what is called a "forward declaration"
i.e.
in mainfrm.h...
class CFileDoc;
before the class definition should work just fine for you.
"But, daddy, that was back in the hippie ages..." My twelve year old son - winning the argument.
"Stan, you are an intelligent guy who responds in meaningful ways" Paul Watson 16/10/01
|
|
|
|
|
Hi,
I'm using CreateFile then DeviceIOControl in NT & 2K to get a handle to, and then eject, the cdrom drive. MSDN says that CreateFile can't get handles to devices in 98, so how can i achieve the same thing?
Thanks
Jon
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Can you use MCI? There's a 'set somealias door open' command which ejects a CDROM.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Are you using MCI?
With MCI you have several commands string for make that. Is easy to Use...
Best Regards...
Toaday Is Friday!!! Party and
Carlos Antollini.
|
|
|
|
|
Hello, the codegurus around the world.;)
Check this.
HOWTO: Eject Removable Media on Windows 95.
And you focus just on CD-ROM.
MCI is easier, but I found that if MCI isn't installed on Windows OS,
it didn't work.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
see CDR.EXE - Open/Close CD Drive(s) Programmatically
at http://www.codeguru.com/system/cdr.html
HTH,
Alex Lewandowski
asl@asl2000.de
|
|
|
|
|
Hello, the codegurus around the world.;)
Thanks you for your info.
But, MCI will not be installed for all Windows OS.
QA of my company pointed out that MCI command can't work at all
for Windows 95 without MCI.
Programmatically, check if MCI is installed on this OS.
And, if so, execute MCI command.
Otherwise, this is "BUG".
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Hi all, I have finally managed to get a TransparentBlt function going in my program, the trouble is I`m finding it is too slow for what I need it to do (especially on larger images, with multiple layers). I am using a MDI app which supports multi layer bitmaps(hence the need for transparency). The OnDraw function is called every time I re-size the window etc. and so it ends up using blt many many times. So basically I wondered if :
1. Alpha Blend was faster?
2. Alpha Blend is capable of simply ommitting to change the color of a pixel where that pixel is the transparent color?
I have only briefly looked through the alpha blend code, and it seems to merely blend two bitmaps together, thus creating a kind of duo-transparency. This isn`t particularly what I want, I just need to get rid of the main background colour of the foreground bitmaps. Any ideas on perhaps how I could speed up the process would be greatly received.
Thankyou all.
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
I can only give you a limited advice, but this may be better than nothing . In one of my projects, I have to transparently blt a bitmap. TransparentBlt, which is available on Win98 and 2K looks like good idea. However, its performance on Win98 is absolutely abysmal, my own code which creates a mask and then does two blts to destination was orders of magnitude faster.
OTOH, the W2K implementation constantly beats my home-grown solution, sometimes its 100% faster... but not always. It seems that this speedup depends on the video driver - probably some drivers implement this functionality natively, while others do not and GDI must simulate it, creating a mask each time you call TransparentBlt. I've ended with a customizable option - users can enable TransparentBlt on W2K, but it's disabled by default.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I`m using XP Business Edition RC1 at the moment, so god knows what its gonna be like on this. I`m using an adapted version of Christians code, which uses a good few Blts, including a few SRCANDS (they really are speed killers) raster operations. I have heard of a method using one BitBlt (or StretchBlt) and SRCCOPY, but it doesn`t seem to work. I`ll post the code here, and if anyone can see whats wrong cool (remember this is NOT my code, so if it raises any questions, chances are I won`t know the answer).
if(GetDeviceCaps(hdcDest, CAPS1) &C1_TRANSPARENT)
{
oldMode = SetBkMode(hdcDest, NEWTRANSPARENT);
rgbBk = SetBkColor(hdcDest, rgbTransparent);
BitBlt(hdcDest, x, y, dx, dy, hdcSrc, x0, y0, SRCCOPY);
SetBkColor(hdcDest, rgbBk);
SetBkMode(hdcDest, oldMode);
}
Of course, this code doesn`t compile cause it don`t say what oldMode and rgbBk are variables of any particualar type. Even then NEWTRANSPARENT is undefined (I assumed whoever wrote the code #defined it to be = to 1, as SetBkMode's second argument is either 0 (Opaque) or 1(Transparent) as I understand it). I then assumed rgbTransparent to be the colour I don`t want copied onto the CDC (so I gave it a fixed value of 0 for black). Despite all this, it still don`t blinking work. This code would have been perfect for me, had it worked, because my programs layers need to be drawn (and re-drawn) fairly quickly. The strange thing is that Delphi actually manages to cope with this mechanism superbly, with not much performance loss at all, so I know there is a way get the desired results, but what is it?
Anyway cheers all for reading this far (again), and cheers Tomasz for the quick reply,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
The key to adequate perf across all Win32 platforms is simple: you have to pre-calculate the mask. If you have the mask, it takes two blts to draw transparently.
Creating the mask requires a two calls to Create[Compatible]Bitmap, two calls to CreateCompatibleDC and two BitBlts. It's *much* more expensive.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Right, got you. I`ve got something to work with now Tomasz, thanks for that. I`ll let you know how I get on.
Thanks again for the quick response,
Alan.
P.S. One more thing, I presume that once you`ve calculated the mask its stored as a HBITMAP variable, ready to be used over and over again?
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
I presume that once you`ve calculated the mask its stored as a HBITMAP variable, ready to be used over and over again?
Exaclty. I'm keeping it selected in its own memory DC to reduce overhead.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Cheers Tomasz, everything is now cool.
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
As far as the functions I wrote are concerned, Alphablend is probably faster because it doesn't generate a mask on the fly, it accesses the bits directly. As Thomasz has said, if you're doing it over & over you're better off splitting the code so you only generate the mask once, that's probably faster again. The way to make my alpha blend function faster is to make sure the bitmap is a DIBSection to start with, then you can use GetObject to get the pointer to the underlying bits.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Thanks for the response Christian, I`ve decided to go and do it the Alpha Blend way, for the reasons you said. I already had a DIBSection, and the method became alot faster again. I also didn`t have to worry about masks and stuff either, which was the main problem I encountered with TransparentBlt (as Tomasz rightly pointed out).
Cheers for all the help guys,
very much appreciated.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
- Are there any stuff about how to use VC++ to manipulate registry?
- Can you help?
- Regards,
Maer
|
|
|
|
|
|
- Thanks, Michael pal!
- I have taken a look at the URL you mentioned. It is a nice stuff.
- But I am a newbie of the field. I just want to know the basic use of the registry. I think there are too many articles for me to read. )
- Which article(s) is the most suitable to me? Do you have any suggestions?
- Regards,
Maer
|
|
|
|
|
|
- Thanks, Michael pal!
- The URL is a good stuff. It helps a lot.
- Have a nice weekend,
Maer
|
|
|
|
|
take a look at the following functions :-
RegOpenKeyEx
RegQueryInfoKey
RegQueryValueEx
RegEnumKeyEx
RegCreateKeyEx
RegDeleteKey
RegCloseKey
You better understand these calls before you start using those wrapper classes from CP because if you need to customize those classes, you'll need to know how they work
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
- Thanks, Nish pal!
- Your reply clarifies all my doubts. Hi, Nish, I think you know all the fields of VC++, arent't you? I think you are a born VC++ programmer.
- Have a nice weekend,
Maer
|
|
|
|
|
Hi,
Has anyone had this problem before:
If I click in the CListCtrl in report view and ALT+TAB toggles to another program (which completly hides the control) and then toggles back to the app with the CListCtrl, the control disappears.
However it works if I don't click the CListCtrl and performs the some thing as above.
I've included the CListCtrl (report view) on a dialog which in turn is on a tab page.
Any ideas anyone?
/Tommy
|
|
|
|
|