| Ch1156 (326) | |
| Scroll all the way down to the bottom. | |
|
Last edited on
|
|
| Texan40 (305) | |||
You can't pass a std::string to GetWindowText(). Just create a temporary something like this:
| |||
|
|
|||
| Ch1156 (326) | |||
|
I tried that, and it worked but its not saving my text. I did this: main.cpp:
Now, in the file << part, i have put tmp, MAX_PATH and Save, and it didnt save any of my text. I would get the number 1 or 260 or Save in my file.txt file when i opened it. I was thinking about using flush but i dont want random text in my program file output. what is going wrong with this? | |||
|
|
|||
| Null (755) | |||
MAX_PATH is an integer value defined in windows headers, and it doesn't contain the text. The text is in tmp array.This should work:
| |||
|
Last edited on
|
|||
| Ch1156 (326) | |
| I tried that, and when i open up my file.txt, the only word in there is Save. ??? | |
|
|
|
| Null (755) | |||
Oh, my bad. Save is an ID of a button, right?Since you have defined text in resource.h, yous should assign it to your EDITTEXT controlEDITTEXT text, 0, 0, 300, 150, ES_MULTILINE | ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL
| |||
|
|
|||
| Ch1156 (326) | |
| when i do that my text box disappears???? I have tried something like this in the past and had some pretty wacky results. Once a line was drawn through my text field, and another time the box had no border, im not sure why but naming the EDITTEXT control screws it up. | |
|
|
|
| BrokenSilenceDev (65) | |
|
textbox->text? textbox.text? | |
|
|
|
| Ch1156 (326) | |
| ?????????? | |
|
|
|
| Ch1156 (326) | |
|
The problem is that i cant name this line: EDITTEXT 3, 0, 0, 300, 150, ES_MULTILINE | ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL so im confused as to how i would be able to get the text from the textbox? | |
|
|
|
| Texan40 (305) | |||
Sorry I didn't read your post thoroughly enough the first time. Looks like you are assigning an id of 3 to your text box so try:
| |||
|
|
|||
| Ch1156 (326) | |
|
i forgot all about that ID, i forgot and thought it was part of placement or size :P but yeah it works fine now. I'll have to remember the ID number next time. Thanks for the help. oh and Is there any way to make the window unsizeable? | |
|
Last edited on
|
|
| modoran (608) | |
Yes. For example you could use following style:DS_SETFONT | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENURead MSDN for each style description. | |
|
|
|
| Ch1156 (326) | |
|
None of those made it so the window cant be re-sized, and i did read MSDN just now and i didnt see anything about making the window Un-resizeable. this is the page i read, maybe its on a different page? http://msdn.microsoft.com/en-us/library/windows/desktop/ms632600(v=vs.85).aspx What i want to do is make it so the boarder around the window cant be grabbed and re-sized. | |
|
Last edited on
|
|
| modoran (608) | |
|
The styles I give you are from a working program, did you delete whatever styles you have before ? You MUST use only these styles, not leave others too. By default (if you don't use any style at all) a dialog window cannot be resized. | |
|
Last edited on
|
|
| Ch1156 (326) | |
|
Ok i see now, it was that one that was there when the program was created STYLE 0x10CE0804. I deleted it and it works thanks!! Now, for my final question, how do i create tabbed windows? I want to put different things in different windows, but i havent figured it out. I know of the WC_TABCONTROL word but i dont know how to set it up. I looked on MSDN but it doesnt really show you how it just tells you. I need to see a working example. I have a tab example on my PC but its done wothout Resource controls so its more complicated than i want to get into right now. | |
|
Last edited on
|
|
| Ch1156 (326) | |
| Please help | |
|
|
|
| Texan40 (305) | |||||||
|
I coded up a quick example of a tab control: - resource.rc -
- resource.h -
- main.cpp -
| |||||||
|
|
|||||||
| Ch1156 (326) | |
|
I get these errors? I copied it exactly from your post. C:\Users\Chay Hawk\Desktop\Tabs\main.cpp||In function 'BOOL DlgProc(HWND__*, UINT, WPARAM, LPARAM)':| C:\Users\Chay Hawk\Desktop\Tabs\main.cpp|15|error: 'INITCOMMONCONTROLSEX' was not declared in this scope| C:\Users\Chay Hawk\Desktop\Tabs\main.cpp|15|error: expected ';' before 'ix'| C:\Users\Chay Hawk\Desktop\Tabs\main.cpp|16|error: 'ix' was not declared in this scope| C:\Users\Chay Hawk\Desktop\Tabs\main.cpp|18|error: 'InitCommonControlsEx' was not declared in this scope| C:\Users\Chay Hawk\Desktop\Tabs\main.cpp|22|warning: deprecated conversion from string constant to 'CHAR*'| C:\Users\Chay Hawk\Desktop\Tabs\main.cpp|24|warning: deprecated conversion from string constant to 'CHAR*'| ||=== Build finished: 4 errors, 2 warnings ===| Im not positive what some of the code means, some things are completley new to me but i'll worry about those when i figure this out. | |
|
Last edited on
|
|
| Texan40 (305) | |||
It means your compiler is not accurately recognizing your version of Windows/IE. In the commctrl.h header it has these checks. Try adding this to the top of the code:
| |||
|
|
|||