|
Michael Schubert: CodeProject's official career counselor.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
He he. I think not. John Simmons is much better at that. 
|
|
|
|
|
Michael Schubert wrote: You should consider a career change.
Any suggestions??
Regards,
Sandip.
|
|
|
|
|
This could get ugly. Maybe switching to Visual Basic?
|
|
|
|
|
Michael Schubert wrote: Maybe switching to Visual Basic?
Oh my God... You are the worst job counselor I have ever seen
|
|
|
|
|
I know. 
|
|
|
|
|
Yes, of course [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
That is interesting .. May be it will suit him..
BTW: Looks like this is another crime of THHB.
Regards,
Sandip.
|
|
|
|
|
SandipG  wrote: BTW: Looks like this is another crime of THHB.
Another one here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Call iteratively strchr [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
monsieur_jj wrote: I need to validate email addresses.
You need to validate the email address to have one and only one '@' character? OK, this code will do that:
const char *szEmail= "myname@mydoma@in.com";
strchr(szEmail,'@')?strchr(strchr(szEmail,'@')+1,'@')?cout<<"Invalid!":cout<<"Valid!":cout<<"Invalid!!"; Program Output: Invalid!
Error checking and any dodgy stuff must be handled by *you* of course.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
You could try:
string strEmail = "email@email@email.com";
count(strEmail.begin(), strEmail.end(), '@');
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
can anybody suggest how to get name of network adapter card if ip address is given in linux?I have to do it programmatically.
|
|
|
|
|
an89 wrote: can anybody suggest how to get name of network adapter card...
Try GetAdaptersInfo() . I doubt it'll work on Linux, however.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I think in linux
ioctl(socketid, SIOCGIFCONF, &ifc);
can be used.
I think you can also use function pcap_findalldevs in libpcap library(opensource).
alternatively you can also see the linux specific implementation of pcap_findalldevs in libpcap.
|
|
|
|
|
Thanks.... 
|
|
|
|
|
it won't work as its win32 api.
|
|
|
|
|
an89 wrote: ...as its win32 api.
That's what I would expect from a VC++ forum.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
You application will be displayed in the appliction tab of task manager only if you that application have created a window.
The project such as "win32 projects" in msdev wont create any window by defualt and so it will not be listed in application tab.
|
|
|
|
|
Ok thanks and what about of Processes tab.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
You cannot hide your application from the process tab with any windows APIs. Why would some one hide its application from the process tab other than for malicious purpose. And is that your purpose also?
How ever it is possible if we modify some kernal mode strcutures. But for that you need to write some kernal drivers. I dont know more details about that..
|
|
|
|
|
For what purpose?
If the purpose is remotely similar to "I don't want the user to know that my application is running" you can stop asking questions immediately, because that's really anti-social behaviour and no one here will encourage that.
Otherwise you may consider a service.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
Hello everyone,
Here is my test code. My question is even if I provide a wrong username/password to access passport protected site, like login.live.com, the return code will always be successful.
Anyone have any ideas what is wrong?
#include <string>
#include <iostream>
#include <exception>
#include <windows.h>
#include <wininet.h>
#include <fstream>
#include <conio.h>
using namespace std;
#pragma comment(lib,"wininet.lib")
int main(int argc, char* argv[])
{
HINTERNET hOpenHandle, hConnectHandle, hResourceHandle;
DWORD dwError, dwStatus;
DWORD dwStatusSize = sizeof(dwStatus);
hOpenHandle = InternetOpen("TestAgent",
INTERNET_OPEN_TYPE_PRECONFIG,
NULL, NULL, 0);
hConnectHandle = InternetConnect(hOpenHandle,
"login.live.com",
80,
"GeorgePassport",
"WrongPassword",
INTERNET_SERVICE_HTTP,
0,0);
hResourceHandle = HttpOpenRequest(hConnectHandle, "GET",
"/",
NULL, NULL, NULL,
INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_CACHE_WRITE,
0);
BOOL fResult = HttpSendRequest(hResourceHandle, NULL, 0, NULL, 0);
if ( fResult == false )
{
cout<<"HttpSendRequest failed!"<<endl;
cout<<"GetLastError(): "<<::GetLastError()<<endl;
}
HttpQueryInfo(hResourceHandle, HTTP_QUERY_FLAG_NUMBER |
HTTP_QUERY_STATUS_CODE, &dwStatus, &dwStatusSize, NULL);
switch (dwStatus)
{
case HTTP_STATUS_PROXY_AUTH_REQ:
case HTTP_STATUS_DENIED:
cout<< "auth failed!"<<endl;
break;
case HTTP_STATUS_OK:
cout<< "auth pass!"<<endl;
break;
default:
cout<< "what happens here?"<<endl;
break;
}
return 0;
}
thanks in advance,
George
|
|
|
|