|
I am new to all this and have made a text editor ( one of the most easy things
to start with ) but i want it to save an encrypted file that no other text
editor could read, so when you click save it asks for a password the saves
the encrypted text then when someone tries to load it they have to enter
the password??
Thanks in advance Steven Richardson!
P.S. i have Borland C++ Builder 5
|
|
|
|
|
How long is a piece of string? A really easy way to do it is just to take the raw text and XOR each byte with a constant byte value. That turns the text into garbage. Then you check the password. If it matches you XOR each byte of the garbage with the same constant byte and voila your original text is back.
Example:
Encryption - 101 xor 011 = 110
Decryption - 110 xor 011 = 101
This is really insecure but it's dead easy. It depends on what level of security you need. If you're just looking for something to stop casual observers then this will do the trick but if you expect someone to expend some effort in cracking your encrypted text and it's security is important then you need to look for something more significant than this.
There are plenty of industrial strength algorithms about but I'm no expert on current practices. Just google for 'encryption' for details.
The other potential problem with what you propose is that your security model is trivially broken if the password is revealed. Look for 'public key encryption' to avoid this.
HTH
i1.2sqrt(u).bcos(ur)sec(c)
but
b4.isqrt(u).ru/16
Navier
|
|
|
|
|
Hi, I have following technical question. Maybe someone has the knowhow, so I wouldm´t have to worry about seeking further
I have a server, he receives from somewhare a port number. So I want to find out what process communicates wia this port.
More rigurous:
I would like to find a method about determining a Process ID knowing a port number of a connection opened by this process.
Any hint would be highly appreciated.
Thanx
Bla´bla
|
|
|
|
|
I don't know how it's done but Foundstone have a free tool called FPort (in the Intrusion Detection section) that will do it for you. As far as I'm concerned actually doing this is deep voodoo.
i1.2sqrt(u).bcos(ur)sec(c)
but
b4.isqrt(u).ru/16
Navier
|
|
|
|
|
I am trying to print an area of the screen (specifically the VIEW only). I have a Dialog bar on top. When I do a GetClient rect, I get the size of the VIEW. This is fine. However, I grab the DC of the screen which includes the bar. The screen coordinates has the right width and height dimensions but not the offset to take into account the bar which I don,t want. From my view how would I get the dimensions of the View RELATIVE to the entire screen? Any other way? I am putting this in a derived view which ALL my views derive from. Thus, I really do not want to make this specific for this app but instead a general solution without knowing if there is none, one or ... Dialog bars on top.
Thanks in advance.
|
|
|
|
|
Hi Stan, maybe <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cwnd.3a3a.clienttoscreen.asp">CWnd::ClientToScreen</a> is the function you're looking for.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I wrote the codes:
#include <iostream.h>
void main()
{
int flag=0;
int i,j,k;
for(i=2;i>3;i++)
{
for(j=0;j>9;j++)
{
for(k=0;k>9;k++)
{
if(i+j+k==12&&i*j*k==42)
{flag=1;
cout<
|
|
|
|
|
sorry , I forgot the header
#include <iostream.h>
but the problem still in
|
|
|
|
|
Actually you didnt forget the header.
The < and > are taken as html tags.
Tick the no-html check box and re-post it.
Also put it as pre tagged.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
Your linker error is not really anything to do with your code. i suspect that either cl.exe is missing, broken, or not in the PATH.
One observation of your code though,
for(i=2;i>3;i++)
means that your code actually won't run. every time execution meets the for statement, it evaluates your condition (i>3) and only continues if it is True.
On the first iteration, i=2. Therefore, i>3 is false, and it will skip the entire for {..} block.
Note that this is not the cause of your linker error, just a problem i noticed.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Jon Hulatt wrote:
One observation of your code though,
for(i=2;i>3;i++)
means that your code actually won't run. every time execution meets the for statement, it evaluates your condition (i>3) and only continues if it is True.
YES,you are right.
the right codes are that:
for(i=2;i<=3;i++);
I forgot that,thanks for your help.
|
|
|
|
|
Alpha_No1 wrote:
Error spawning cl.exe
What is the error code?
Regards....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Here cl.exe is the MS 32-bit C/C++ compiler. The reason for the error may be that the path to this compiler has not been set. Go to Tools -> Options -> Directories in your VC IDE and check your paths to Executable Files.
The cl.exe file is normally in your bin directory.
Atul
Sonork 100.13714 netdiva
|
|
|
|
|
Thank you,I have solved the problem.I reinstalled the VC++.
|
|
|
|
|
If i want to use automation in my application because a part of input data are in excel, it will be arrays, and as i want to return my result into excel's cells, i believe that i could use this method. But, now i have a question about how i could consider an array which is in excel? Could i use naturally regular pointers, or should i use others types?
thanks in advance for your answers.
gerald
|
|
|
|
|
Hi,
I have an MFC application, that runs Ms Word, I want to paste in that instance of Ms Word an ActiveX control that I have created, to make that I call this: COleVariant
vClassType = "GrAxProof.GDIGraphics";
IDispatch *pDispatch = m_pWord->GetSelection()->InlineShapes->AddOLEObject(vClassType);
IGDIGraphics Control(pDispatch);
Then I want to execute some method from that ActiveX control that I already created on Word ( to make that I imported the dispatch interface into my word App, and I call the following code):
IGDIGraphics Control(pDispatch);
COleVariant x((long) 10, VT_I4);
COleVariant y((long) 10, VT_I4);
COleVariant title(TEXT("Method called from the App"));
Control.DrTextSimple(x, y, title);
But when I call the DrTextSimple method ( or any other), the program crashes...
Any help ?, Thanks in advance, Bye !
Braulio
|
|
|
|
|
After successful compilation, While I was trying to link and build the executable using VC++ 6, I got error messages like:
Linking...
ScreenSaver.obj : error LNK2001: unresolved external symbol _DefScreenSaverProc@16
ScreenSaver.obj : error LNK2001: unresolved external symbol __imp__KillTimer@8
ScreenSaver.obj : error LNK2001: unresolved external symbol __imp__TextOutA@20
ScreenSaver.obj : error LNK2001: unresolved external symbol __imp__SetTextColor@8
ScreenSaver.obj : error LNK2001: unresolved external symbol __imp__SetBkColor@8
ScreenSaver.obj : error LNK2001: unresolved external symbol __imp__ReleaseDC@8
Does that mean some Dll or head files had not been included in the program which were supposed to?
Thanks,
DJ
|
|
|
|
|
It does mean that a dll or actaull a .lib file was not correctly linked to your project. This can be solved by finding which library these functions and sometimes variables reside in. In your case, DefScreenSaverProc resides in scrnsave.lib, KillTimer is in user32.lib, and the others are in GDI32.lib.
You can fix this by adding these filenames to your project settings. Go to the Project | Settings menu, then click on the Link tab. Change the Category tab to Input, and enter these library files in the Object/Library Modules line separated by a space.
The next time you compile, the linker will attmept to link these modules to your application and everything should be ok.
|
|
|
|
|
I got it.
Thanks, Kilowatt.
DJ
|
|
|
|
|
Hey you!
I don't realy understand operator overloading....
CAT & CAT::operator=(const CAT & rhs)
this is what I don't understand. If I want to assign a CAT to CAT.
The parameter is it the CAT object on the right side of the '=' when you assign a CAT to a CAT?
look:
CAT cat1;
CAT cat2;
cat1 = cat2; // cat2 is the rhs parameter in the operator? (if you understand
But you can explain operator overloading to me more how it works... if you want to...
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Whn you define this operator, the left hand parameter in the cat1 = cat2 expression is the object on which operator = is being called (that is, the object pointet to by this ). A typical implementation of this operator goes like this:
CAT& CAT::operator=(const CAT& rhs)
{
firstMember=rhs.firstMember;
...
lastMember=rhs.lastMember;
return *this;
} Seems a little cumbersome at first glance, but it is a pretty straightforward idiom once you get used to it.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Operators in your custom classes are simply member functions of your class. The compiler just allows you to use syntactic sugar in order to invoke these functions.
Here is another way to look at it:
Rickard Andersson wrote:
CAT & CAT::operator=(const CAT & rhs)
CAT cat1;
CAT cat2;
cat1 = cat2;
This is the same as calling:
<br />
cat1.operator=(cat2);<br />
This is what it actually looks like to the compiler. This is also legal C++ syntax, so if your wanted to write your program using your custom class and this over loaded operator it would work. This goes for all operators for instance:
<br />
bool CAT::operator==(const CAT &rhs)<br />
{<br />
return ...<br />
}<br />
could be invoked with this call:
<br />
if (cat1.operator==(cat2))<br />
{<br />
...<br />
}<br />
If you have any more questions feel free to ask.
|
|
|
|
|
I have problem to implement Networking Application
using socket in MS.DOS because routine socket
this operating system isn't available.
Do I must install socket driver in order to implement
it in MS.DOS ? How to get it ?
Please Advise!!
Agus Kurniawan
|
|
|
|
|
As you said, there's no native TCP/IP support in MS-DOS. A number of companies sell their own implementations of a TCP/IP library for MS-DOS (both for 16-bit apps and for 32-bit MS-DOS extenders). Do a search for "IP stack MS-DOS" on the net to get some links. Some of the libraries (like for instance WATTCP) are free.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
i want to simulate signal -- SIGALRM of ANSI C in to vc++
for that i m using settimer api but it not doing callback....plz help me out on this topic.......
code what i wrote is---->
#include <windows.h>
#include <stdio.h>
#include <conio.h>
UINT uResult;
VOID CALLBACK TimerAPCProc(
HWND hwnd, // handle to window for timer messages
UINT message, // WM_TIMER message
UINT idTimer, // timer identifier
DWORD dwTime) // current system time
{
printf("bharat");
getch();
}
int main(void)
{
uResult = SetTimer(0, // handle to main window
0, // timer identifier
10, // 10-second interval
(TIMERPROC) TimerAPCProc); // timer callback
if (uResult == 0)
{
printf("No timer is available.");
}
Sleep(20);
uResult=KillTimer(0,uResult);
if (uResult == 0)
{
printf("No timer is available.");
}
}
|
|
|
|