|
GetSystemDirectory()
u can use.
SetDlgItemText for set text in Edit Control.
u can use GetWindowsDirectory() also but in xp and next it gives folder
with user name so better to use GetSystemDirectory() and extract from it.
Enjoy.![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
Use SetWindowText() (documentation here) to set the text in the edit control.
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
char lpBuffer[MAX_PATH];
UINT len = GetWindowsDirectory(lpBuffer,MAX_PATH);
SetWindowText(hWndEdit,lpBuffer);
cheers
Varghese Paul
|
|
|
|
|
|
Hello,
I had set timeout with
int n = 20000;
setsockopt(ClientSocket,SOL_SOCKET,SO_RCVTIMEO,(char*)&n,sizeof(int);
and
set mode nonblocking with function call
int iMode = 1;
ioctlsocket(ClientSocket,FIONBIO,(u_long FAR*)&iMode)
if i set mode to nonblocking than timeout is not called in recv().
but if i do it with mode blocking (default) than every thing is
working fine and timeout called.but i have to work with non blocking
mode so anybody can tell me how can i set timeout in nonblocking socket.
or why i dont get timeout ,i missed something plz reply.
Thanx in advance. 
|
|
|
|
|
Hi all,
I m using List control as Report view, there are number of columns.
i want one purticular coloumn text always show with color.
i have some fixed text for this coloumn.
text1,text2,text3,text4 are 4 diffrent fix text for coloumn.
i want text1 show in red color,text2 in green,text3 in blue,and text4 in brown.
can this possible please tellme.
if possible please explain with example.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: can this possible please tellme.
yes
"_$h@nky_" wrote: if possible please explain with example.
search for XListCtrl on codeproject and you will get an idea of how you can do it
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
|
I have the same problem.. @_$h@nky_ .. if u have done it,plz share the solution with me.. reply asap.
|
|
|
|
|
ya its done with help of SandipG answerd link in this thread.
you can also chk and try this.
|
|
|
|
|
but the solution which you are referring to is for colouring the whole cell.. I wanted to color some substring of the text in the cell.. how could i do that from that solution.?
|
|
|
|
|
means if cell of 1 row and 1 column have string "Hello World"
you want to color whole string "Hello World" or only "Hello" or "World"
if u want color whole string "Hello World" it is possible.
but if you want color only "Hello" or "World" its not possible.
|
|
|
|
|
i want to color only Hello or world not the whole string. I think that can be feasible to do but i'm not sure how to do it.. I was thinking of using device contest to repaint the required string but i'm unable to attach the device context to the substring. If u can think of such way ..plz share your thoughts.
|
|
|
|
|
Hi all,
In EditBox Control i want to apply limit of charcters to be entered.
for example if limit is 50 characters.than:
I want if editbox have 50 charecters than after this it not enter any value.
Please tell me how can do this.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
Thanks
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hello everyone,
For the pattern, using reference variable as internal data member variables, I have some cercerns and want to listen to your advice whether it is real issues. I showed simple code to illustrate my idea.
My concerns are,
1. if the _buf is binded to a local variable (e.g. a local string variable), then if instance of Foo lives longer than the local variable, is it safe?
2. if the _buf is binded to a heap variable, and it is released some time but Foo does not the release operation, then using _buf is not safe?
class Foo
{
private:
string& _buf;
public:
Foo (string& input): _buf (input)
{
}
};
int main()
{
return 0;
}
thanks in advance,
George
|
|
|
|
|
George_George wrote: 1. if the _buf is binded to a local variable (e.g. a local string variable), then if instance of Foo lives longer than the local variable, is it safe?
No, you'll get an access violation when trying to use the destroyed object.
George_George wrote: 2. if the _buf is binded to a heap variable, and it is released some time but Foo does not the release operation, then using _buf is not safe?
"release"??!?
Don't you mean "deleted"?
If by "released" you mean that the object is destroyed, you'll have exactly the same problem as in #1; you'll get an access violation when you're trying to use the destroyed object. It doesn't matter whether the object is on the heap or the stack.
I suggest you use a reference counting smart pointer instead.
Just do a search here at CP, there are quite a few good examples.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanks Roger,
I like your advice -- "I suggest you use a reference counting smart pointer instead.". Currently, I have another idea to fix the issue, which is do an instance copy when constructing the data member, not using a reference. Do you think it is a good idea?
regards,
George
|
|
|
|
|
George_George wrote: do an instance copy when constructing the data member, not using a reference. Do you think it is a good idea?
Well, it depends.
Consider what happens if the original value is updated....the copy will become obsolete.
A common problem is to have two instances of the same data; if they get out of sync you don't know which is the correct one. But this may not be a concern, it depends on what you're trying to do.
I would stick to the smart pointer solution.
That way I don't have to worry about the object being destroyed in the background and is safe to use until every object has released their references to it. Sometimes it's hard to know which object is the last to be destroyed and then clean up the memory, but by using a reference counting smart pointer the problem will be solved automagically.
With a smart pointer I would also have the data in one place and in case the data is updated, every "user" of it can read the new value from the same place.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
You made so great comments, Roger!
regards,
George
|
|
|
|
|
George_George wrote: 1. if the _buf is binded to a local variable (e.g. a local string variable), then if instance of Foo lives longer than the local variable, is it safe?
2. if the _buf is binded to a heap variable, and it is released some time but Foo does not the release operation, then using _buf is not safe?
I don't see your concerns are related to reference in anyways.
Both can cause problem even if you do not use reference.
Regards,
Sandip.
|
|
|
|
|
SandipG  wrote: George_George wrote:
1. if the _buf is binded to a local variable (e.g. a local string variable), then if instance of Foo lives longer than the local variable, is it safe?
2. if the _buf is binded to a heap variable, and it is released some time but Foo does not the release operation, then using _buf is not safe?
I don't see your concerns are related to reference in anyways.
Both can cause problem even if you do not use reference.
How about making a local copy of the original object?
The concerns are related to accessing the same instance using the address of the instance whereas the use of pointers is one way and references is another.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanks Roger,
So, you agree with the two issues I pointed out?
regards,
George
|
|
|
|