|
Great thanks.
Tony
|
|
|
|
|
how to encrypt / decrypt a text file(*.txt) using vc++
|
|
|
|
|
This looks promising: Example C Program: Encoding and Decoding Data.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
kamalilam wrote: how to encrypt / decrypt a text file(*.txt)
I suppose the file format doesn't matter.
See here for sample how to use win32 cryptoapi.
Life is a stage and we are all actors!
|
|
|
|
|
|
hi all
i want to develop an application in which i need to find unused disk space in a disk. please guide me how it will possible using C++/VC++/MFC
|
|
|
|
|
Use can use GetDiskFreeSpaceEx API to get the free disk space in a disk. Just refer for more details[^]
Величие не Бога может быть недооценена.
modified on Tuesday, October 27, 2009 2:43 AM
|
|
|
|
|
Use these functions and get the free space Smile
double funcToGetDriveFreeSpace(LPSTR drive)// give drive name here
{
BOOL success;
CString driveName = drive;
driveName.Append(_T(":\\"));
//LPCTSTR DiskDirectory = _T("C:\\"); // directory name
__int64 AvailableBytes; // number of bytes on disk available to the caller
__int64 TotalBytes; // number of bytes on disk
__int64 FreeBytes; // free bytes on disk
DWORD SectorsPerCluster=0; // pointer to sectors per cluster
DWORD BytesPerSector=0; // pointer to bytes per sector
DWORD FreeClusters=0; // pointer to number of free clusters
DWORD TotalClusters=0; // pointer to total number of clusters
//char FmtNumber[20];
double Size;
char Units[3];
success = GetDiskFreeSpaceEx((CHAR*)driveName.GetString(), (PULARGE_INTEGER) &AvailableBytes,
(PULARGE_INTEGER) &TotalBytes, (PULARGE_INTEGER) &FreeBytes);
if (!success)
{
success = GetDiskFreeSpace((CHAR*)driveName.GetString(), &SectorsPerCluster,
&BytesPerSector, &FreeClusters, &TotalClusters);
FreeBytes = FreeClusters * SectorsPerCluster * BytesPerSector;
TotalBytes = TotalClusters * SectorsPerCluster * BytesPerSector;
if (!success)
{
return -1;
}
}
if (success)
{
fmtsize(FreeBytes,(double&) Size, Units);
return Size;
}
}
void ::fmtsize( __int64 Number, double &Size, char Units[3])
{
const int KB = 1024;
const int MB = 1024*1024;
const int GB = KB*MB;
double DIV;
if (Number>GB)
{
DIV = double(GB);
strcpy(Units,"GB");
}else if (Number > MB)
{
DIV = double(MB);
strcpy(Units,"MB");
}else
{
DIV = double(KB);
strcpy(Units,"KB");
}
Size = Number / DIV;
}
If you like the answer mark this answer as GOOD and close the Thread.
Regards,
Kushagra
I hate coding but I luv to develop
modified on Tuesday, October 27, 2009 3:12 AM
|
|
|
|
|
hello
basically i am developing an application in which i have to wipe the files/data from a disk those are deleted from the hard disk so tell me how i should do.
|
|
|
|
|
See its not clear what you want to achieve. Give more details on what exactly is your goal, and please spare some time in explaining what have you achieved till now and what is required to be achieved. Please be specific in asking about what you want to do , else its all too vague.
Reagards,
Kushagra
|
|
|
|
|
hi
actually i have an Project to do, in that i have to wipe/clean a disk in a manner so that the deleted data of a disk can not be recovered by any Data Recovery Software.
for that i am doing following things -
1. I am reading the disk Sector by sector.
2. then i overwrite some new value on the sector so that the old one can not be recovered.
Now the problem is that in this process the whole disk is overwritten by a new pattern of value.
But actually i do not need this, i need to overwrite the value of only those file that have been deleted already.
so i need to find the deleted files sector.
For Example:-
if there is a deleted file starting at Sector no 2345 to 2356. So how to do it inmy application using VC++/C++/MFC
Thanks
|
|
|
|
|
|
Which File system, you are using?
Величие не Бога может быть недооценена.
|
|
|
|
|
Windows NTFS and FAT Files system i am using
|
|
|
|
|
I have a multi channel video mixer and want to output the video via HDMI. I started with DirectShow but the latency is like 6 frames. Much too high for what I am doing. Then I moved to DirectX. The problem that instantly surfaced is I dont know when the current frame was sent or when to send the frame. I tried using WaitForVerticalBlank or sensing where the output is but that did not help. Is there a callback I dont know about or some special hook that will allow me to time my output?
High Frequency timer seems to be exteremly inaccurate.
HELP? ideas? Sample code? What I need is something that will allow me to send an interlaced frame of HD video with very low latency. I am trying to use a video board because of its low cost and the fact it should be able to be done.
|
|
|
|
|
Hi,
Is it possible to use a CView derived class to take over "Picture" Control in a dialog box?
I want to re-use CView-derived class functions in the dialog box.
Thank you very much,
|
|
|
|
|
Yes. You can draw anything you want on a CWnd derived window.
Best Wishes,
-David Delaune
|
|
|
|
|
I looked in the Document/View section, and found this article:
Inserting a Doc/Frame/View in a dialog using a custom control[^]
You can't put in a View class all on it's own, you need some support classes. Hopefully this article has done the job for you. If so, give them a vote and a nice comment.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi Iain
Actually, I just need some CMyView functions and draw something in a dialogbox. I don't need the framework.
Anyway, I will have a try to directly integrate the CMyView into a Dialogbox.
Thanks,
|
|
|
|
|
transoft wrote: Actually, I just need...draw something in a dialogbox.
Such as?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi
Such a circle. the important thing is that I want to re-use the functions of CMyView.
Thanks,
|
|
|
|
|
What you are after just does not make sense, or will require lots more work than is necessary. What does your CMyView class do that can't be done within the dialog?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I got this error while building the project.
I have included all header files but still this error remains???
1>Ping.obj : error LNK2019: unresolved external symbol _IcmpCreateFile@0 referenced in function "public: int __thiscall CPing::PingThis(class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> > >)" (?PingThis@CPing@@QAEHV?$CStringT@_WV?$StrTraitMFC@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@@Z)<br />
1>F:\Manmohan\Visual C++\IPM\Debug\IPM.exe : fatal error LNK1120: 1 unresolved externals<br />
#include "StdAfx.h"
#include <IPHlpApi.h>
#include <IcmpAPI.h>
#include "Ping.h"
CPing::CPing(void)
{
}
CPing::~CPing(void)
{
}
int CPing::PingThis(CString m_sAddress)
{
HANDLE hIcmpFile = IcmpCreateFile();
if (hIcmpFile == INVALID_HANDLE_VALUE)
{
return -1;
}
return 0;
}
Future Lies in Present.
Manmohan Bishnoi
|
|
|
|
|
Manmohan29 wrote: 1>Ping.obj : error LNK2019: unresolved external symbol _IcmpCreateFile@0
Does MSDN not work in your area?
LNK2019
This is not the sort of question I'd expect from someone that is creating a multithreaded server application that uses sockets.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I have been given a project from my HOD(Head of Dept.) for a software which will list all the computers which are switched ON during class' time, because guys leave their systems running for downloading.
This software will ping all the IP's of students and anyone's IP found working during class's time will be blocked for 2 days as a punishment.
This software will also be having a module for serving files(articles, minor projects,...) of Electronics Dept. to the students. This I will complete with IOCP server.
I wanted to do it multithreaded way also.(just for trying)
Future Lies in Present.
Manmohan Bishnoi
|
|
|
|