|
yes, of course, please do.
~RaGE();
|
|
|
|
|
Hello,
I'm trying to list all volumeIDs of a removable storage which has two
partitions. In the Disk Management interface, Windows limits to 1 the
number of partition that you can mount from a removable storage. I'm
trying to programmatically get the volume ID of this second partition
and mount it. I use the piece of code below which works great but list
only the first partition of the removable device.
Questions:
- Is the VolumeID of the second partition created somewhere but it's
"simply" not listed or isn't it created at all (which would be bad)?
- If it exists, how to get the VolumeID of the second partition and
then mount it?
- If it doesn't exist, how to create it? Or How to modify the storage
type from "removable" to "basic"?
Gregoire
#define BUFFER_SIZE 10240
struct tagDrives
{
WCHAR letter;
WCHAR volume[BUFFER_SIZE];
} g_drives[26];
int g_count = 0;
BOOL GetAllRemovableDisks()
{
WCHAR caDrive[4];
WCHAR volume[BUFFER_SIZE];
int nLoopIndex;
DWORD dwDriveMask;
caDrive[0] = 'A';
caDrive[1] = ':';
caDrive[2] = '\\';
caDrive[3] = 0;
g_count = 0;
dwDriveMask = GetLogicalDrives();
if(dwDriveMask == 0)
{
return FALSE;
}
for(nLoopIndex = 0; nLoopIndex< 26; nLoopIndex++)
{
if(dwDriveMask & 1)
{
caDrive[0] = 'A' + nLoopIndex;
if(GetVolumeNameForVolumeMountPoint(caDrive, volume, BUFFER_SIZE))
{
g_drives[g_count].letter = caDrive[0];
wcscpy(g_drives[g_count].volume, volume);
g_count ++;
}
}
dwDriveMask >>= 1;
}
if(g_count == 0)
{
return FALSE;
}
else
{
return TRUE;
}
}
WCHAR GetSpecificDrive(
LPTSTR lpDevID)
{
HDEVINFO hDevInfo;
GUID guid;
BYTE buffer[BUFFER_SIZE];
DWORD dwRequiredSize ;
WCHAR buf[BUFFER_SIZE];
DEVINST devInstParent;
DWORD dwIndex;
WCHAR volume[BUFFER_SIZE];
int nLength,nLoopIndex;
SP_DEVICE_INTERFACE_DATA devInterfaceData;
SP_DEVINFO_DATA devInfoData;
PSP_DEVICE_INTERFACE_DETAIL_DATA pDevDetail;
devices.
guid = GUID_DEVINTERFACE_VOLUME;
hDevInfo = SetupDiGetClassDevs(&guid, NULL, NULL,
DIGCF_DEVICEINTERFACE |
DIGCF_PRESENT);
if(hDevInfo == INVALID_HANDLE_VALUE)
return 0;
for(dwIndex = 0; ;dwIndex ++)
{
ZeroMemory(&devInterfaceData, sizeof(devInterfaceData));
devInterfaceData.cbSize = sizeof(devInterfaceData);
if(!SetupDiEnumDeviceInterfaces(hDevInfo, NULL,
&guid,dwIndex,&devInterfaceData))
break;
ZeroMemory(&devInfoData, sizeof(devInfoData));
devInfoData.cbSize = sizeof(devInfoData);
pDevDetail = (PSP_DEVICE_INTERFACE_DETAIL_DATA)buffer;
pDevDetail->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
SetupDiGetDeviceInterfaceDetail(hDevInfo,
&devInterfaceData,
pDevDetail,
BUFFER_SIZE,
&dwRequiredSize,
&devInfoData);
CM_Get_Parent(&devInstParent,devInfoData.DevInst, 0);
CM_Get_Parent(&devInstParent,devInstParent, 0);
CM_Get_Device_ID(devInstParent, buf, BUFFER_SIZE,0);
nLength = wcslen(pDevDetail->DevicePath);
pDevDetail->DevicePath[nLength] = '\\';
pDevDetail->DevicePath[nLength+1] = 0;
MessageBox(0,buf, pDevDetail->DevicePath, 0);
if(GetVolumeNameForVolumeMountPoint(pDevDetail->DevicePath, volume,
BUFFER_SIZE))
{
MessageBox(0,volume, L"VolumeID", 0);
for(nLoopIndex=0; nLoopIndex< g_count; nLoopIndex++)
{
if(wcscmp(g_drives[nLoopIndex].volume, volume)==0)
{
WCHAR pszdrive[5];
pszdrive[0]=g_drives[nLoopIndex].letter;
pszdrive[1]='\0';
MessageBox( 0, pszdrive,L"Drive",0);
}
}
}
}
SetupDiDestroyDeviceInfoList(hDevInfo);
return 0;
}
|
|
|
|
|
How can I make a service application from a win32 console application written in c/c++ ?
|
|
|
|
|
|
I want to have the mainframe of the app show up, but dont want the childframe view that is automatically created and shown when the app is run (this is just what the appwizard created).Instead I want to use the File menu to launch some other window that I will create later.
How do I get the childview to not show up?
thanks,
sb
|
|
|
|
|
ns wrote: I want to have the mainframe of the app show up, but dont want the childframe view that is automatically created and shown...
See MSDN article Q141725.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
If the colomns are 10 and list control type is report then,
How many rows (maximum) we can enter in a list countrl?
If I have the records more than 10,000 then is this good for displaying the records by getting from the database?
Or any suggestions. Thanks.
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
10,000 items in a list control is certainly possible.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thank you sir, for looking into my problem.
Thanks for you both.
I posted this question because of that I am expecting the preformance will be decreased. If any suggestions please kindly let me know.
I am doing a simple program like inventry control.
In that I am using this list control.
But after fetching 10,000 to 20,000 records,
I mean after 5 or 6 months the records will be around more than 10,000 or may be 20,000 records, so if it is after one year it will very slow, and after more than that time .......
So I am bothering about the preformance.
Please guide me in better way.
Thanks for looking into my problem.
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
can't you add a filtering option so that you don't display the whole entries ?
moreover, the only way to know if it becomes too slow or not is still to make the test !!!
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
G Haranadh wrote: ...I am expecting the preformance will be decreased.
Then use a virtual list control instead. Used correctly, it can greatly improve performance.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Virtual List control? could you please tell me.
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
G Haranadh wrote: Virtual List control? could you please tell me.
See examples here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
regarding the index type (int ), you might have about 2 147 483 647 (232 / 2 - 1) or more items on a list...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
Are you all from Itally
VuNic
|
|
|
|
|
|
i'm not from ITALY, are you from ITALY..? get me now?;)
VuNic
|
|
|
|
|
erf, i've just understood the trick with italy/italic...
lol
well, i let you guess where i'm from sure you can find
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
looking at your bright orange color, i'm sure you are from Holland. ;P
VuNic
|
|
|
|
|
|
Hi,
I'm implementing a binary protocol and I need to serialize a C++ double type value. I know that the VS compiler implements doubles with IEEE 754 format, but I need to ensure the portability of my code throught different compilers (and the floating point format is implementation defined). The question is if do you know any library or some function to convert a double into a stream of bytes encoded with the IEEE format. Another question is, will I have any endianess problems with IEEE floating point formats, or different endianess machines order floating point numbers the same?
Thanks,
Federico
|
|
|
|
|
I had a similar problem once. It looks like there was this big/little-endian problem for data representation. At least I did not crack it, I just found a simpler solution which was good enough. What I did was : convert a double value into a string, send it as a text string and convert it back on the remote computer. String-numeric conversion functions are common.
I hope it helps.
Nick
|
|
|
|
|
Hi all
As when system is switched on, and we press del key then instead of operating system load we enter into setup.
I also need to do same, that means, when system is started to on and if press any key (any one of the key), then Operating system loading should be halted. and my application should run.
Please guide me,
Thanks
|
|
|
|
|
rajeevktripathi wrote: As when system is switched on, and we press del key then instead of operating system load we enter into setup.
This is happening at the BIOS level. Before Windows is loaded into memory, the POST code is executed.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|