|
Hello Mr Ankit!
Look Like You are Porting The ClamAv Antivirus,Some one in my comapny is doing same,he has taken insipiration from this article
http://www.codeproject.com/internet/akashkavadnsresolver.asp[^]
HOpe this will help you too, as it sound like you ar egud programmer and i think you willnot face any problem understanding the code
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
http://www.codeproject.com/internet/akashkavadnsresolver.asp[^]
i saw this link but this doesn't support text query
so if somebody if know any another method plz help
thanks in advance
ankit
|
|
|
|
|
Sir!,
i think you have to modify that according to your need!.
i am sorry i can't help you on that.
you have to do that yuor own.
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Dear all,
I had a file handle. How can i get the File name using the file handle. Please help...
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
From where are you getting the File Handle (i.e. which api or function).
anyway you can use this function to get that
WINAPI DWORD GetModuleFileName(
HMODULE hModule,
LPWSTR lpFilename,
DWORD nSize);
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
>Alok wrote "From where are you getting the File Handle (i.e. which api or function). ?"
Difficult to know, his function may have only one parameter ie, file handle. this is called from all over the program
suhredayan There is no spoon.
|
|
|
|
|
............... Got it that's Great
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#include <string.h>
#include <psapi.h>
#define BUFSIZE 512
BOOL GetFileNameFromHandle(HANDLE hFile)
{
BOOL bSuccess = FALSE;
TCHAR pszFilename[MAX_PATH+1];
HANDLE hFileMap;
// Get the file size.
DWORD dwFileSizeHi = 0;
DWORD dwFileSizeLo = GetFileSize(hFile, &dwFileSizeHi);
if( dwFileSizeLo == 0 && dwFileSizeHi == 0 )
{
printf("Cannot map a file with a length of zero.\n");
return FALSE;
}
// Create a file mapping object.
hFileMap = CreateFileMapping(hFile,
NULL,
PAGE_READONLY,
0,
1,
NULL);
if (hFileMap)
{
// Create a file mapping to get the file name.
void* pMem = MapViewOfFile(hFileMap, FILE_MAP_READ, 0, 0, 1);
if (pMem)
{
if (GetMappedFileName (GetCurrentProcess(),
pMem,
pszFilename,
MAX_PATH))
{
// Translate path with device name to drive letters.
TCHAR szTemp[BUFSIZE];
szTemp[0] = '\0';
if (GetLogicalDriveStrings(BUFSIZE-1, szTemp))
{
TCHAR szName[MAX_PATH];
TCHAR szDrive[3] = TEXT(" :");
BOOL bFound = FALSE;
TCHAR* p = szTemp;
do
{
// Copy the drive letter to the template string
*szDrive = *p;
// Look up each device name
if (QueryDosDevice(szDrive, szName, BUFSIZE))
{
UINT uNameLen = _tcslen(szName);
if (uNameLen < MAX_PATH)
{
bFound = _tcsnicmp(pszFilename, szName,
uNameLen) == 0;
if (bFound)
{
// Reconstruct pszFilename using szTemp
// Replace device path with DOS path
TCHAR szTempFile[MAX_PATH];
_stprintf(szTempFile,
TEXT("%s%s"),
szDrive,
pszFilename+uNameLen);
_tcsncpy(pszFilename, szTempFile, MAX_PATH);
}
}
}
// Go to the next NULL character.
while (*p++);
} while (!bFound && *p); // end of string
}
}
bSuccess = TRUE;
UnmapViewOfFile(pMem);
}
CloseHandle(hFileMap);
}
printf("File name is %s\n", pszFilename);
return(bSuccess);
}
the above code is from msdn.
Suhredayan
|
|
|
|
|
Dear Suhredayan,
This is what i actually need. Thanks for your great help.
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
|
Hello Friends,
Can a class be declared as protected ?
For example
class X : protected Y
{
}
what is signifance of the above code ?
Can a class declared as protected as shown in the above?
Hoping for a reply.
Philip
|
|
|
|
|
phijophlip wrote:
what is signifance of the above code ?
It indicates that any members of X derived from Y have at least protected visibility. If they're defined as public in the base class they'll be protected in the derived class. I like to remember this little table:
A B C D
public public protected private
protected protected protected private
private private private private Where:
- A - is the visibility of the member in the base class
- B - is the visibility of the member in the derived class with public inheritance
- C - is the visibility of the member in the derived class with protected inheritance
- D - is the visibility of the member in the derived class with private inheritance
I hope that's clear enough to understand
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Great Ryan, thats a cool way to remember it. I know this public private stuff but this is a really easy way to recall things quickly.
I hated going to weddings. All the grandmas would poke me saying "You're next". They stopped that when I started doing it to them at funerals.
My Articles
|
|
|
|
|
phijophlip wrote:
Can a class be declared as protected ?
no, a class is a type which you can use to create objects.
in the opposite, a class can have its members (datas or functions) set as public, protected or private, but that delimits only the access to the members from outside of the class...
phijophlip wrote:
class X : protected Y { /*...*/ };
what is signifance of the above code ?
you are not declaring X as protected, you are declaring X, adding the precision that X is derivated ("protectedly") from Y, that means that only public and protected members of Y will be accessible from X...
ps : don't forget the smi-colon (';') after the declaration-closing bracket ('}') of the class...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I am from china,I have been developing software by Visual C++ 6.0 three years.but Visual C++ 6.0 is the last version.Now there are many developers using it to develop in china.so I wonder if Visual C++ 6.0 is still used by many developer all over the world?
your friend:bobi
|
|
|
|
|
|
Hi:
What are you from? Do you develop on .NET?
your friend:bobi
|
|
|
|
|
I use the 6.0 version of the language but I use the .net ide
|
|
|
|
|
Why do you use .net ide instead of VS 6.0?
your friend:bobi
|
|
|
|
|
Using vs.net ide for last 10+ months. But I still missing my shortcuts over here which is replaced with diffrent ones. Like ctrl+shift+g opens the include file etc etc. And also faced some problems at the begining to add oninitdialog() to my dialog class .
suhredayan There is no spoon.
|
|
|
|
|
My general rule of thumb is:
Applications that are complex and large enough to warrant diistribution on media are developed in NET.
Applications that are intended to be distributed by download are developed in VS6 to keep the download size smalller.
Someday in the future when most people are using an OS that installs the Net Framework already I will use NET exclusively. In the meantime, I don't want to require people who are downloading a small software application to possibly also have to download a 25MB framework file just to get the application to run.
Robert
|
|
|
|
|
I agree with you! Do you think how long the VS 6.0 will replace with .NET entirely? thank you very much
your friend:bobi
|
|
|
|
|
Well, win98 has been around for more than 7 seven years, and a lot of people still use it. Newer versions of XP and Win2003 are the only ones that install the fraemework as standard procedure. VS6 is still very much alive and kicking. Who knows? Years if at all is my guess...
|
|
|
|
|
It's probably not really important from a practical perspective if or when the actual platform, for example NET, replaces VS6.
Rather, the meaningful question is at what point in time does any particular skill become widely obsolete or widely required in the job market?
C++ is in general is by no means obsolete the US, but NET has already replaced VS6 in becoming the latest must-have essential skill in much of the job market.
So in the important sense, NET has or soon will "replace" VS6 because employer demand for NET skills have either already surpassed, or soon will surpass VS6 skills in terms of a developer's marketibility.
I could not comment on that status in China.
At what point in time do you think most software companies in China will have managed to acquire bootlegged illigitemate copies of VS.NET? That is the time when VS6 skillsets will need to be replaced by VS.NET skillsets.
|
|
|
|
|
Hi all:
I am using OLE DB consumer templates to access database like:
datasource.Open(...);
session.Open(datasource);
command.Open(session,...)
Question is how could I know there is something or nothing (rows) returned from command.Open() method?
Thank you very much!
Lisoft
|
|
|
|