|
what i read just now is LUID is a log on ID for a user(or its SID).Whether it means LUID changes every time the same user(SID)log in.Is there any other purpose of LUID
Pls help me.Thanx in advance
-- modified at 3:02 Monday 14th November, 2005
|
|
|
|
|
Hey can u tell me how to create a Modelless dialogbox
in an MFC application.
Till date i was creating a ressouce of dialogbox from
resource editor , then added a class for it and later
on use to display it by usin code.
CmyDialobox dlgbox;
blgbos.DoModel();
How do make it modelless dialogbox so the user can aslo
interact with the background MDI application.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
dlgbox->Create(ID,parent);
dlgbox->ShowWindow(style);
|
|
|
|
|
Small things are important
i have done this before but due to
imporper availibility of the docment
could not get to it back
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I have an object which will be used as a key in stl map. Although I had overridden all the comparison operator (==, >, <, >=, <=), the vc++ compiler still makes complain on:
Compiling...
point.cpp
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\functional(86) : error C2678: binary '<' : no operator defined which takes a left-hand operand of type 'const class Point' (or there is no acceptable conversion)
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\functional(86) : while compiling class-template member function 'bool __thiscall std::less<class point="">::operator ()(const class Point &,const class Point &) const'
Error executing cl.exe.
point.exe - 1 error(s), 0 warning(s)
Any suggestion/ advice is very much appreciated.
cheok
#include
#include <assert.h>
using namespace std;
class Point {
public:
Point() {
this->x = 0;
this->y = 0;
}
Point(int x, int y) {
this->x = x;
this->y = y;
}
Point(const Point &p) {
this->x = p.x;
this->y = p.y;
}
Point& operator=(const Point &p) {
this->x = p.x;
this->y = p.y;
return *this;
}
bool operator== (const Point &p) {
return (this->x == p.x && this->y == p.y);
}
bool operator> (const Point &p) {
// For simplicity, we ignore x.
//
return (this->y > p.y);
}
bool operator< (const Point &p) {
// For simplicity, we ignore x.
//
return (this->y < p.y);
}
bool operator<= (const Point &p) {
// For simplicity, we ignore x.
//
return (this->y <= p.y);
}
bool operator>= (const Point &p) {
// For simplicity, we ignore x.
//
return (this->y >= p.y);
}
private:
int x;
int y;
};
int main() {
map<point, point=""> m;
Point p1(100, 100);
Point p2(100, 100);
if(m.find(p1) == m.end()) {
m[p1] = p1;
}
// Although p1 and p2 are different objects,
// their content is the same through comparison on their
// private member variables x and y.
//
// Hence, p2 shouldn't be inserted into the map.
//
if(m.find(p2) == m.end()) {
m[p2] = p2;
assert(0);
}
return 1;
}
|
|
|
|
|
I think your definition of map m is incorrect for a start...
shouldnt it be :-
map < Point, Point > m;
?? - ie you havnt told the compiler what you're storing in map m. One thing you have done (great ) is define the < operator for your class .. from Cprogramming.com :-
"To use the map class, you will need to include and maps are part of the std namespace. Maps require two, and possibly three, types for the template:
std::map < key_type, data_type, [comparison_function] >
Notice that the comparison function is in brackets, indicating that it is optional so long as your key_type has the less-than operator, < , defined -- so you don't need to specify a comparision function for so-called primitive types such as int, char, or even for the string class. Moreover, if you overloaded the < operator for your own class, this won't be necessary.
The reason that the key type needs the less-than operator is that the keys will be stored in sorted order -- this means that if you want to retrieve every key, value pair stored in the map, you can retrieve them in the order of the keys. "
http://www.cprogramming.com/tutorial/stl/stlmap.html[^]
[Edit]
I think you also need to define the < operator with two operands thus :-
bool operator <(const Point &LHS, const Point &RHS){
return LHS.y < RHS.y;
}
[/Edit]
'g'
-- modified at 4:49 Monday 14th November, 2005
|
|
|
|
|
yccheok wrote: bool operator< (const Point &p) {
bool operator< (const Point &p) const
|
|
|
|
|
That's exactly solve my problem, thanks!
|
|
|
|
|
hi,
I am facing a problem in making arrow keys working for cpropertysheet in MFC in VC++ for help button only the tab key works there. what is the reason for arrow key being inactive. and how to resolve this problem???
Kartik
|
|
|
|
|
Is ur parent window is an activex control. If yes, then it will not work as expected. The problem is the ActiveX control doesn't own the message pump. The message pump is owned by the container application. Therefore, all the keystroke messages are taken by the container application and not dispatched to the modeless dialog box or propertysheet window.
Install a Windows WH_GETMESSAGE hook for the modeless dialog box/propertysheet derived class to allow it to intercept keystrokes and handle accelerators.
Bye
Cool Ju
|
|
|
|
|
hi ju,
my application is not an activeX control....
so how can i make the arrow key move on the help button...
thanks in advance....
|
|
|
|
|
Hi guys,
I am sick of GetPixel() . It is terribly slow.
Any alternative...
Owner Drawn
--Nothing special
|
|
|
|
|
use DIB-Sections and write your own GetPixel replacement which accesses the bitmap-bits directly.
James
http://www.catch22.net
|
|
|
|
|
Hi,
In my program, there is a worker thread. The main thread must be blocked when the worker thread is running.
But I can't use WaitForSingleObject() because the worker thread will send winodws messages to main thread. So message loop is neccessary.
Also when the worker thread is terminated the main thread should continue...
What will be the best solution?
Thank you.
- NS -
|
|
|
|
|
I feel you will have to disable all the controls which you dont want to generate any events on the user interaction, while your worker thread is processing. After the work is done send a message from the workerthread and from that handler enable all those disabled controls.
suhredayan
|
|
|
|
|
Thank you for the replay.
I can solve it by using MsgWaitForMultipleObjects() API.
- NS -
|
|
|
|
|
Why would you want to use a worker thread if you main thread just sits idle while the worker runs? To me it sounds like you could just as well use the main thread to do the worker's job.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Because I use multiple desktops in my program. I have to show a message box in another desktop. So I have to create a thread and assign the desktop by SetDesktopThread() API.
- NS -
|
|
|
|
|
Oh, I see.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Hi all
I am working on a backup tool, here most of the work has been finished, now I have been stucked in a problem which is as follows:
While taking backup of files, want to make a file with any extetension( like .stl or .bkf etc. ), now after taking backup when user open this file( like main.STL) then my application should be opend.
Also this time when application is opened then it should contain the description of all the activities that has been taken for backup of that very task.
I hope my problem would be clear to you. better if geve some code snippets.
(Infact when files with unknown extension is opened then windows dialog for "Choose any program" is prompted)
Please help me.
Thanks.
|
|
|
|
|
|
One more thing..
How can I bring my application under the list of "Open with -> choose program " list of apllications, as there are many application in that list ( e.g. MS Word, notepad, WinZip etc.).
Please reply.
Thanks
|
|
|
|
|
Did you try restarting the machine after you created the regisry entries specified in the earlier article?
If it still doesn't work after restarting maybe you should follow the instructions in the following article
http://www.winguides.com/registry/display.php/1135/[^]
|
|
|
|
|
Hi,
I have a task, where i need to traverse the items of a tree by pressing the ctrl key with up arrow and down arrow and on clicking ctrl+space bar i shall select the items.
I could select the first item in a tree with Ctrl+left mouse click.The Functionality for selecting the items with ctrl+mouse has already been implemented.
when I press Ctrl+down/up arrow i want the item to be focussed(the thin border that appears) but not selected and it should be selected only when i press ctrl+space bar.
And upon on pressing the the ctrl+down arrow more than two times and selecting another item with ctrl+spacebar , is there any function with which i can get the first selected item so that i can store their information .
Thanks
|
|
|
|