|
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();
|
|
|
|
|
Rajesh R. Subramanian wrote: 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.
Thats what We (i.e. I) call Right attitude... But thing that worry why the hell you people worry about the Voting system... we know you are helping other people.. My personnel advice is that leave that 1 vote or five vote matter. i believe you remember this famouse SLOKE (Idiom) from Bhagwat Geeta
KARAM KIYE JAA PHAAL KI ICHE MAT KAR!
And for your knowledge Most Voted Out message IN CP is MOST VOTED OUT[^]
"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
|
|
|
|
|
ThatsAlok wrote: KARAM KIYE JAA PHAAL KI ICHE MAT KAR!
Yes! Thank all of you.
Regars,
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 agree I think that since you can anoyn rate articles and posts people just get upset or childish with other people and vote down for no reason. I suggested two years ago that article ratings at least should require that the user enter a comment as to why they rated the way they did so now there's more accountability when making a rating. Perhaps there should be one where you have to reply in order to rate a post even or be the one who asked it.
You could also have 2 ratings, the anon rating and the known rating where the anon rating is taken with a grain of salt.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
hi.......
how to write multithreading + winsock using structure in vc++.......
i have tried to some extend but i want some good idea..... anybode plz help...
if possible plz send a proper code too..
thaks in advance
yamuna
-- modified at 8:16 Wednesday 18th January, 2006
|
|
|
|
|
R u using raw-socket ??
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
|
hello...
i'm not using raw socket..
i'm new to this area..
hope u can understand what i need.....
plz try to help me with a code..
thanks
yamuna
-- modified at 9:03 Wednesday 18th January, 2006
|
|
|
|
|
yamunasenthilvel wrote: i have tried to some extend...
What have you tried, and what results did you achieve?
"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
|
|
|
|
|
// multithread.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include <afxtempl.h>
#include <winsock2.h>
#include <stdio.h>
#include <conio.h>
#include <string.h>
DWORD WINAPI sthread(LPVOID param);
DWORD WINAPI cthread(LPVOID iparam);
int startserver();
int stopserver();
HANDLE hthread;
HANDLE hstopevent;
CArray<handle,handle> threadarray;
DWORD WINAPI cthread(LPVOID iparam)
{
printf(" client thread");
return 0;
}
DWORD WINAPI sthread( LPVOID param)
{
SOCKET sserver,sclient;
SOCKADDR_IN sadd;
HANDLE hcthread;
DWORD sthreadid;
int lenaddr;
sserver = (SOCKET &)param;
if ( listen(sserver, 5 ) == SOCKET_ERROR )
{
printf( "Error listening on socket.\n");
return 0;
}
// Accept connections.
printf( "Waiting for a client to connect...\n" );
while (1)
{
lenaddr = sizeof(sadd);
sclient = accept(sserver,(struct sockaddr*)&sadd, &lenaddr);
if( sclient == INVALID_SOCKET)
{
printf("Accept Failed");
break;
}
printf("Client Connected");
printf("Accepted client: %s: %d\n",inet_ntoa(sadd.sin_addr), ntohs(sadd.sin_port));
hcthread = CreateThread(NULL,0,&cthread,(LPVOID)sclient,0,&sthreadid);
if(hcthread == NULL)
{
printf("Error in thread creation");
}
else
threadarray.Add(hcthread);
}
return 0;
}
int startserver()
{
SOCKET sock;
SOCKADDR_IN saddress;
WSADATA wsadata;
DWORD threadid;
DWORD result;
int iAddrSize;
iAddrSize = sizeof(saddress);
result = WSAStartup(MAKEWORD(2,2),&wsadata);
if(result != 0)
{
printf("Startup failed");
}
sock = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(sock == INVALID_SOCKET)
{
printf("invalid socket");
}
saddress.sin_family = AF_INET;
saddress.sin_addr.s_addr = inet_addr("10.95.10.217");
saddress.sin_port = htons(1023);
if(bind(sock,(PSOCKADDR)&saddress,sizeof(saddress))== SOCKET_ERROR)
{
printf("Error in binding");
}
hthread = CreateThread(NULL,0,&sthread,(LPVOID)sock,0,&threadid);
if(hthread == NULL)
{
printf("Error in thread creation");
return 1;
}
return 0;
}
int stopserver()
{
for(int ccount = 0;ccount <= threadarray.GetUpperBound();ccount++)
{
printf("client closing %d",ccount);
CloseHandle(threadarray.GetAt(ccount));
}
CloseHandle(hthread);
return 0;
}
void main()
{
hstopevent = CreateEvent(NULL,TRUE,FALSE,"network");
startserver();
stopserver();
getch();
}
this what i have done..
|
|
|
|
|