|
I get region by:
CombineRgn
or
CreateRectRgn ...
or
Create a standard region, then rotate it
Thanks
|
|
|
|
|
sorry for replying so late
and thanks for ur suggestion
the problem here is not with rgns i could actually get the desired output on the screen with FrameRgn( , ,1,1);
but when i take a print out i get an image with more width to what i see on the screen
i am not able to under stand the problem
as u suggested paths r powerful but they do not support arcs and ellipses in win 98 platform so i could not use paths for creating aregion o fill the path
thanks for ur help
|
|
|
|
|
hello, i have created a CListBox object at runtime on my CEditView. Now i want an event to happen when i click on one of its items. The problem is that at runtime there is no event/command handlers by default (i think). Can someone help me to make an event handler out of my runtime created object?
Thanks in advancee
Bernard Racoute
Bracoute
56Kbps of sighs
|
|
|
|
|
With the help of the MFC wizard, create a class derived from CListbox doing all the message handling you need. Let's call that CMyListBox . Now, when creating the objetc at run-time, make it a CMyListBox instead and call CMyListBox::Create just as you called CListBox::Create before. If I understood your problem right, this should do.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You need to handle WM_COMMAND and check manually for commands coming from your listbox.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Hello programmers,
i'm blocked on a issue, i've called a CFontDialog dialog and i got the font by assigning dlg.GetFaceName() to a CString variable and now the dlg.GetSize(), used to get font size, returns an integer which i stored in variable size. But now i have to display the font size in a CEditView.... that's where the problem arise.... i cannot convert the int size variable to a CString variable that can be displayed on the CEditView. Can somebody help me convert the int to CString...
i used GetEditCtrl.ReplaceSel() to input the font size on the CEditView but the GetEditCtrl.ReplaceSel() only accepts strings... The code is used is listed below
[ccode]
if(dlg.DoModal() == IDOK)
{
CString text;
text=dlg.GetFaceName();
GetEditCtrl().ReplaceSel(text);
int size;
size = dlg.GetSize();
GetEditCtrl().ReplaceSel(size);
// This is where i get the error message saying cannot convert
// int to CString.
}
[/ccode]
56Kbps of sighs
|
|
|
|
|
It is simple.
CString s;
int i = 10;
s.Format("%d", i);
// s now == "10"
CString::Format takes the same flags as sprintf, because internally it uses a variant of it. I prefer to use ostringstreams, but as you have a CString, CString::Format is the easiest and most obvious way to do it.
So it's:
CString szSize;
szSize.Format("%d", dlg.GetSize());
GetEditCtrl().ReplaceSel(szSize);
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Hi,All
I want to run commands on command line programatically.
e.g. command like del filename from inside the programm.What are the various ways of doing that? I am currently using CreateProcess API with second parameter as command line,what are the other ways(if any)?
Thanx and Regards
Tushar
|
|
|
|
|
system (in header <stdlib.h> ) does pretty much the same, slightly more comfortably.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I am just curious, how do you spell this "see plus plus" thingy? I know how to spell VB and ASP, but am stuck on see plus plus - it isn't in my Websters English Dictionary.
____________________
David Wulff
I know what you're thinking punk, you're thinking did he plagarise this signature? Well, to tell you the truth I did. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
David,
It's right next to the definition of "see sharp".
Sorry
Nick Parker
|
|
|
|
|
David Wulff wrote:
it isn't in my Websters English Dictionary
I think they removed it after Websters moved over to Sun and Java
Nish
Make MSDN universal, FREE!
|
|
|
|
|
David Wulff wrote:
I am just curious, how do you spell this "see plus plus" thingy? I
change the see to sea
and use a * sign instead of the letters "plus"
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
I think it's interesting that we often qu-ote each other in our sigs and attribute the qu-otes to "The Lounge". --- Daniel Fergusson, "The Lounge"
|
|
|
|
|
Actually the real name is ++C. The value of C++ is the same as C, so for this new object-orientated language thingy to be a real improvement, it has to be ++C.
--Mike--
"Jobs that don't allow you to visit the Lounge 25 times a day at the minimum are not worth having anyway."
-- Nish, 3/28/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
Well I have to agree yours is the best by a long shot! ++C is is then.
And dammit - I missed my alarm this morning so now it is 13:41 in Britain (too late to say April Fools... grr).
____________________
David Wulff
I know who you are mate.
|
|
|
|
|
I use the wizard to create the MFC application, choose Explorer style, so ,the app has two view:CLeftView, CRightListView, the following codes:
void CRightListView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
GetParent()->GetClientRect(&m_ClientRect);
MoveWindow(&m_ClientRect);
}
the m_ClientRect is the sum of CLeftView and CRightListView, that's not I want to see.
How to get only the rect of CRightListView?
I'm amumu, and you?
|
|
|
|
|
GetClientRect(&m_ClientRect);
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
It may be that your sole purpose in life is simply to serve as a warning to others.
|
|
|
|
|
I know, but the base point of what you get is (0,0), but CRightListView's base point is not (0,0), it has a offset.
I'm amumu, and you?
|
|
|
|
|
The client rect by definition is relative to the client. To move it, use ClientToScreen from the main window, if that's what you want the rect to be relative to.
As in MyWindow.ClientToScreen(rcClient);
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
I changed my code:
void CRightListView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
GetClientRect(&m_ClientRect);
ClientToScreen( &m_ClientRect );
MoveWindow(&m_ClientRect);
}
But it is not correct.
I'm amumu, and you?
|
|
|
|
|
qf0421 wrote:
But it is not correct.
That's highly descriptive. What is not right ? Whatever it is, the answer lies in what I've told you, it just needs to be altered for what you want to do. If you tell me what you're trying to do and what is instead happening, then maybe I can help you.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
I've got it - get the WindowRect of the control, GetWindowRect as opposed to GetClientRect. Then if that is relative to the entire screen, call ScreenToClient in the window class on that rect to translate it to be relative to the window. yuou want the window rect anyhow if you're going to call movewindow, otherwise you're scrunching the window size down by whatever the non-client area is.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
For example:
CLeftView.m_Rect is (0, 0, 100, 100 ), and the rect of CRightView I can get is (0, 0, 50, 100), but the CRightView is on the right side of CLeftView, so, what I get should be( 100+x, 0, 150+x, 100 ), x is the width of splitter.
I want to use function to finish this coordinate-switch, how to get it?
Thank you for your help and your patience
I'm amumu, and you?
|
|
|
|
|
This is just a C++ question. Does anybody know how to get data from an excel file? I figured out a way to put data to an excel file. I just do this:
ofstream outfile("ftest.out");
int a=1, b=2, c=3, d=4;
outfile << a << "," << b << "," << c << "," << d;
then when I open ftest.out with excel, it recognizes that the comma means to move to the next block. But when I try to get data from an excel file the same way:
ifstream infile("ftest.in");
int a, b, c, d;
infile >> a >> "," >> b >> "," >> c >> "," >> d;
This doesn't work. Does anyone know some other method to get data from an excel file?
|
|
|
|
|
I don't know how to get the data from a normal excel file but I do know why your outfile code worked and your infile code doesn't...
Your ftest.out file would be considered a csv file (comma seperated values) and excel supports csv. A normal excel file is not stored in csv format.
Sorry I don't really have an answer but at least you know it isn't some little bug in your code.
There are a few articles here on codeproject dealing with excel files, maybe you could find an answer there... try here for instance
-Jack
To an optimist the glass is half full.
To a pessimist the glass is half empty.
To a programmer the glass is twice as big as it needs to be.
|
|
|
|
|