|
Hello,
I've encountered a strange behaviour of a toolbar (using CToolBar). I add programatically buttons to it from a modal dialog. The strange part is, that when I call RecalcLayout, the toolbar resizes (adds the buttons) but does not display correctly the associated bitmaps and does not manage their state immediatelly. If i manually flow or dock the toolbar, I get the command handling (i.e. the bitmaps appear correctly, and the buttons are clickable and not disabled). If I don't manually dock or flow the toolbar, I get only a resized toolbar without any bitmaps and with disabled buttons. My question here is, what am I missing, and what am I doing wrong.
Greetings,
Deian
|
|
|
|
|
You have to programmatically dock and re-float the toolbar to get it to accept changes in size; at least that has been my experience.
|
|
|
|
|
Thanks for the idea, I've tried this, but I'm making changes from a modal dialog, which is called by the frame. If I try to dock and refloat the toolbar it crashes. May be making the dialog no-modal will work fine, or will have to handle this after the dialog is closed. It's not a clean solution
Thanks for your time!
|
|
|
|
|
GDI+ looks good, sounds good, smells good, but how can i have it on my VS ver 6.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
Simple. Get a recent (Feb 03 or Jan 04) Platform SDK, and the GDIPLUS redistributable (unless you're running XP).
Make sure that the platform SDK headers are included before VC6 ones, same for libs and bins (although you'll need to rename the profiling executables in the SDK) and that should do it.
Steve S
|
|
|
|
|
humm, thanx for the help, well you may also say that i should migrate to VS.NET but dont know why i dont want to give up VS6.0
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
Hello group,
Currently I am trying to print icons (via printer) using DrawIcon function, but they never appear in the printed document.
Could anybody tell me if there is something wrong in using that function to print icons?
Or even better, can anybody give me a piece of advice to do this task.
TAI.
Julio Garvía Honrado.
|
|
|
|
|
Hello all
How do one can detect whether a particular port is a serial port or virtual com port created for bluetooth? In the case of win2000 and winXP under
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
ports are listed as
/device/serial0 // serial port
/device/Btport1 // bluetooth virtual com port
So in the case of win2000 and winXP, I've no problem in distinguishing a serial port from virtual bluetooth port. But in the case of win98 and winMe
all the ports are listed as
COM1
COM2 .. and so on.
so how do I make an application to recognize bluetooth ports on all the windows platforms? If anyone know how to do it please help me.
many thanks for your help.
Hari.
|
|
|
|
|
Hello all,
I don't know if this is the correct forum for this question (if it is not, I apologise in advance )
I just started to use VC6 (sp5) on a XP pro machine (with all the updates). The problem that I'm having is that while debugging an application, VC6 says the app has exited while I still have the application opened . Because of this, it is very hard to debug the application, as the breakpoints that are simply ignored because VC thinks the app has ended.
Has anyone seen this problem before? I've searched MSDN but was unable to find any clue as to why this is happening.
Thanks in advance
|
|
|
|
|
Hello,
i've got a list view control, which i want to fill with bitmaps that are drawn dynamicly in runtime.
My code is:
CDC *pDC = new CDC();
pDC->CreateCompatibleDC(GetDC());
CBitmap bitmap, *old;
bitmap.CreateCompatibleBitmap(pDC, 64, 64);
old = pDC->SelectObject(&bitmap);
CBrush brush;
brush.CreateSolidBrush(RGB(255, 0, 45));
pDC->SelectObject(&brush);
pDC->Rectangle(0, 0, 64, 64);
m_imageList->Add(&bitmap, RGB(255, 255, 255));
m_ctrlImageList.SetImageList(m_imageList, LVSIL_NORMAL);
m_ctrlImageList.InsertItem(0, "TEST", 0);
------------------------------------------------------
CListViwe m_ctrlImageList
CImageList m_imageList
------------------------------------------------------
It is adding an item to the list but the icon is not proper.
Any suggestions?
|
|
|
|
|
Are any of the functions returning an "error" value? Has CImageList::Create() (or equivalent) been called?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Yes, SetImageList method is returning 0,
and i'm creating image list with:
m_imageList->Create(64, 64, ILC_COLOR24, 0, 4);
If i use a resource bitmaps the list is working fine, but i want to draw the bitamps.
|
|
|
|
|
status wrote:
Yes, SetImageList method is returning 0,
Which is probably fine. A NULL value would indicate there was no other image list to return.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
So where is the problem then.
|
|
|
|
|
Hi,
(I'm new to this list, so pardon me if I'm asking something already covered. I've looked through everything I can find on this site and several others and can't seem to find the answer.)
Here's the problem:
I need to emulate a User Interface on a new product, in order to make a 'remote control'. It has to look and feel as much as possible like the real thing, which is to say it has a knob and a 3 toggle switches.
To implement the switches (and also the knob) I'm thinking about using a spin control without a buddy window. I've sub classed the control, and draw (stretchblt) a bit map of the switch in it's up, down or middle positions accordingly.
This works great for a horizontal switch (left, right and middle), but a vertical switch has the problem that the slider control's width, (like any scrollbar derived control it seems) has a width set by the system (it appears to be based on the Font size in the 'Appearance' menu for the Display Properties).
I need to be able to set the width, in order to get the full width of my bitmap to appear and also in order to make a larger 'sweet spot' for the user to click on.
How can I override the default width of a sub classed Spin Button, or Scroll Bar, etc?
Thanks,
John Miramonti
John Miramonti
|
|
|
|
|
Hi all!
This is a very simple problem, please give me a nice pointer to the solution.
I'm writing long numbers in a textfile with ofstream. The numbers are relatively big but I need the precision. Now ofstream writes the numbers as:
1.17308e+006 instead of 1173080. I'm loosing precision with this, how can I avoid this and make shure it just writes the real numbers (in the not scientific way)?
Thanks!
Aram
|
|
|
|
|
How are you losing precision? As long as all significant digits are displayed in the scientific version, it is just as good if not better. Single precision only has 7.2 significant digits.
http://babbage.cs.qc.edu/courses/cs341/IEEE-754references.html[^]
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I suppose you are talking about "long floating point values", not "long int values".
Actually, you are not "loosing" precision. You are just limited to the precision "float" or "double" offers. Not every number can be represented using a double or float. You still only have so many bits to store your floating point variable in.
And as usual, you can still define your own variable type and write all the calculation and transformation stuff yourself
Cheers
Sebastian
|
|
|
|
|
Hi!
I solved it, it was indeed a very stupid little problem. I did the long value * 0.5, but i forgot to cast it (like: (long)(counter*0.5);) that was the trick, thanks anyway!
|
|
|
|
|
Hi everyone,
I want to add my custom search handler in Start Menu -> search options. I somewhere found that I've to make a new subkey in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FindExtensions\Static . I made that subkey and filled with appropriate values also, but still it is not working.
Now foxed ! Any ideas ??
Pravin...
|
|
|
|
|
I have been doing a Context Menu Handler these days.
The first thing I would do is to check the "Shell Programming"-Section of CP.
I used Michael Dunn's Excellent Tutorials to create my own handler.
I hit some obstacles, though:
Have the most recent Platform SDK installed.
Make the proper Registry Entries.
Register your COM-DLL using "regsvr32 path\filename.ext"
Restart your Explorer (Completely. On Win2000 and WinXP you can do that by logging of and back on again.)
Make sure your CLSID is listed in the APPROVED section of the registry, should you not have admin privileges. Check M. Dunns Tutorials on how to do that.
This is about all the advice I can give.
Cheers
Sebastian
|
|
|
|
|
How to copy Print DC to CDC or otherwise ?
I've used CreateCompatibleDC() and BitBlt() but it can't work why ?
Thanks
|
|
|
|
|
If I define STL vector, not bu pointer, but by value
as:
<br />
<br />
typedef vector<CVariableShift> type_DevStrVector;<br />
<br />
struct CVariableShift<br />
{<br />
int i;<br />
};<br />
than how to get copy of stored variable
by iterator?
Only possible bu conversion to pointer ? as :
<br />
<br />
int j = it->i;
<br />
l_VariableShift = *(CVariableShift*)(&it);
<br />
<br />
Is it possible to works without ugly conversion?
thanks.
|
|
|
|
|
I think you're asking the following. I have a vector<int> and an iterator of type vector<int>::iterator (or const_iterator). How do I get the value that the iterator points to?
vector<int>::iterator it;
int iVal = *it;
|
|
|
|
|