|
What format is the dist field?
In SQL, aggregate fields like COUNT produce NUMBER(38) values.
You might try re-formatting the result.
I try to think but nothing happens.
|
|
|
|
|
I can get a string from a popup menu item i.e. this way:
//---
...
...
menu = GetMenu();
menu->GetMenuString( id, string, MF_BYCOMMAND );
//---
but how can I get the (Windows) Rect of this menu item?
Any ideas?
|
|
|
|
|
If the menu is owner-drawn, then you can call CMenu::MeasureItem(LPMEASUREITEMSTRUCT) which will fill a MEASUREITEMSTRUCT that contains its height & width.
|
|
|
|
|
No, it's not owner-drawn.
Just a simple menu item as 'SaveAs' or 'myfunc'
But it's any idea, I will try this. Thx
|
|
|
|
|
Hey...
I have yet another bitmap question. I used MS Paint to create a bitmap, and I recorded the red, green and blue intensities for each colour I used. In my program, I take these intensities and turn it into COLORREF , using RGB(r,g,b) . Later on, after the user clicks on part of the bitmap, I determine where the click occurred and what the colour is at that point using GetPixel(..) . The COLORREF value returned by GetPixel never matches the original COLORREF value. I have tried re-doing the colours (once again, in ms paint) but it still doesn't work. Are the values that ms paint uses for r g b the same throughout everything?
|
|
|
|
|
Did you save the image as a 24 bit bitmap?
IF yousaved it as 256 color bitmpa it may have messed some of them up.
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
I didn't see that it could be saved as different types. If I save as 24 bit bitmap as opposed to 256 colour bitmap, will end users of this have problems with the colours like I did? Or should that avoid other people having problems with it as well?
|
|
|
|
|
See Terry's post.
I would use windows standard colors if possible. You 256 to choose from.
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
Yeah, I read his post. It was set at 16 before, but I've switched it to 24-bit. I have the colours on my bitmap all sorted out now, it all works just fine. But I'm scared that there will be problems with end users. Are the windows standard colours the 24-bit? Or is it 32-bit or 256? By using 24 bit, and having everything saved in 24 bit, there shouldn't be any problems with people using it who are using more colour right? (just the people using less colour would run into a problem I suppose)
|
|
|
|
|
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.
|
|
|
|