|
Hi,
Am a systems programmer.
I just wanted to know a sample code in c/c++ which can be compiled in vc++ environment.
The code sould be able to accept just the DSN username and password and should be able to connect to the database.
And the possible APIs that can be used for result sets,
using and executing queries.
|
|
|
|
|
First create a working DSN using the ODBC applet in Control Panel. Then use AppWizard to create a new SDI (or MDI) project. When asked for database support, select the DSN that you just created. All the right files and classes will be created for you.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
i create pipes between 2 windows applications.
stdout and stderr work well, but stdin doesn't.
i try ::ReadFile(stdin,...) in side a thread, the function failed.
any comments (hope samples).
note: communications are between 2 windows apps, i saw many dos samples, but i think they may not work in windows env.
thx
includeh10
|
|
|
|
|
As using RemoveDirectory(),we can only delete empty dir,how should i proceed to delete a directory including its subdirectories and files.Please help..
|
|
|
|
|
Remarks from RemoveDirectory MSDN docs:
To recursively delete the files in a directory, use the SHFileOperation function.
|
|
|
|
|
Did suhredayan not answer this for you yesterday?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
Hello,
I want to create a functions that can return three or 4 or ... times. Like an
Enum function.Just Like enumWindows that for each window returns.
Best Wishes,
Thanks.
|
|
|
|
|
If you are refering to call back functions as it seems, its not returning 3 or 4 times. Instead your registered call back function is called 3 or 4 times using the function pointer you passed to it as a parameter.
suhredayan There is no spoon.
|
|
|
|
|
|
javad_2005 wrote:
Yes I want that...
Don worry, Here I am. Tell me your wish, but a bit loud.
suhredayan There is no spoon.
|
|
|
|
|
i want to delete the subdirectories and files of a directory.Using removeDirectory() only empty directories
can be deleted.How should i proceed?please help..
|
|
|
|
|
check out SHFileOperation().
suhredayan There is no spoon.
|
|
|
|
|
Hi all:
I have a tree control which has no special attributes. But when I added the files "1.wma" or "34.wma"(all the files which has a numerical file name) later it turned out to be "wma.1" and "wma.34" appearing in the tree items, but the physical name within file system still the same, like "1.wma".... It seems all the file name get swapped between names and extensions, but the file without numerical name can be displayed correctly.
I tried very carefully to look this codes into details but still don't go much far. I doubt whether the specific tree control attribute should be removed or added?
Thanks for viewing and anwering!
|
|
|
|
|
Hello
to all of u
i am using api DNSQUERY to get the version of database of main.cvd and daily.cvd files of clamav(antivirus) from current.cvd.clamav.net
i am getting the correct remote version but this api is not supported by windows 98 so please tell me any api or any other way how can i get the result on win 98 also
Thanks in advance
ankit
|
|
|
|
|
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.
|
|
|
|
|