|
Ya ofCourse, you can use DeviceIoControl codes. for creating any partition (primary or logical) IOCTL_DISK_SET_DRIVE_LAYOUT can be used.
|
|
|
|
|
Thanks CMylife.
I am going to implement it now. I will consult you after trying it.
thanks
|
|
|
|
|
Its good that you are trying yourself. nothing you have to do. u first of all get the all partitions information by using IOCTL_DISK_GET_DRIVE_LAYOUT, then just edit the partition number, its offset, size and the last parameter , set that to true and finally run the IOCTL_DISK_SET_DRIVE_LAYOUT code from there itself. and then you are done with a new partition.
All the best.
|
|
|
|
|
Thanks CMyLife.
I am not sure that you will get my query today coz this thread is of one day old.
I have successfully created the partition using IOCTL_DISK_SET_DRIVE_LAYOUT. But now I am stuck in formatting this raw partition.
There is one function FormatEx() but it is only for Vista. Is there any other way to format partition without using DISKPART and SHFormatDrive like some ioctl code.
Thanks
|
|
|
|
|
Did you see FormatPartition and CreatePartition ?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
These look like they're for Windows CE.
Steve
|
|
|
|
|
google for FMIFS.h and FMIFS.dll to format any volume.
|
|
|
|
|
OH... Pardon me I have quoted you without reading this reply from ur side.
I am just checking for these FMIFS.h and FMIFS.dll
Thanks
|
|
|
|
|
I want to create a CBitmap which I can them put inside an image list. Now I have the width, height and an array of RGB values. How can I create a valid CBitmap object from that?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Create an hidden CDC, attach the bitmap to it then use CDC::SetPixel for example
There is also CBitmap::SetBitmapBits
Russell
|
|
|
|
|
Hi, Russell
Thanks for replying. CDC::SetPixel would be too slow for me, I need to make thumbnails of potentially many files. CBitmap::SetBitmapBits doesn't seem to accept width/height in the params.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
sashoalm wrote: CBitmap::SetBitmapBits doesn't seem to accept width/height in the params
According to my VS2008 MSDN, SetDIBits[^] should be used in preference to SetBitmapBits. SetDIBits allows you to specify the bitmap size, I believe.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
HI all,
I am new in this field. I have a application (not dialog based, i want to change the default mouse cursor as a pen (as paint). There are no this type of cursor. How can i do this?
Regards
Shaheen
THANKS TO ALL
|
|
|
|
|
use SetCursor api! read more about it in MSDN documentation
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
See SetCursor[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
First you have to create the cursor using the resource editor using your drawing skills.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Use the following APIs.
First load the required cursor using either.
1) LoadCursor(NULL, IDC_ARROW);//User for arrow cursor
2) HCURSOR LoadCursorFromFile( LPCTSTR lpFileName); //Give the name of the .CUR file (Pen cursor file)as parameter.
Both these functions return HCURSOR.
Then set this cursor using API.
HCURSOR SetCursor(HCURSOR hCursor);
Thanks,
Sujeet.
|
|
|
|
|
There are n arrays, and there are several elements in each.
Count of array and count of elements in array are variable.
A1{a1,a2,a3,an1} //there are n1 elements in array A1
B1{b1,b2,b4,bn2} //there are n2 elements in array B1
.....
N1{n1..nn} //there are n elements in array N1
I need all the combination which are composed with one element of every array,order is same as the array's
like:
a1,b1,.....n1
a1,b2,.....n2
...
a2,b1,.....n1
...
an1,bn2,....nn
|
|
|
|
|
what about stl::Vector, you can use like this :-
#include<vector>
using namespace std;
typedef vector<int> vecINT;
typedef vector<vecINT> vecINTINT;
vecINTINT vecArrays;
vecINT vecA;
vecA = A1{a1,a2,a3,an1}
a.push_back(vecA);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Thank you very much for your reply, but I am not quite clear about it. Would please explain it in detail? I need a algorithm to get all the combinations.
|
|
|
|
|
You've just to write a loop for each array (and nest the loops) is it difficult?
You may also use recursion.
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]
|
|
|
|
|
CPallini wrote: You may also use recursion.
recusion, sometimes it's quite difficult even for seasoned programmer. Though, recursion is good programming practice, come handy when you travelling through tree like data structure.. but it's a pain when you have to debug it
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Because the count of array is variable, it is difficult to use loop. Recursion is good idea, but would you please write some sample code for me? thank u!!
|
|
|
|
|
#include <vector>
#include <iostream>
using namespace std;
void step(unsigned int level, vector < vector <char> > & v, vector <char> & res);
void main()
{
vector< char > v1;
vector< char > v2;
vector< char > v3;
vector< char > v4;
vector< char > v5;
vector < vector < char > > v;
v1.push_back('a');v1.push_back('b');v1.push_back('c');
v2.push_back('d');v2.push_back('e');
v3.push_back('f');v3.push_back('g');v3.push_back('h');
v4.push_back('i');v4.push_back('j');v4.push_back('k');v4.push_back('l');
vector < char > res;
v.push_back(v1);v.push_back(v2);v.push_back(v3);v.push_back(v4);
res.resize(v.size());
step(0, v, res);
}
void step(unsigned int level, vector < vector <char> > & v, vector <char> & res)
{
for (unsigned int i=0; i<v[level].size(); i++)
{
res[level] = v[level][i];
if ( level == v.size()-1)
{
for (unsigned int k=0; k<res.size(); k++)
{
cout << res[k];
}
cout << endl;
}
else
{
step(level + 1, v, res);
}
}
}
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]
|
|
|
|
|