|
Hi.
For anyone that is fimilar with the GLUT library:
If I create a window using glutCreateWindow, and later close it (using the 'X' at the corner of the window), do I have to explicitly call glutDestroyWindow with the window's ID number (or is that function called automatically)?
Thank you.
|
|
|
|
|
I have just started to use named pipes for communication between programs and i was wondering if there is a method or tool available for viewing the data that is passing through them without having to actually create another program to connect between them? Something like an IP packet sniffer/capture program or a method to create one?
Thanks.
|
|
|
|
|
I'm changing the text in a control and I want to reposition the cursor at the end of the text after I display the text. What I'm doing doesn't work! The cursor is always set to the beginging of the text (due to the "SetFocus"). Any ideas?
NB: m_CheckNoCtrl is a control to the field!
m_CheckNoCtrl.SetWindowText(szTemp); // Paint new text in control
m_CheckNoCtrl.SetFocus(); // Set focus to control
int ndx = m_CheckNo.GetLength(); // Get the new length
SendMessage (EM_SETSEL, (WPARAM)ndx, (LPARAM)ndx);
|
|
|
|
|
Hi,
for me it works
CString sJaya("HELLOPSODPO");
c_numedit.SetWindowText(sJaya); // Paint new text in control
c_numedit.SetFocus(); // Set focus to control
int ndx = sJaya.GetLength ();
c_numedit.SendMessage (EM_SETSEL, (WPARAM)ndx, (LPARAM)ndx);
And i see that you are setting with one text and doing a getLength() on another wats that for .
Regards,
FarPointer
-- modified at 11:50 Wednesday 18th January, 2006
|
|
|
|
|
The GetLength()is on the variable I set up for the text.
However you solve my problem!
I changed the SendMessage (EM_SETSEL, (WPARAM)ndx, (LPARAM)ndx);
To: m_CheckNoCtrl.SendMessage (EM_SETSEL, (WPARAM)ndx, (LPARAM)ndx);
I overlooked specifing the control I was sending the message for!
It now works for me too.
Thanks!!!
|
|
|
|
|
This should be a no brainer. I am using Visual C++ 6.0. Because I want to use fseek() I declare a file of FILE* filename and then use filename = fopen(path, "r+"). I can read from the file but when I try to write (using fprintf() and fwrite()) to the file nothing changes in the file I am reading from and trying to write to. I have also tried "rt+". I receive no errors. Is there something basic I'm not aware of?
Buck
|
|
|
|
|
See if this helps!
When the "r+", "w+", or "a+" access type is specified, both reading and writing are allowed (the file is said to be open for “update”). However, when you switch between reading and writing, there must be an intervening fflush, fsetpos, fseek, or rewind operation. The current position can be specified for the fsetpos or fseek operation, if desired.
|
|
|
|
|
Hi,
According to the MSDN library at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_fopen.2c_._wfopen.asp
they say
"When the "r+", "w+", or "a+" access type is specified, both reading and writing are allowed (the file is said to be open for "update"). However, when you switch between reading and writing, there must be an intervening fflush, fsetpos, fseek, or rewind operation. The current position can be specified for the fsetpos or fseek operation, if desired."
So it looks like you will have to reset the open file pointer to the appropriate position before switching between reading and writing operations. If possible, it may be more convenient for you to read and write using separate sessions.
Hope this helps.
Paul
|
|
|
|
|
The executable has been developed in Borland C++ 6.0. I need to store the user login and password in windows registry, so that each time the user doesn't have to type in his username and password when he runs the exe.
Many Thanks,
Priya
|
|
|
|
|
See here.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
You better encrypt the password before storing it there.
Regards,
Nish
|
|
|
|
|
Or maybe use a one-way hash on it? Might be a little more secure...
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Priya..k wrote: need to store the user login and password in windows registry, so that each time the user doesn't have to type in his username and password when he runs the exe
Try CRegKey class.. and For Storing UserName and Password you can use widly available RC4 algorithm
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
How do I display text orientated 90 degrees, ie so that it reads up the screen and you turn you head 90 degrees to read it.
TIA
|
|
|
|
|
britboyjohnson wrote:
How do I display text orientated 90 degrees, ie so that it reads up the screen...
I think it may have to do with the font. Does this help? Also, check out the lfOrientation member of LOGFONT .
britboyjohnson wrote: ...you turn you head 90 degrees to read it.
Is this possible? I'm thinking that if my head were turned 90 degrees in relation to my neck, reading would be the farthest thing from my mind!
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
You need to set the lfEscapement member of a LOGFONT and select that font. I am posting an example of this in this code set here[^].
onwards and upwards...
|
|
|
|
|
Hi ,
Try this one out ,the 900 is specified because its in .1 degree ,
ie 900 * .1 = 90 degree
CPaintDC dc(this);
CFont font;<br />
VERIFY(font.CreateFont(<br />
12,
0,
900,
0,
FW_NORMAL,
FALSE,
FALSE,
0,
ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH | FF_SWISS,
_T("Arial")));
<br />
<br />
<br />
CFont* def_font = dc.SelectObject(&font);<br />
dc.ExtTextOut(50, 50, ETO_OPAQUE, NULL, _T("Hello"), NULL);<br />
dc.SelectObject(def_font);
Regards,
FarPointer
|
|
|
|
|
Thanks for each of the replies
|
|
|
|
|
Using SetWorldTransform you can have text at any angle. For example:
CPaintDC dc(this);
int OldMode = SetGraphicsMode(dc.m_hDC, GM_ADVANCED);<br />
const double Pi = 4*atan(1);
const double Angle = 45 * (Pi/180);
float CosAngle = float(cos(Angle));<br />
float SinAngle = float(sin(Angle));<br />
XFORM xForm = {CosAngle, SinAngle, -SinAngle, CosAngle, 0, 0};<br />
SetWorldTransform(dc.m_hDC, &xForm);<br />
dc.TextOut(0, 0, _T("This text is at 45 degrees."));<br />
SetGraphicsMode(dc.m_hDC, OldMode);
This technique doesn't work on 95/98/Me however.
Steve
-- modified at 0:51 Thursday 19th January, 2006
ADDED:
SetWorldTransform doesn't just work for text - It will work for any HDC drawing operations.
|
|
|
|
|
I want to find the default browser from registry through MFC prog. Plz tell me in which field of the registry i can get the information about default browser.
|
|
|
|
|
Why not just use FindExecutable() ?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Aryan S wrote: Plz tell me in which field of the registry i can get the information about default browser.
HKEY_CLASSES_ROOT\HTTP\shell\open\command
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Tox, you were right to have posted that message. Even I wondered why had you went to that level down, but I too am Feeling the same. There is somebody who is giving EVERYBODY a low rating (whenever they get 5). I do not understand this. But it hurts. It hurts a lot. You take your time to analyse the problem, and then you give the best possible solution that you can. The one who asked the question thanks you and gives a 5, so does some people... After some time, the rating comes down for no reason. I think rating must be given by the person who asks the question only. It hurts. Or just remove this rating thing. We are ready to help for no rating. Not a problem. I could understand what Tox felt, now. It hurts man. I have joined CP recently and started helping ppl very recently. Why would someone have a problem when I get a 5 rating? I know I have to use profanity and behave myself in this forum, with a bundle of real genius people...
If this is wrong too, i will delete this. Not a problem. I will keep to contribute whatever I know, no matter if it is a penny or two. If it helps someone, I am happy. Give me zero rating, I dont care until the person gets helped and tells me that.
May be this is an inappropriate forum to post this message. May be this is soapbox material. Sorry about that but.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
i am with you Rajesh...
but yes, this is pretty not the appropriate place
this could be suggested (once again) in the suggestion forum, or, the lounge...
but as it is already done, don't cross post the forums.
people will see your shout
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
Rajesh R. Subramanian wrote: to have posted that message
What message ? (No, this is no John Simmons thread ).
~RaGE();
|
|
|
|
|