|
hi karl..
Thanks for your response..OK well suppose i have calculated the key from random data. But my problem is how to encrypt a file using this key.(Symmetric encryption). I want to do this in VC++. Can you help me..please..
regards
Mahesh
|
|
|
|
|
|
Hello guys,
I created a simple dialog based application. I removed title bar from it. The problem is that when i run the program, the "empty" task bar button is shown. I don't want title bar, but i want some text and icon on task bar button. How can i do so in Windows application ???
|
|
|
|
|
In dialog properties window, select Styles tab, then uncheck Title bar check box.
A. Riazi
|
|
|
|
|
Hey, I have just started getting into MFC (from C++). I'm using Microsoft Visual C++ and I used the MFC AppWizard to create my first actual program.
Since it's my first real program I hoped to make something easy. I am hoping to have the user of the program type something in an edit box. Then when a button is pressed it outputs the text to a .txt file.
The actual program is an "alert" maker and I want to make it for HTML. The user types in the text for the alert and the program outputs the HTML for the alert with the user's message. I already have everything else set up I just need to know how to output it. Thank you.
|
|
|
|
|
Are you interesting in working with file streams or the CFile class? Have you looked at MSDN[^] yet?
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
As cool as MFC is, don't scrap STL! For all my file I/O, I still rely on fstreams and iostreams! See my article, CDataFile[^], for an easy illustration of using MFC and STL for file I/O.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
ok, im using fstream.h and using ofstream to output to the file. There is one problem. I am trying to ouput HTML, some of it looks like this: and the compiler thinks that the HTML is C++ so I get lots of errors. Is there any way to get around this?
|
|
|
|
|
DuFF wrote:
<input type="button">
You're probably not escaping the quotes - try this
fstrm << "<input type=\"button\">";
Quotes inside a literal need to be escaped with a backslash.
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thank you so much, its working. There is one small bug though. When I output the text to a file there are strings that are outputted inside the text. It works fine except if one of the strings doesn't start with a capital letter the text file is not outputted. Does anyone know how to fix this?
|
|
|
|
|
First off, I want to thank CODE PROJECT for all it's great code. I've found this site very, very resourcefull for MFC.
My question I have is about Telnet applications (read title). How do I ubild one and what should I use for best results? Should I use the Shell API and the DOS telnet application. Or should I try to create my own classes for connecting with a telnet server?
Keep in mind please, that I wish to keep this as easy as possible. I am still pretty much a begginer with MFC applications. I wish to make just a MFC look-a-like console application used for telnet sessions.
Thank you for your help in advance.
|
|
|
|
|
Sakky wrote:
First off, I want to thank CODE PROJECT for all it's great code.
Sakky wrote:
I am still pretty much a begginer with MFC applications. I wish to make just a MFC look-a-like console application used for telnet sessions.
Well, if you're gonna go... Go all out. Don't settle for "look-alikes" when you've got the real thing!
I'd start on MSDN looking over the basics of winsock and net comms. I'm sure there's something here too, it's just too late to look...
Good luck!
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Let me clear something up for you. What I ment when I said "making a look-a-like", was skinning the application. So that it would mimic the apperance of the Linux RedHat GUI system.
I think I'll try the console first, then I'll look into the net programming bit. Because I think I can use the Shell API for console commands.
Thanks for your advice tho.
|
|
|
|
|
First off, I want to thank CODE PROJECT for all it's great code. I've found this site very, very resourcefull for MFC.
My question I have is about Telnet applications (read title). How do I ubild one and what should I use for best results? Should I use the Shell API and the DOS telnet application. Or should I try to create my own classes for connecting with a telnet server?
Keep in mind please, that I wish to keep this as easy as possible. I am still pretty much a begginer with MFC applications. I wish to make just a MFC look-a-like console application used for telnet sessions.
Thank you for your help in advance.
|
|
|
|
|
I have been working on this for a couple of days. I am having trouble understanding why my program seems to hang after the input is translated. From what I can see the program never leaves the while loop. I must clarify that I still am a newbie so forgive me for my stupidity. Any help will be greatly appreciated. Here is what I have so far:
#include <iostream.h>
#include <string.h>
#include <fstream.h>
class translate
{
private:
char english[20];
public:
translate();
};
int main()
{
translate sentence;
return 0;
}
translate::translate()
{
char ans;
do
{
cout<<"Please enter a sentence:\n";
while(cin>>english)
{
if((english[0] == 'a') || (english[0] == 'a') || (english[0] == 'A') ||
(english[0] == 'e') || (english[0] == 'E') || (english[0] == 'i') ||
(english[0] == 'I') || (english[0] == 'o') ||
(english[0] == 'O') || (english[0] == 'u') || (english[0] == 'U'))
{
cout<<english<<"ay ";
="" }
="" else
="" {
="" int="" size="strlen(english);
" char="" temp="english[0];
" for(int="" i="0;" <="" size;="" i++)
="" english[i]="english[i+1];
" english[size="" -="" 1]="temp;
" cout<<="" english="" <<"ay="" cout<<"would="" you="" like="" to="" have="" another="" sentence="" translated,?\n";
="" cout<<"type="" [y]="" for="" yes="" and="" [n]="" no:\n";
="" cin="">> ans;
}
while((ans == 'y') || (ans == 'Y'));
return;
}
|
|
|
|
|
Constructors are for initializing member variables of a class instance, you should place the application specific code within a function that you call after construction, not during.
Ex:
class translate
{
public:
translate(){}
int Process();
};
int translate::Process()
{
<font color='green'>
}
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
arsenalgunners01 wrote:
Pig-Latin Translator
And I thought I was up too late...
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Thanks for the advice, but that doesn't solve my problem.
|
|
|
|
|
without looking @ your code in depth.. i can suggest you a ways to solve your infinite loop problem..
instead of using while(cin>english), you can use the length of the string of the input as your while conditional variable.. every loop, you minus the conditional variable by 1.. by the time the conditional variable reach 0(meaning you have finished check every letter), your program will exit the loop for sure..
|
|
|
|
|
How can I get the length of the string if it hasn't even been inputed by that point?
|
|
|
|
|
well, you get the input first, then get the length of the string.. once you done all that, you do your while loop..
lemme give you pseudo codes here:
let x, y be variables
x = input string from the user
y = string length of x
while(y) {
...do your pig latin thing...
y = y -1
}
|
|
|
|
|
while(cin>>english)
Remove this while loop and just do cin>>english as this is causing an infinite loop and not getting to your
cout<<"Would you like to have another sentence translated,?\n";<br />
cout<<"Type [Y] for yes and [N] for no:\n"; code.
Michael
The avalanche has started, it's too late for the pebbles to vote.
|
|
|
|
|
Can anyone tell me the basic difference b/w overloading and overriding ?? What i know is that overloading of operators in a class and overriding of functions in inheritance. Is there anything more ????
|
|
|
|
|
Overloading = more than 1 way to skin the cat. i.e. You can call the functions with different params.
overriding = using your class's functio instead of the virtual function from the base class.
If you want to get really cool, you can even have overloaded overrided functions! Or even override a virtual overloaded function...
...OK, i mean it, i'm going to bed now!
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Right on, except that overriding doesn't require virtual functions.
class B
{
public: void foo(int x) { }
};
class D : public B
{
public: string foo(HWND h) { return "Bob"; }
}; D::foo() overrides B::foo() just by virtue of its name being the same.
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|