|
Take a look at:
http://www.codeproject.com/bitmap/cximage.asp
I vote pro drink
|
|
|
|
|
Nemanja,
Thank you for your suggestion, I will look at it and see if I can get it to convert a gif to a bitmap.
Craig
|
|
|
|
|
take a look at www.unisys.com
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
You could use IPicture also.
|
|
|
|
|
I need to convert an STL string to a double? Does anybody know how to do it without writing custom code?
Thanks
Michael
|
|
|
|
|
_ecvt() can be used, though I'm not sure what platorms implement this. Windows at least does, so you're safe there. Pass in c_str() where needed.
HTH
|
|
|
|
|
Use std::stringstream.
Something like this :
std::string s = "3.4";
double d;
std::stringstream ss;
ss.str(s); // initialize the stream with a copy of the contents of string 's'
ss >> d; // extract a double from the stream
|
|
|
|
|
#include <stdlib.h>
#include <math.h>
#include <string>
std::string strPi = "3.1415";
double pi = atof(strPi.c_str());
Oliver
|
|
|
|
|
I have a few questions on list ctrl if anyone has touched upon these details. I've tried the main page which focuses on the list ctrl without luck.
1) is it possible to dynamically change the header column width of the last column so that when a scrollbar appears or disappears
I can have the column realigned to fit so I don't create a horizontal scroll bar?
2) Also, I've noticed DevStudio has listctrls where the last column cannot be resized. Is this a part of the listctrl functionality?
Thanks for the help!
Chris
|
|
|
|
|
Chris
I am not a ListCtrl expert but have been playing with them a bit lately, hope this information is helpful.
1. Get the width of the last column subtract the width of the scrollbar and set column width to result.
int nWidth = m_ListCtrl.GetColumnWidth(nLastCol);
nWidth -= SomeFunctionToGetWidthOfScrollBar();
m_cCustomerList.SetColumnWidth((nLastCol), nWidth);
You would need to use this code when you have added a row that goes beyond the visible portion of the ListCtrl.
2. As far as I know all ListCtrls by default have the last column (all columns) resizeable. Grab the right side of right most header and drag out beyond edge of ListCtrl.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
"Don't belong. Never join. Think for yourself. Peace"
- Victor Stone
|
|
|
|
|
Hi,
If you see a caret on window, you can type character in or not depending on the purpose of the window. For Edit class window, we can find out the window is read-only or not by checking window style bit (ES_READONLY). Though, for user defined window class(es), I don't know how to do this. For example, debug output window of VC IDE has caret but that window is read-only.
I want to know a way to find out given window which has a caret is a read-only or not. Why? The reason is I'm writing a tool that shows caps-lock status using tiny icon that chases caret, but for read-only window, I want to disable this chasing. If you don't understand what I want to do in my app, please just igonre this. Important thing to me is, a way to know window is read-only or not. (FYI: Have you ever heared about IME (input method editor)? IME seems to know a way I want to do.)
I love Code Project, do you?
Kurotora
|
|
|
|
|
For example, debug output window of VC IDE has caret but that window is read-only.
Probably because it's based on a RichEdit control. Read-only RichEdit windows will allow a user to click and place the cursor. In fact, if you write to a read-only RE window, the text could get placed wherever the user has placed the cursor.
For what you're doing, why does checking the status of the window not work?
|
|
|
|
|
Why do you think that debug output window is based on RichEdit? It dosen't seem to me so. I inspected that window using spy and nothing tells me it's read-only.
I love Code Project, do you?
Kurotora
|
|
|
|
|
I am using several modeless dialog boxes which exist for the life of the (SDI) application, These dialogs need to be visible in front of the application window while still allowing interaction with the application.
I have used the system model attribute on the dialogs, however this means that the dialogs obscure any other dialogs such as the file dialog.
I need to keep the dialogs on top of the main application without obscuring any other windows... Can anyne help..
Thanks in advance..
Steve
|
|
|
|
|
Use the SetWindowPos using the topMost value in the pWndInsertAfte parameter...
Cheers!!!
Carlos Antollini.
|
|
|
|
|
Use the SetWindowPos using the topMost value in the pWndInsertAfte parameter...
Cheers!!!
Carlos Antollini.
|
|
|
|
|
Use the SetWindowPos using the topMost value in the pWndInsertAfter
parameter...
Cheers!!!
Carlos Antollini.
|
|
|
|
|
You mean like the "always on top" effect? Just create the modeless dialog box normally (ie "CDialog::Create(IDD_MY_DLG);" and you are done. It doesn't need extra flags, and can't have the system modal flag set.
- John
|
|
|
|
|
Hello,
I have a question about dialog boxes. I have a dialog type application and I need to "DoModal()" other dialog boxes within the app, eg. DialogA is main app and i need to DoModal() to open DialogB.. my question is, I want to use timers on the created dialog boxes (DialogB), will the timer stay active/keep running if DialogB is "OnOK()"/Closed but the main app (DialogA) is still running? If not, how can I hide and unhide Dialog B without closing it.
Thanks,
RobJones
|
|
|
|
|
If the dialog is closed, it is destroyed. You want a modeless dialog box, and use ShowWindow(SW_SHOW/SW_HIDE) to close it/open it. You can easily set a flag in your main dialog to make it appear modal by making the main dialog unresponsive.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Christian,
Thanks for the help.. I have implemented this code.. it appears to be working but I'm not sure I'm doing this correctly or if I should be doing this differently.. In the main dialog application I use this to open the modeless dialog:
void CBSDeluxeDlg::OnBAdd1()
{
if (!::IsWindow(m_dlgAdd1.GetSafeHwnd()))
m_dlgAdd1.Create(IDD_ADD1, this);
m_dlgAdd1.ShowWindow(SW_SHOW);
}
In the properties of IDD_ADD1 Dialog box I have style "Overlapped" if I use style "child" all the buttons from the main app show through the modeless dialog and I can't use any of the controls of the modeless box.. now to hide the dialog box I use the following code when the OK button is pushed.
void CAdd1Dlg::OnBOk1()
{
CAdd1Dlg::ShowWindow(SW_HIDE);
}
I havent tested to see if the dialog stays active and is just hidden.. I wanted to make sure that the code was correct first..
Thanks for all your help!
Rob Jones
|
|
|
|
|
That looks right. I tend to create modeless dialogs as pointers and set to NULL, but I like the way you've done it, I may have to try it that way in future...
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
If you only want to keep timer alive, you can create a timer without association to the dialog. See my article "Timers tutorial" to find more about it.
I vote pro drink
|
|
|
|
|
Hi,
I need to find a good tutorial on how to use MFC. Basically, what I am trying to do is use MFC-designed dialogs (maybe from a dll) with ActiveX controls in them from a non-appwizard application.
Thanks.
|
|
|
|
|
You could look here http://www.adminmod.org/karel/2/index.htm
This is a "How to" type site so it's pretty basic, but it also has some good information..
Hope it helps,
Rob Jones
|
|
|
|