|
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]
|
|
|
|
|
|
Hai!
In my application i have developed a code to draw an image from pixel data present in byte array. i get this byte array by reading an image file present in a location.
I was succesfully displaying (.png, .gif, .jpg, .bmp) but when i tried to display .j2k and .jp2 images using the same code my application displays blank or doesn't display image at all. I came to know that windows doesnot support .jp2 and .j2k images.
Now my doubt is if windows doesnot support them can i be able to display those (.jp2 and .j2k) images on my dialog (assuming i have correctly coded to display an image from byte array of a image file)?
Thanks!
|
|
|
|
|
|
Use CxImage[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Please help to create the machine certificate as I am working on AD RMS,I have installed the Virtual PC now I want to beging with coding in AD RMS project ........So I need to create Machine certificate and to have RAC..............
Help me Out ................
|
|
|
|
|
Hai!
My application creates an .jp2 image file, i am not able to display it on my dialog, so i thought of using a Image converter to convert this .jp2 image to .jpg image, as i am able to display .jpg images on my dialog.
So can you please suggest me any free converter and how to implement it in my application to convert .jp2 image to .jpg image.
I am developing my application in eVC++ for a WIN CE Device and using Pocket PC 2003 SDK.
Thanks!
|
|
|
|
|
CXImage article has good info about your question,you can find it on the Codeproject.
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 )
|
|
|
|
|
I have come across CXimage, But there are so many file (.cpp and .h) for each format of image, moreever i could not even know how to implement it, If you donot mind can you please explain me in detail which files of CXimage to be imported into my application and what code changes to be made so as to convert .jp2 image too .jpg, i need it very badly plz help me!
Thanks!
|
|
|
|
|
try image magik library, it's open source!
"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
|
|
|
|
|
Can you please explain in detail which file to be imported from Image magik and how to implement it in my application
Thanks!
|
|
|
|
|
have you checked out the imagemagik library? check it help, of you downloaded it sourece/com component!
"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
|
|
|
|
|
i declared the following code
class A
{
int i;
public:
void Showi()
{
i=10;
printf("\n i:%d ",i);
}
};
void main()
{
A *p= new A();
p->Showi();
if(p)
{
delete p;
printf("\n p deleted ");
}
p->Showi();
}
the problem is even after i deleted pointer p ..the call to Showi() works....does it mean p is deleted after sometime(since i heard VS 2005 uses GC)?
i am using VC++ 2005 express edition.
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
QuickDeveloper wrote: the problem is even after i deleted pointer p ..the call to Showi() works....does it mean p is deleted after sometime(since i heard VS 2005 uses GC)?
No, there's no such thing as garbage collector in C++. The fact that the call doesn't crash is probably pure luck (edit: see below). In fact you can always call a non virtual function on an object and the function will get called without problems (even if your object is NULL). The problem arise when you try to access data member of the class, in that case the troubles begin . If we take the example of the NULL pointer, an offset will be added to the address of the this pointer (NULL in that case) to be able to reach a specific member of the class. But the address is still invalid (NULL + an offset is still invalid).
In your case, what happened certainly is that when the function is called, the memory of your object has been released but as you didn't allocate any memory after that, the data is still in memory. Now, if you add some code to allocate memory just after the delete, it is possible that the memory used by your class previously will be overwritten by new data.
In fact, when you delete an object, it simply means that the memory is not protected anymore and that it can be reused for something else. If nobody is using it, it still contains the old data.
EDIT: in fact the call will never crash because even if the memory of your integer is overwritten, it can always be accessed without any problem. Of course, in that case you will end up with corrupted data.
|
|
|
|