|
what about for windows 2K and XP?
James A Beggs
Microsoft MSN Mobile Component Test Team
|
|
|
|
|
What I meant was Win98 or above, including 2K and XP
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Ah, ok. I misunderstood - or misread.
James A Beggs
Microsoft MSN Mobile Component Test Team
|
|
|
|
|
And how do I identify the window I need from the others I don't with EnumWindows()?
James A Beggs
Microsoft MSN Mobile Component Test Team
|
|
|
|
|
Hi guys, here is a question from a C++ programming course.
We have to implement the BubbleSort algorithm over a STL list. As we know, STL lists haven´t got random access iterators, so we can only increment and decrement the iterators (we can´t use expressions such as "i = i-1"). What implementation is better?
a) Using an additional function to get the iterator pointing to the previuos element:
<br />
template<typename T><br />
inline T Prev(const T& i) {<br />
T j = i;<br />
return --j<br />
}<br />
<br />
template<typename T><br />
void Bubble(T Begin, T End) {<br />
for(T i = Begin, i != End, i++) {<br />
for(T j = Prev(End); j!=i; j--) {<br />
if(*j < *(Prev(j))<br />
swap(*j, *(Prev(j)));<br />
}<br />
}<br />
}
b) Do not use any adittional function, and just use "temporal" stack variables.
Guess the implementation
I say that "a" is better, my taecher and my best friend think that "b" is better.
What do you think?
Thanks.
"When I look into your eyes, there´s nothing there to see, nothing but my own mistakes staring back at me"
|
|
|
|
|
Benchmark it.
And realize that you're arguing about a bubble sort! Who cares how you implement it?
|
|
|
|
|
The question is not about the algorithm, is about correct implementation.
Thanks anyway.
|
|
|
|
|
Anonymous wrote:
is about correct implementation.
There's no such thing--if it works. (Except in this case there may be implementation that will get you an 'A' and implementation that won't.)
|
|
|
|
|
I've a problem using CDialogBar if the visual styles of Windows XP are enabled.
The problem is that the background of the dialog bar is still the standard dialog background instead of the toolbar background.
Does anyone know how to create dialog bars with working theme support?
---
Author of FileZilla FTP
http://sourceforge.net/projects/filezilla
|
|
|
|
|
Hi all,
Quick question with hopefully a quick solution.
I have an Edit control on a dialog box in which I'm using the CDialog MFC class.
I need to be able to disable (grey out) the edit control at will. Assumming I have the Edit Control's Class pointer ( CWnd *), how do i enable and disable the control? I've been searching through MSDN and haven't found anything.
Any suggestions, comments or ideas are greatly appreciated.
Thanks!
Dan
|
|
|
|
|
Look deeper ...
BOOL CWnd::EnableWindow( BOOL bEnable = TRUE );
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Oh yeah. Duh. totally forgot that I'm looking at a window (edit control). Duh
Thanks max! That was an easy one.
Dan
|
|
|
|
|
Ok, I already know how to download a simple webpage using C++ but now I have reached a more complex issue. I was wondering exactly how you download images. Not just any images in particular but I have noticed some websites post there images using PHP script. So the address could be somthing like images.php?img_id=12 (some number) which points to a image. More particularly im having trouble figuring out 1 how to download the image fully to the hard drive and 2 I am also having trouble reading png files. Does anyone have any resources on this? I have checked code project and I have failed to find any useful articles that describe this particular conflict.
- LiquidKnight
|
|
|
|
|
hi again.
i need exetute an external .exe, in delphi i allways do it with ShellExecute
how can i do it in C++?
el hombre es libre cada vez que elige y eso es lo que lo hace libre
|
|
|
|
|
Use ShellExecute(..) in C++ as well.
Art
|
|
|
|
|
or CreateProcess, useful if you want to wait om the process terminating.
To iterate is human, to recurse is devine.
|
|
|
|
|
|
Amazingly enough its the same in C++ you use shell execute. I am not familar with the pascal langauge but I am guessing the shell execute is a bit more extended then pascal. Yet don't quote me on that anyways this is how you do it.
Code:
HINSTANCE ShellExecute( HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
or for exe file execution
ShellExecute(NULL,"open","myfile.exe",SW_SHOW);
any other questions feel free to ask at my aim name vethax0r
- LiquidKnight
|
|
|
|
|
Thanks at all.
el hombre es libre cada vez que elige y eso es lo que lo hace libre
|
|
|
|
|
I've got a document with a CMyClass object, then in the CMDIView I'v got a pointer to that object (CMyClass* m_pMyClass).
When I modify something of that object (i.e. m_pMyClass->SetX() ) I've want it to update the active frame only, since I don't want that modify been shown by other MDI frame windows opened.
If I use Invalidate(), all the windows will be updated.
If I use UpdateAllViews(this), all but the active MDI frame will be update.
I need extacly the opposite of this last case.
Thanks!
|
|
|
|
|
You can pass a 'hint' with UpdateAllViews(). Try using that and say just 'this' view. Or iterate the list of views attached to the doc and do just the one you want.
As an aside I wouldn't have a ptr to CMyClass in the View. You can always get at it via GetDocument.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Can you explain me better the "hint" with UpdateAllViews()?
As for the CMyClass*, I've set it just to have a simpler variable, instead of using everytime GetDocument()->GetMyClass()->(...).
|
|
|
|
|
djordj wrote:
"hint" with UpdateAllViews()?
There are (at least) two possibilities:
The first uses a number, cast into a LPARAM , in the second parameter of UpdateAllViews() .
Depending on that number, your views OnUpdate() can act differently.
The second sends an pointer to a class derived from CObject .
So you could for example build a hierarchy of CObject derieved hint-objects, some of which hold neccessary parameters, and you differentiate them using RTTI.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
The source files don't have to be in the project folder. Just add them to the project normally (Project->Add to Project->Files...) and they should work fine.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Hi,
I'm trying to read in a file of the type:
Col1 Col2 Col3 Col4 Col5 Col6
.01 6438. 41.74 8753. 1.3596159.07
.20 6257. 42.05 8811. 1.4082155.84
.40 6159. 42.98 8987. 1.4590146.71
.60 6156. 44.57 9283. 1.5081133.16
.80 6242. 46.84 9707. 1.5551117.11
1.00 6415. 49.87 10265. 1.6002100.41
It is a text file and I want to store each of the columns in an array.
The file is not tab delimited. The columns are separated by spaces.
However col5 is accurate to 4 decimal places and joins col6 with the first number read as 159.07.
How can I sort the data into arrays?
Thanks
kash
|
|
|
|