|
|
Yeah thats right,;) Hi Alok how are you?
I think its better I use of my name and also without any sig very simple.
|
|
|
|
|
|
can anyone tell me what is INT_PTR ?
thanks
|
|
|
|
|
A signed integral type that is the same size as a pointer. So 4 bytes in Win32, 8 bytes in Win64.
|
|
|
|
|
same size as a pointer, but its not a pointer. correct ?
|
|
|
|
|
you got it...
it's simply badly named. but it's an int...
|
|
|
|
|
How about pressing F12 on it, or at least open basetsd.h and search for it?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi all vc++ masters \
i use this code for cd rom open and close
but this gives
'OpenVolume' : local function definitions are illegal
'OpenVolume' : cannot convert parameter 1 from 'char [3]' to 'char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
NOTE:the line contain stars shows errors;
DWORD IOCTL_STORAGE_EJECT_MEDIA;
DWORD bytesreturned;
HANDLE OpenVolume(TCHAR cDriveLetter)
****{HANDLE hVolume;
UINT uDriveType;
TCHAR szVolumeName[8];
TCHAR szRootName[5];
DWORD dwAccessFlags;
wsprintf(szRootName, szRootFormat, cDriveLetter);
uDriveType = GetDriveType(szRootName);
switch(uDriveType) {
case DRIVE_REMOVABLE:
dwAccessFlags = GENERIC_READ | GENERIC_WRITE;
break;
case DRIVE_CDROM:
dwAccessFlags = GENERIC_READ;
break;
default:
_tprintf(TEXT("Cannot eject. Drive type is incorrect.\n"));
return INVALID_HANDLE_VALUE;
}
wsprintf(szVolumeName, szVolumeFormat, cDriveLetter);
hVolume = CreateFile( szVolumeName,
dwAccessFlags,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL );
if (hVolume == INVALID_HANDLE_VALUE)
ReportError(TEXT("CreateFile"));
return hVolume;
}
*****HANDLE hVolume = OpenVolume("D:");DeviceIoControl( hVolume, IOCTL_STORAGE_EJECT_MEDIA, NULL, 0, NULL, 0, &bytesreturned, NULL );
thanks
special thanks to MR Naveen
|
|
|
|
|
//the first error may be caused by placing function OpenVolume inside of another funtion.
//the second is, TCHAR cDriveLetter means just pass a single charecter (Driveletter ie, 'D' )
//DWORD IOCTL_STORAGE_EJECT_MEDIA allready defined in winioctl.h
DWORD bytesreturned ;
TCHAR szRootFormat[5] = {"%c:\\" } ;
TCHAR szVolumeFormat[9] = {"\\\\.\\%c:" } ;
HANDLE OpenVolume( TCHAR cDriveLetter )
{
HANDLE hVolume;
UINT uDriveType;
TCHAR szVolumeName[8];
TCHAR szRootName[5];
DWORD dwAccessFlags;
wsprintf(szRootName, szRootFormat, cDriveLetter);
uDriveType = GetDriveType(szRootName);
switch(uDriveType)
{
case DRIVE_REMOVABLE:
dwAccessFlags = GENERIC_READ | GENERIC_WRITE;
break;
case DRIVE_CDROM:
dwAccessFlags = GENERIC_READ;
break;
default:
_tprintf(TEXT("Cannot eject. Drive type is incorrect.\n"));
return INVALID_HANDLE_VALUE;
}
wsprintf(szVolumeName, szVolumeFormat, cDriveLetter);
hVolume = CreateFile( szVolumeName ,
dwAccessFlags,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL );
if ( hVolume == INVALID_HANDLE_VALUE )
{
_tprintf(TEXT("Error Creatfile ") ) ;
}
return hVolume ;
}
int _tmain(int argc, _TCHAR* argv[])
{
HANDLE hVolume = OpenVolume( 'D' ) ; //TCHAR Stands for a single charecter
DeviceIoControl( hVolume, IOCTL_STORAGE_EJECT_MEDIA, NULL, 0, NULL, 0, &bytesreturned, NULL );
return 0;
}
|
|
|
|
|
thanks sir
i us this code as u specify but problem is now as:
errors:
'OpenVolume' : local function definitions are illegal
main' : local function definitions are illegal
i use whole code inside this :
void CInoutDlg::OnButton3()
now please tell me where am i wrong
thanks
|
|
|
|
|
u should not place the HANDLE OpenVolume( TCHAR cDriveLetter ) definsion insde of "void CInoutDlg::OnButton3()" because this is another function, one function definition cant be place inside of another one.
//so put the code here
HANDLE OpenVolume( TCHAR cDriveLetter )
{
...
}
void CInoutDlg::OnButton3()
{
//call OpevVolume
HANDLE hVolume = OpenVolume( 'D' ) ; //TCHAR Stands for a single charecter
DeviceIoControl( hVolume, IOCTL_STORAGE_EJECT_MEDIA, NULL, 0, NULL, 0, &bytesreturned, NULL );
}
|
|
|
|
|
|
Hi all
Can we use windows filtering platform APIs in windows XP SP 2 and window 2000
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Can anybody tell me how to find out the drive partitioning of a stand alone machine using c++
Thanks in advance
|
|
|
|
|
Lets say that we have an application running, and then the user enters things into another window, lets say notepad. How can that application get what the user entered into notepad? In other words, how can an application record keystrokes being entered into other applications? Or if a user just types something when there's no application running?
For some reason, the words "global keystroke" just popped into my head. I think I've been working too much with global variables. I despise them.
Anyway, it would also help if there is some way to get the application name in which the user types. I'm going to use this for several purposes, one of which is to make a rather primitive keylogger.
Thanks in advance!
|
|
|
|
|
I don't know the answer, but propably the users here can't answer you because keyloggers
are hacking-tools to spy login/passwords etc...
but anyway good luck for your project.
|
|
|
|
|
you need to use Key hook for that. Find SetWindowsHookEx in MSDN. There u will how to set the global Keyboard hook. u need to have prior .dll knowledge for that. You wiil fing lots of project on keylogger which uses this hooks in Codeproject.
|
|
|
|
|
Is there an easier way to do this without using hooks? Like is there some modifiable part of windows that I can modify so that all keystroke messages are "redirected" to my app?
Well, that would also be hard to handle...;P
|
|
|
|
|
Hello everyone,
I am learning how to write out-of-proc server COM DLL using unmanaged C++. Could anyone refer some learning resources and samples for me?
I have a couple of months experiences of developing in-proc COM DLL before.
thanks in advance,
George
|
|
|
|
|
You will have to learn about DCOM and how to build a exe server and build, register and use proxy/stubs.
Try to good a search for DCOM on here I am sure someone has wrote something?
Yours Truly, The One and Only!
|
|
|
|
|
Thanks NightOwl,
I have found some materials, but all about them are about concept introduction (like some MSDN document). What I need is a step-by-step tutorial with source codes.
Do you have any referred resources?
regards,
George
|
|
|
|
|
I have two binary tree structures shown below. The unsortedBTree has values and the sortedBTree is empty. I want to fill the sortedBTree with the values of unsortedBTree sorting them by the values of counter inserting the biggest values to the right. Can anyone please give a short sample code on how to do it without recurtion, but with a while loop?
typedef struct UNSORTEDBTREE {
int a[3];
int counter;
unsortedBTree *left;
unsortedBTree *right;
unsortedBTree *parent;
}unsortedBTree;
typedef struct SORTEDBTREE {
int a[3];
int counter;
sortedBTree *left;
sortedBTree *right;
sortedBTree *parent;
}sortedBTree;
Thanks in advance!
sirtimid
|
|
|
|
|
In my c++ app, i need to "tell" user about weekday by number.
in general, people accept this way:
1=Mon, 2=Tue, ...., 7=Sun.
or:
1=Sun, 2=Mon, ..., 7=Sat.
which one is correct, or other ways?
thanks
|
|
|
|
|
Well, if you follow SYSTEMTIME, its
wDayOfWeek
Specifies the current day of the week; Sunday = 0, Monday = 1, and so on.
if you follow COleDateTime its
Valid return values range between 1 and 7, where 1=Sunday, 2=Monday, and so on.
|
|
|
|
|