|
I would guess that most users would have 16 bit color or higher selected. If you do use a 24bit color bitmap and use a color outside of the windows palete, then that color will not display correctly and your GetPixel will fail.
If you confine you colors to the defaut windows palete, you shouldn't have any problem.
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
what is the default windows palete?
|
|
|
|
|
Its a list of 256 different colors. You may be able to find them on the web.
The colors I setup in that template bitmap I sent you should all be in that palete.
Windows does some funky things to the colors in 256 color mode. I really wouldn't worry about it too much though.
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
I could only get 3 of the elements to actually work properly from that template bitmap you sent me. I tried redoing it, and it works now (I'm reading in r,g,b instead of COLORREF) but it won't work if the display is set at 256 colours. I can't seem to find a list of the 256 colours online or anything, but if I have my settings set at 256 and I redo the template bitmap, it should only allow me to use the 256 colours right?
I have grown to dislike different colour settings.
|
|
|
|
|
In 256 color mode, Windows will only have 256 colors available fo rthe screen display at one time. If you use too many colors, it will convert them to the closest matching color in the current palete. The screen would look like a rainbow of sorts.
Since the template bitmap is selected into a device context that is compatible with the screen, then it will be converted to the same color depth as the screen. There really is no way to control it, but you can make your app use the same color palete in all of its bitmaps and windows, etc. If you use this palette http://www.soc.hawaii.edu/com337/presentations/presentation_04/sld017.htm[^] you should be ok.
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
Is there anywhere to find the r,g,b values of the colours in that palette? Or do I have to just look at that and figure out the values by just trying to match it up as best as I can?
I only need 92 distinct colours, and I tried setting my display to 256 thinking that only those 256 colours would be available to me, but it's still adjusting the colour values, so I have no idea what to use as colours anymore.
|
|
|
|
|
Download a shareware paint program or invest in Paint Shop Pro (www.jasc.com). MS Paint just doesn't cut it.
Like I said before, I wouldn't worry about making it compatible with 256 color modes. I don't know anybody that still uses that mode. If they do, they could easily move up to 16 bit.
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
Is your screen display running at 24-bit color?
I think that if your monitor is set to a lower color depth then when your bitmap is BitBltted to the DC it gets dithered down to match your display settings.
|
|
|
|
|
I have installed VS .NET on the same machine as VC++ 6.0.
Now, when a program crashes, and asks if I want to debug, it only gives the .NET debugger.
Is there a way to switch back and forth?
I try to think but nothing happens.
|
|
|
|
|
Yes. You need to modify the AEDebug string in the registry. There's an earlier posting in this forum which I don't have a link for (but has debugger in the title) which contains the registry location. If that isn't enough help, I'll dig out the full details tomorrow (it's 18:11 local time)
Steve S
|
|
|
|
|
|
Mike Dunn's solution may work (I haven't tried it, but he's a real smart guy), but just in case, here's the registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug
You'll see a string value there, called "PreVisualStudio7Debugger", just copy this into the "Debugger" string.
Chris Richardson
|
|
|
|
|
It does; I read a KB article this morning which says the same thing.
The difficult bit is knowing what to search for.
Steve S
|
|
|
|
|
Thanks to you and Mike. That fixed it.
Will I be able to use the VS7 debugger in .NET, or do I have to put the string back first?
I try to think but nothing happens.
|
|
|
|
|
You'll be able to debug programs with the VS7 debugger still, it just won't pop up as the just in time debugger when a program crashes (a program that's not running in a debugger that is).
Chris Richardson
|
|
|
|
|
John Robbins' book Debugging Applications for Microsoft .NET and Microsoft Windows (MS Press, 2003) includes a sample called DBGCHOOSER, which enables you to pick a debugger for the current debugging session.
There was a previous version in his MSDN Magazine Bugslayer columns, but that version doesn't work properly with VS.NET. The Visual Studio .NET just-in-time launcher, VS7JIT.EXE, requires that it is the entry in the AeDebug key's Debugger value in order to work.
|
|
|
|
|
I want to have my applications be alerted when the network status changes (connected/unconnected). What library do I need to look at for these functions?
As a related note I would like to be able to be notified of PCMCIA events. Mainly a card being plugged in or unplugged.
Can anybody point me in the right direction on these issues? Thanks
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
How do I detect the drive a program is currently running on??
|
|
|
|
|
Use GetModuleFileName(NULL, ...) .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi,
I'm having problems with the UpdateDriverForPlugAndPlayDevices() service in the DDK. For example the driver installation sample \2600.1106\src\setup\install works fine in WinXP Pro and the output is (xxx = correct hw id):
<br />
...<br />
Found! [xxx]<br />
Driver Installed successfully.<br />
But in W2000 SP3 it fails:
<br />
...<br />
Found! [xxx]<br />
UpdateDriverForPlugAndPlayDevices FAILURE: (0xe0000203)<br />
So it finds the device matching the given hardware id but fails to install the drivers. That error code means ERROR_NO_DRIVER_SELECTED but this information doesn't help much. What could be causing this behavior?
According to the DDK documentation this feature should be supported in ME, 2000 and XP but I'm able to use it only in XP Pro and Home. I compile with VC++6.0EE in Win Xp Pro.
- Jussi
|
|
|
|
|
I created a COM dll and inside one of the methods I create a thread(A) that creates a modeless dialog and a second thread(B)(Not from Thread A) that does some background work. My question is whenever I try to cancel(DestroyWindow()) the dialog I get an assertion error, I assuming it has to do with the second thread(B) updating the dialog box controls. I tried killing the threads(A and B), but still the same problem. I'm using AfxBeginThread and AfxEndThread. Is this approach good as I described above, or is there a better way of doing this.
Thanks
|
|
|
|
|
What is the assertion?
Thread B should NOT be updating anything that belongs to thread A. At most, thread B should post a message to thread A. Read these two articles for thread communication:
http://www.flounder.com/uithreads.htm
http://www.flounder.com/workerthreads.htm
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
DavidCrow wrote:
Thread B should NOT be updating anything that belongs to thread A
Unless these data are protected, with a mutex, for example.
New, what do you own the world?
How do you own disorder?
|
|
|
|
|
How can I get a simple line onto my dialog? I want a line just like HTML's [hr] tag.
Also, any links to tutorials on using the VS.NET dialog editor would be much appreciated.
Thanks,
Adam
My code isn't buggy. Those are all fleatures.
|
|
|
|
|
One way I've found is to create a button that's one dialog unit in height. Normally the dialog editor won't let you create a button this small, but you can press Alt while dragging to override its minimum size requirements (VC 6, eVC 3 - not attempted in VS.NET).
|
|
|
|