|
Okay, I don't know how to use Visual Tools . Is that for .net? I suppose I should say that I have MSVC++ 6.0 no thte .net version... Anyways, I would greatly appreciate you looking for some code I really don't know how to do it in MFC but I know how to do it in a standard C++ file - I just couldn't get the program looking the way I want... And after creating my MP3 player in MFC Ive decided that it would be easier/better to create the program in MFC.
Thanks,
orcblood
|
|
|
|
|
I will look for some code tomorrow.
But you also have the ability to make your application visually in VisualStudio 6.0. When you create a new application, you will have an option for what class your C...View class should be derived from. There you select CFrameView. If you use dialog based application, you don't have to select anything. Then on your resource Tab you will have all your visual parts, and you can modify them. Play around and see what you can find out...
See u tomorrow then.
|
|
|
|
|
Ahhh, ok, I am unable to go to bed before this is solved:P Well, here's the code. Three lines that's all that's needed:
CEdit m_editEditor;
m_editEditor.Create(ES_AUTOHSCROLL | ES_LEFT,CRect(50,50,150,70),this,NULL);
m_editEditor.ShowWindow(SW_NORMAL);
Voilà!
This creates the most basic single line control. You can change the CRect parameters to change the size, and you change the ES_ values to change the look and behaviour of the control. The last parameter is the controls ID, which I could not be bothered to make. but it's simply a
#define IDC_EDIT_MYEDIT 100
statement to create that..
Well, hope this sorted things out. NOW i have to sleep;)
Good luck with your programming.
-Jaran
|
|
|
|
|
Wow thanks for your help. I just have one problem about where to place this code - that is if its for coding straight into the program without using the class wiz... Where would I place this code about? Ive tried in some differenft spots and it doesn't really seem to be working too good .
orcblood
|
|
|
|
|
Well you should put it in your init or startup function, where you define controls, set the window size...
|
|
|
|
|
|
How would I get rid of the MFC logo?
orcblood
|
|
|
|
|
|
How do I print HTML documents programmically? I have tried
(32>= (int)ShellExecute(NULL,"print", m_textList[i],NULL, NULL, SW_SHOWNORMAL));
But it doesn't print all the documents that are in the array (for loop increasing i).
It doesn't print all of them just someof them.
-Steven
CPACodeProject Addict
By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.
For those who were wondering, actual (Linux) Penguins were harmed in creating this message.
|
|
|
|
|
Steven Hicks wrote:
It doesn't print all of them just someof them.
Have you checked that m_textList[i] is valid for all i ?
--
It's not unusual to be picked up by a klingon woman
It's not unusual to have fun with a klingon
When I see you kicking me around
It's not unusual to see me cry, I wanna die
|
|
|
|
|
yes it is, sometimes the array is 10docs and it doesn't get half of them. If i use the sleep(1750 maybe it ll get more. How can I get it to print all of them as it's commanded in the for loop?
-Steven
CPACodeProject Addict
By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.
For those who were wondering, actual (Linux) Penguins were harmed in creating this message.
|
|
|
|
|
I am looking for a solution for getting the content of a folder (files and / or folders).
Does anyone know how I can do this?
|
|
|
|
|
|
Thanks, I will look at the FindFirstFile/FindNextFile functions. I tried the class that you linked to, but it didn't seem like it would list the content of just the folder I selected, but all the other subdirectories, or nothing...
Thanks again.
-J
|
|
|
|
|
jaran wrote:
it didn't seem like it would list the content of just the folder I selected, but all the other subdirectories, or nothing...
it will certainly do a single folder. just set Recurse to false.
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
Ok, so this is what I try:
CSADirRead dirReader;
dirReader.Recurse() = false;
dirReader.ClearDirs();
dirReader.GetDirs("D:\\Stash");
CSADirRead::SADirVector &directories = dirReader.Dirs();
//Temp var for folder name
CString sFolder;
OutputDebugString("Sub folders:\n");
for (CSADirRead::SADirVector::const_iterator dit = directories.begin(); dit!=directories.end(); dit++)
{
sFolder.Format("%s", (*dit).m_sName);
OutputDebugString(sFolder+"\n");
sDirList = sDirList+"D"+sFolder+"|";
}
Don't mind the OutputDebugString, and the other string formatting (sDirList).
The problem is that the only thing that is returned is "D:\Stash", not the subfolders...
Do you know why? What have I done wrong...?
Thanks.
|
|
|
|
|
jaran wrote:
The problem is that the only thing that is returned is "D:\Stash", not the subfolders
ahh. yes, i see what you mean. the class doesn't provide a way to get a list of subfolders in a given folder.
*edit*
i have updated the class to support this functionality
*/edit*
well, FindFirstFile/FindNextFile are easy enough to use.
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
OK, well, then I'll make something out of FindFirstFile/FindNextFile.
Thanks for your help.
-Jaran
|
|
|
|
|
You can do it by using "CFindFile" class.
C.R.Naik
|
|
|
|
|
Is that a MFC class, or something I can download here?
|
|
|
|
|
I found a CFileFind class... Is that the one you mean?
|
|
|
|
|
Ya....you are on the right way.
C.R.Naik
|
|
|
|
|
1)On p.370 of Ivor Horton's Beginning Visual C++ 6, it says you can add operator
functions to the class by clicking on the down arrow to the right of the
Wizard bar and selecting Add Member Function. I tried that, and after I
entered the first operator function, the declaration was added to the
class in the .h file, and a skeleton function definition was added to
the .cpp file. So far, so good. Then, when I tried to add a second
operator function, it only added a skeleton function definition to
the .cpp file and would not add the declaration to the .h file. How can I
get it to do that?
2)A little later in the chapter on p. 374, it says that instead of typing
in preprocessor functions into the header file, you can use a macro in
VC++6 that will do it for you. The book says to click on Tools/Macro and
select OneTimeInclude from the macros list in the Macro dialog box that
pops up. My macros list is blank in the dialog box. I tried typing in
OneTimeInclude, but I got an error that said I had to choose a macro from
the list--what list, it's blank?!
|
|
|
|
|
1. Burn the wizard, learn to do it yourself. You obviously know where things need to go, so put them there. Wizards are good to help you get started, but you should always move beyond them and learn to use the language more than the IDE.
2. I've never used this because macros are evil. The one time include should be present anyhow, when the class is generated by the wizard. Apart from this you should not use macros unless you really need them, i.e. where a const variable or inline function will not do the trick. In the real world, that generally means when you're writing debugging/tracing tools.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
|
|
|
|
|
Christian Graus wrote:
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Respected sir,
I found your signature interesting and to learn more about what it meant, I clicked on the Vinod Sharma HTTP link, but I only got a page that says this.
The page you requested cannot be found.
Click here to go to the CodeProject home page,
or click here to return to the previous page.
Do I have to reinstall Internet Explorer to get the correct page? I am using XP Home by the way with a black mouse pad! You never know if it is the environment that is causing the error.
Awaiting your kind response please,
Respects,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|