|
Well IE uses a HTML Window, the nearest in MFC is CHTMLView
Visual C++ uses a couple of CDialogBars and a MDI CEditView.
It all depends on the kind of app you are trying to write and what you want to achieve.
I find a CFormView is the best way to do button handling. What are you trying to achieve in a CView. You can add all the needed message handling for a button because a CView is pretty much the equivlent of a basic API Window. You might want to look at some of the API samples for this kind of info.
Michael
|
|
|
|
|
The main thing for me is to find out which ways are the easiest to draw different GUI's.
Ok, the program - and what I want from it:
I am planning on listing som text that I am searching.
The searchstring is beeing retreived from a web-server.
Then I would like to create checkbox'es next to the searchstring found.
The button is a kind of "get that file"-button.
I am trying to create a program that download files it finds on a web-page.
(links)
The reason for this is that my internetconnections sucks and browsing takes ages. (My ISP is having a lot of trouble and I can't wait for them to get their act together and find out what's causing the slow connections)
So when I'm looking for files on web pages (source code for instance) i have a lot of idletime waiting for the browser to show the web page.
So I need a program that can find the files I need, and what better way is it than to create it yourself?
I am currently looking at some source downloaded from this site, called Regiontracker.zip.
It has about 10% of the things i'm looking for - but I might still get some pointer off of it...
|
|
|
|
|
|
I discovered that CFormView might be a good thing for creating a GUI, but that does in turn give me a kind of "Dialog-like" look - and that is what I'm trying to avoid.
In that case, doc/view probably isn't the right thing for you to use. A plain window that you draw yourself would be easier to manage, something like WinAmp. If you want to stick with the standard controls, you'll get the standard look (which really isn't all that horrible, it is standard after all).
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
Hi,
In order to find an item in a ListCtrl i am using Find method of ListCtrl
My code snippet is :
CString sText="something";
LVFINDINFO info;
info.flags = LVFI_PARTIAL | LVFI_STRING ;
info.psz =(LPCSTR) sText;
int nIndex = FindItem(&info);
//it is always returning 0 even not -1 o indicate that the item is not in the list.I can see my item with the text in ListView but
It can not find the item...
Any ideas that can put some light...
with greetings from Germany
Özgür
|
|
|
|
|
If FindItem returns 0, first item in your list contains 'something'. Item numbers are 0-based.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I'm trying to learn C++ and I've a couple of basic questions about strings I don't know, could somebody help me ???
Case 1.
I've a CString object in my application and I've a function which uses that CString but doesn't modify it (just get the value). Which is the best way to pass it ?? Should I pass it as CString, CString*, const char* ???
Case 2.
The same as above but now I want to modify the value.
Could somebody help me with that ?? and please tell me why is better one option than another.
Thanks in advance.
|
|
|
|
|
void NonModifyFuncion(const CString &sString);
void ModifyFuncion(CString &sString);
(2b || !2b)
|
|
|
|
|
1) There is something I still don't understand:
I thought that If you declared a variable of type const, it was stored in .rdata section for constant data vars which it is better than in other sections (but only for integral data types, this is why I considered const char). By the other hand, const CString is stored in .rdata but also the object is stored in .bss for non constant data types.
What am I saying wrong ?????
Thanks for everything.
|
|
|
|
|
1) const CString&
2) CString& or CString* depending on your preference. I myself would use a CString* because parameters that are going to be modified are, by convention, passed as pointers as a holdover from C. Then again, that's just my style.
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
1) There is something I still don't understand:
I thought that If you declared a variable of type const, it was stored in .rdata section for constant data vars which it is better than in other sections (but only for integral data types, this is why I considered const char). By the other hand, const CString is stored in .rdata but also the object is stored in .bss for non constant data types.
What am I saying wrong ?????
Thanks for everything.
|
|
|
|
|
Maybe I don't understand your question, but keep in mind that it is only global data that is stored the the .rdata and .bss sections (variables declared with global scope, externs and static class members). All other variable are stored on the stack (well, except those explicitly allocated on the heap with new or malloc). So your function parameters will be passed on the stack. The constness only tells the compiler that it should not allow the function to modify the object - the object passed during program execution does not have to be declared const. In other words, you can pass a non-const CString as a const CString& parameter, but you cannont pass a const CString as a (non-const) CString& parameter.
I hope this was what you asked.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Thanks, it was what I was asking and I have understood it.
|
|
|
|
|
Thanks, it was what I was asking and I've understood it.
|
|
|
|
|
System: winnt 4 with two soundcards
How can i control on which soundcard a wave-file is played?
Is it possible to do it with the multimedia-sdk?
thanks to all who try to help me
Andreas
|
|
|
|
|
I have a button (owner drawn) which has a dynamic image on it. The image can be either a HBITMAP or HICON. It works great for normal styles, but I would like to grey the image when the button is disabled (same way it is done on a toolbar when a button is disabled). Does anyone know how to convert an HBITMAP and/or HICON image to disabled image.
Any help or pointers appreciated, thanks.
---
Better to be silent and thought the fool, than to open your mouth and prove it!
|
|
|
|
|
Try the DrawState() API. When rendering a HBITMAP with this method you should map the background color (probably COLOR_BTNFACE) to white. I do not know wether this applies to icons aswell.
Hope this helps.
-Jan
|
|
|
|
|
Hi,
First off I am new to VC++, so this is probably real basic stuff but I keep getting an error.
What I have so far :
// now all items are in list, so step through list to print them.
list<string>::iterator itr;
for (itr = parsed_items.begin(); itr != parsed_items.end(); ++itr ) {
int count = 0;
string dmp = *itr;
cstr = dmp.c_str(); // convert string to CString
plb->AddString( cstr ); // print to List Box
LPCTSTR word = cstr;
// How do I add the variable word into an array each time the loop goes round
// I want to end being able to access all the words in a sentence i.e.
// word[0]
// word[1]
// word[2]
// etc...
count++;
}
The comments in my code explain what I am trying to achieve.
Any help will be greatly appreciated, as I have been working on this and looking at various examples for two days now and am about to pull my hair out.
Thanks in advance
Tryhard
Tryhard
|
|
|
|
|
This compiles ? Surely you need List<string>::iterator ? Forget I said that, I'm sure you typed List<string>::iterator and lost the template argument as a bad tag as I did.....
Also, why convert string to CString ? Why not start with whichever string class you want and stay there ?
Either way, I don't know for sure if CString has an equivelant, or even if STL does ( shame on me ), but strtok will do what you want with a basic char*.
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.
|
|
|
|
|
I m working in Win32 and creating a dialog with an edit box attached to it. The edit box always has input focus. The problem is I want to capture WM_KEYUP and WM_KEYDOWN for the edit control, but no matter what I try I cannot. I am capture EN_CHANGE, but then I cannot find out what key was pressed. I tried WM_KEYUP/KEYDOWN/CHAR for the dialog, but they never get called.
Argh !!!!!
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.
|
|
|
|
|
Not sure this helps but did you try replying DLGC_WANTALLKEYS uppon a WM_GETDLGCODE message in the edit control message handler code?
-Jan
|
|
|
|
|
I'm not sure what that means, but it sounds impressive
Seriously, I did not know about this and I think it will solve it - thank you.
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.
|
|
|
|
|
Because edit boxes have their own "window class" (in the Win32 sense of the word), which means they also have their own callback function, the WM_KEYUP and WM_KEYDOWN messages are handled internally. What you want to do is handle them yourself, which will require a subclass (again, in the Win32 sense of the word) of the edit box.
No so long ago, I wrote an article that may be useful to you. Look at the subclass example, as it intercepts the WM_CHAR message and allows some keystrokes through, while denying others.
Feel free to drop me an e-mail if you have any questions about the article or the sample code.
--
Paul
"I drank... WHAT?"
|
|
|
|
|
|
I have 3 classes:
class A - dialog class
class B - thread class
class C - ActiveX class (included in dialog)
(the activeX component is a socket component and I create one variable for it in dialog class)
The scenario is like this:
The dialog will be initialized. The application will winsock other application. After it receive a data from socket component, it will initiate the thread. The thread then will call one method in dialog class which is using socket component. What the method (inside dialog class) should do here is, it will check the connection status. But it failed (it gives me runtime error - access violation error)
The question is:
1) How can I call method in class C(activeX component) straight from class B??
2) If cannot call directly from class B, where can I call the method? I try to call from class A but it failed. so can anybody help me to resolve on this.
I want to use the thread for checking the status connection.
Thanks in advance.
FM
|
|
|
|