|
Try to debug and find out what is happening.
|
|
|
|
|
I got it. Its Working now.
Thanks Sir ji.
Thanks David For your Info also.I will try your way too.
Regards
Yogesh
|
|
|
|
|
Hi,
Rather than using SetCursorPos you could use the SendInput function[^]. This would allow you to set some 'extra info' for marking simulated user input.
For example:
BOOL setcursorposition(long x, long y)
{
INPUT input = {0};
input.type = INPUT_MOUSE;
input.mi.dx = ((x - GetSystemMetrics(SM_XVIRTUALSCREEN)) * 65535) / (GetSystemMetrics(SM_CXVIRTUALSCREEN)-1);
input.mi.dy = ((y - GetSystemMetrics(SM_YVIRTUALSCREEN)) * 65535) / (GetSystemMetrics(SM_CYVIRTUALSCREEN)-1);
input.mi.dwFlags = MOUSEEVENTF_VIRTUALDESK | MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
input.mi.dwExtraInfo = 0xC0DEDBAD;
return SendInput(1, &input, sizeof(input));
}
void YourClass::OnMouseMove(UINT nFlags, CPoint point)
{
if(0xC0DEDBAD != GetMessageExtraInfo())
{
}
YourBaseClass::OnMouseMove(nFlags, point);
}
Don't forget to convert client coordinates to screen before calling setcursorposition.
Best Wishes,
-David Delaune
|
|
|
|
|
This is definitely the best approach.
I wish I could rate your post.
JohnCz
|
|
|
|
|
I have to Write Program code in C++ for car Parking system using queues ,In which any VIP car is given Priority,The code should contain some simple graphics also..
|
|
|
|
|
|
Listen here you.
This is the third time I have seen this 'question' posted.
You have not received any answers yet because you refuse to observe the forum guidelines. You will continue to receive no help until your method of enquiry improves.
Some suggestions:
1. Work out what you're trying to do
2. Work out how you intend to do this
3. Implement this plan in code.
You should NOT post a question on CodeProject when it relates to point 1.
Questions that ask about how to realize point 3 will be most favourably answered.
My 1
Consider the following contrived questions:
Q1: "I have to build a shed, with a window and shelves. It should not be very basic."
Q2: "I am building a shed with shelves. I have selected part# XXX to fix the shelves to the wall. I am having trouble attaching this part to the walls with nails. I am trying YYY, is this the correct way to use part XXX?
Is there a better way for me to attach the shelves to the walls?"
|
|
|
|
|
ok leaving this forum,i dont have time to read the guidelines,,,i need urgent help,which is not seen yet in this forum..
|
|
|
|
|
Good!
If your Lordship had taken time to read the guidelines, he would have realized that this forum does NOT supply 'urgent help'
Thanks for giving us the chance to ensure your precious time wasn't wasted, it's always a pleasure serving ingrates..
|
|
|
|
|
Sorry, I'm firmly contrary to giving higher priority to VIP cars.
Veni, vidi, vici.
|
|
|
|
|
|
Bad boy.
Veni, vidi, vici.
|
|
|
|
|
You forgot urinating on the door handles. Always makes me laugh!
==============================
Nothing to say.
|
|
|
|
|
At my age I'm not sure my pressure or aim is up to that. I'm off to the pub later, I'll try it on the way home and text y'all from the cells when I find out how it works
|
|
|
|
|
You useless arse. Who the hell employed you to write code.
And if you are still at college, change courses, you are totally incapable of becoming a programmer.
==============================
Nothing to say.
|
|
|
|
|
Good luck with that!
|
|
|
|
|
ambreen1153 wrote: have to Write Program code in C++ for car Parking system using queues ,In which
any VIP car is given Priority,The code should contain some simple graphics
also..
1. Learn basic C++ programming
2. Learn basic GUI programming in C++
3. Learn how to design an application
4. Learn how to build a queue that supports prioritization
5. Put steps 1-4 together.
6. Unit test 5.
|
|
|
|
|
Is this graphics simple enough?
|
|
|
|
|
That post came in with pure hope, optimism and joy.
I wonder what sort of fantasy dream or vision the poster was expecting from this forum. It reminds of those people that walk around and always ask if you have an extra cigarette.
I guess in the unicorn world, everyone would of pitched in to write the program, and we can all eat candy corn, or simply feed off the rock candy mountain.
I know the poster left with a dead unicorn and a rainbow of fire.
The only thing missing was delete your bookmark on the way out.
Thanks for the humor today
|
|
|
|
|
hello guys... I am trying to return CArray which I create locally in a function. It simply caontains names. Now this array will be modified by other functions. Here is what it looks like
CArray<CString> CMainDlg::GetNames()
{
CArray<CString> arrNames;
arrNames.SetSize(10);
arrNames.SetAt(0, "Ali");
arrNames.SetAt(1, "Salman");
arrNames.SetAt(2, "Zahid");
arrNames.SetAt(3, "Mehmood");
arrNames.SetAt(4, "Tariq");
return arrNames;
}
But the compiler is showing me this error stating - Error C2248: Can not access private member of class CObject . Whats wrong with this code? Thanks for input.
This world is going to explode due to international politics, SOON.
modified 24-May-12 5:17am.
|
|
|
|
|
Apparently you cannot use the CArray copy constructor. As a workaround you may rewrite the method this way:
void CMainDlg::GetNames(CArray <CString> & arrNames)
{
arrNames.SetSize(10);
arrNames.SetAt(0, "Ali");
arrNames.SetAt(1, "Salman");
arrNames.SetAt(2, "Zahid");
arrNames.SetAt(3, "Mehmood");
arrNames.SetAt(4, "Tariq");
}
Veni, vidi, vici.
|
|
|
|
|
May be I am making mistake here but it is not working for me. Here is what I am trying using your technique.
a.h
-------------
private:
CArray<CString> srrNames;
public:
void GetNames(CArray<CString>&);
a.cpp
-------------
void CMainDlg::GetNames(CArray<CString>& arrNames)
{
arrNames.SetSize(10);
arrNames.SetAt(0, "Ali");
arrNames.SetAt(1, "Salman");
arrNames.SetAt(2, "Zahid");
arrNames.SetAt(3, "Mehmood");
arrNames.SetAt(4, "Tariq");
}
And now in a.cpp , till calling GetNames is fine. But as I said earlier, this will be modified by other functions (which are in another class). Passing it's reference is not working. How do I pass this to other function?
This world is going to explode due to international politics, SOON.
|
|
|
|
|
Overloaded_Name wrote: Passing it's reference is not working.
What does it mean, exactly?
Veni, vidi, vici.
|
|
|
|
|
Well it means it is giving error. I am doing this.
objB.ModifyUsers(&arrUsers);
The error it gives is:
error C2664: cannot convert parameter 1 from 'CArray<TYPE> *' to 'CArray<TYPE> &'<br />
I don't know whether should I do this or not.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
Overloaded_Name wrote: objB.ModifyUsers(&arrUsers);
Should be instead
objB.ModifyUsers(arrUsers);
Veni, vidi, vici.
|
|
|
|