|
Hi all,
If i check the IP address of any machine then it shows the following notation of IP in case of IPv4
"127.0.0.1"
And in case of Ipv6
"fe80::198:8ad2:22fe:2bff8%4"
Is there any API or C function or any logic to convert IPv6 address to IPv4 Address for window and linux.
Thanks
|
|
|
|
|
singh_nav wrote:
Is there any API or C function or any logic to convert IPv6 address to IPv4 Address for window and linux.
Only to a limited degree. See here for more. The operative sentence is, "Obviously, that's impossible, since IPv6 has a larger address space... Your technique will only work on IPv4-mapped IPv6 addresses".
"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
|
|
|
|
|
Hi All,
I have an application which collect data remotly but when connection is made to the machine then it fails either because of Credential error (given username/password is wrong) or Access denied error (user doesn't have enough rights). I want differentiate between these two scenarios. How i can verify whether entered username and password are right. The account gets locked (password is wrong) when attempts match a/c locked out count.
I have used LogonUser and ImpersonateLoggedOnUser API's.(Any WINSDK API to verify Credentials.)
Thanks
Sandy
|
|
|
|
|
Surely LogonUser will fail if the credentials are invalid (bad username or password), but if the user can be logged on, but doesn't have rights to access the object you want to access, it will fail when you try to access the object.
Don't forget that you can only use LogonUser to log on to the local machine.
|
|
|
|
|
GetLastError Solved the problem...
|
|
|
|
|
I want to create SSL connection to WEB server in client using SSPI .There is a session which is bind with the connection. I want to know the My client can share this session( this connection)?
My client is built by ChtmlView.
That is ,after I create a SSL connection to web server, Chtmlview can put the HTTP request to SSL connection , and get the HTTP response from the SSL connection(session). chtmlview communicate with web server in this connection made by SSPI.
Lampa
|
|
|
|
|
Hi all,
if i m using atoi function in Multi Byte than its working fine.
but if i m use it in Unicode than its not working correctly.
here,
CString str=_T("2006");
char * szMyString = (char *) (LPCTSTR) str;
int test=atoi(szMyString);
here the value in integar is 2
please tell me where i m wrong.
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
|
|
|
|
|
You might want to read the documentation in MSDN for atoi. It has a table toward the middle that indicates you would use _wtoi when _UNICODE is defined.
|
|
|
|
|
Its also not working same problem exists.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Use _ttoi() function. This will work on both unicode and non unicode environment because it is defined as
#ifdef _UNICODE
#define _ttoi _wtoi
#elseif
#define _ttoi atoi
#endif
"_$h@nky_" wrote: char * szMyString = (char *) (LPCTSTR) str;
This code is wrong when you work in UNICODE environment because in that case, CString internally keeps wchar_t* and not char*. Better if you modify as follows.
CString str=_T("2006");
int test= _ttoi(str);
|
|
|
|
|
Thanks its done.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
CString str( _T( "10000" ));
int n = _ttoi( str );
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
As you seem strugling with Unicode and non-unicode, I suggest you read thie excellent article[^]. Things will be much more clear afterwards and it is a must read for everybody that starts working with unicode.
|
|
|
|
|
"_$h@nky_" wrote: atoi() not working properly
Unfair: atoi does its job carefully.
"_$h@nky_" wrote: please tell me where i m wrong.
Much more realistic.
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]
|
|
|
|
|
CPallini wrote: "_$h@nky_" wrote:
please tell me where i m wrong.
Much more realistic.
One should perhaps ask the question whether the name of the function could be an abbreviation for AnsiToInteger or UnicodeToInteger; or possibly wAideToInteger...
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: One should perhaps ask the question whether the name of the function could be an abbreviation for AnsiToInteger or UnicodeToInteger; or possibly wAideToInteger...
A verage T ime O n I ce, I suppose [^]
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]
|
|
|
|
|
CPallini wrote: "_$h@nky_" wrote:
atoi() not working properly
Unfair: atoi does its job carefully.
I don't see any "unfearness": if you don' decontextualize, "in the context it was placed atoi doesn't work properly". That's the reason why it should not be used in that context... and hence who used it was wrong.
The fact is that atoi does not understand unicode.
They're simple two different ways to tell the same thing.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
"I'm trying to boil some water, and this screwdriver is useless. Bloody screwdriver"
"That's unfair - screwdrivers are not meant for that - try a kettle instead".
"I don't see any unfairness in that. In the context it was placed screwdriver doesn't work properly."
I now return you to normal service.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
You're right in your context, but I don't see any "bloody atoi" in the original post... And if you remove it, even you post becomes fair:
"I'm trying to boil some water, and this screwdriver (the only thing I know) is useless. Is there any other tool?".
It's not fair or unfair. It is just a fact.
The author itself asks "where am I wrong" so...
anyway, it seems to me that the distance between a screwdriver and a kettle is far more than the one between atoi and _wtoi ...
But may be i misunderstood the meaning of "unfair...".
You attribute it to screwdriver/atoi, I understood it was given to the author ("you'had been unfair")
|
|
|
|
|
"_$h@nky_" wrote: please tell me where i m wrong.
By using char and atoi() instead of wchar_t and _wtoi() .
"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
|
|
|
|
|
Hello,
When i want compile bigger project like some win32 IRCD i must use additionally to mingw, sh.exe and make.exe to configure and compile.
But... everything works well except sh.exe and make.exe. When i run them there is no errors, no help, nothing. Before make.exe told that he lack some .dll, i found it and no more error but it gives nothing after run it.
Help
|
|
|
|
|
I haven't done any graphic programming before and I would appreciate it if you guys can point me in the right direction.
I'm gonna have 6 tiled images layed out 3x2. Each image will be 256x256 (tiled images will be 768x512), but my display screen is only 320x240.
What would be the best way to allow for a smooth panning of the entire layout of the 6 images?
|
|
|
|
|
Check this![^]
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Hi,
if a condition is met, my code inserts image into a column of database table. I used below code, passing the value of picture in code, this is giving me
"Must declare the scalar variable "@picbyte", i declared its value(code below).any idea why iam getting this error...
string filepath = "C:\\Users\\Prakash\\Pictures\\pic.jpg";
FileStream imgfile = new FileStream(filepath, FileMode.Open,FileAccess.Read, FileShare.Read);
byte[] picbyte = new byte[Convert.ToInt32(imgfile.Length)];
imgfile.Read(picbyte, 0, System.Convert.ToInt32(imgfile.Length));
SqlCommand cmd3 = new SqlCommand("Insert into " +Label7.Text+"(Picture)"+ " values(@picbyte)",con);
cmd3.Parameters.Add("@Picture",System.Data.SqlDbType.Image);
cmd3.Parameters["@Picture"].Value=picbyte;
cmd3.ExecuteNonQuery();
thanks in advance
modified on Tuesday, January 13, 2009 4:49 PM
|
|
|
|
|
First do you know I cant see errors on your monitor and second it seems you use of Managed C++/CLI so you need to ask on the Managed C++/CLI[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|