|
yes because I did not get satishfied answer
|
|
|
|
|
So we're getting again and again your question?
Please, go building, as suggested, your own database instead.
(just kidding, man...)
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]
|
|
|
|
|
Please give any suggestion, how to do it?
|
|
|
|
|
Since commercial applications and libraries uses large databases for the purpose, I suppose your effort would be a waste of energy.
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]
|
|
|
|
|
Ok, please have a look on below link and guide me
<a href="http://mypath2us.com/post/2009/10/18/Get-Client-Geo-Location-in-C.aspx">http:
Is this correct way to do?
And free to use?
Any drwback to use it in my application?
|
|
|
|
|
The link you have posted has the solution, try using it.
It's time for a new signature.
|
|
|
|
|
john5632 wrote: Is this correct way to do?
That might be correct, but not very accurate (IMO).
john5632 wrote: And free to use?
It's free as long as you use, as suggested, a free webservice.
john5632 wrote: Any drwback to use it in my application?
Other than accuracy, you've to read carefully the terms of use for the webservice, 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]
|
|
|
|
|
... and you'll probably never get it, because IP addresses are not allocated that way.
Associating an address with a place is something that can be done only at a very high level. As you go down towards the single addresses the number of exception to the general rules are much and much more.
Every multinational company that own hos own autonomous system can get addresses on one regional registry, and displace them around his world. And there is no "central authority" collection all this informations.
What commercial software do is typically recourse into the provider's whois databases until they can. The answer this way can be 90% accurate.
But the problem is that the reamin 10% is not "almost accurate" is simply completely false.
If you wan more infos try google some of the buzzwords of this post.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
|
Download - C Library Module and link it to your app.
IP2Location C Library
http://www.ip2location.com/c.aspx
Developers can use the API to query all IP2Location™ binary databases for applications written in C
to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type,
area code and weather that any IP address or hostname originates from.
Sample Source Codes
#include <IP2Location.h>
int main()
{
IP2Location *IP2LocationObj = IP2Location_open("../data/IP-COUNTRY-SAMPLE.BIN");
IP2LocationRecord *record = IP2Location_get_all(IP2LocationObj, "161.11.12.13");
printf("%s %s %s %s %s %f %f %s %s %s %s\n,
record->country_short,
record->country_long,
record->region,
record->city,
record->isp,
record->latitude,
record->longitude,
record->domain,
record->zipcode,
record->timezone,
record->netspeed,
record->iddcode,
record->areacode,
record->weatherstationcode,
record->weatherstationname);
IP2Location_free_record(record);
IP2Location_close(IP2LocationObj);
return 0;
}
|
|
|
|
|
Case 1
I have created a sample MFC Static library which has the required function definitions in mfcextent.cpp and declarations in mfcextent.h. I have added a MFC test dialog based application for the MFC static library in the same workspace. I included the header file mfcextent.h in the test application project and made call to the 2 functions in the library StringToFloat() and IsNumeric(). When I build the MFC Static library, its build without any errors whereas when I build the test application its giving me link errors as defined below.
Linking...
ExMFCStaticLibTestDlg.obj : error LNK2001: unresolved external symbol "double __cdecl MFCExtensions::StringToFloat(class CString)" (?StringToFloat@MFCExtensions@@YANVCString@@@Z)
ExMFCStaticLibTestDlg.obj : error LNK2001: unresolved external symbol "int __cdecl MFCExtensions::IsNumeric(class CString)" (?IsNumeric@MFCExtensions@@YAHVCString@@@Z)
Debug/ExMFCStaticLibTest.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
Case 2
When I created the same test application separately and added the static lib output file to the test application and included the header file mfcextent.h, its building without any errors and working fine.
Can anyone explain why case 1 is giving link errors. Am I missing out anything..?
Thanks
Mohan
|
|
|
|
|
manoharbalu wrote: added the static lib output file to the test application
So you have the answer. You must include the lib file in your project's linker options - Properties -> Linker -> Input.
It's time for a new signature.
|
|
|
|
|
Appreciate your help. Can you please explain it step by step how can i Link the lib file.
|
|
|
|
|
I thought just did. Select your project's properties and go to the Input item under Linker. Add the name of your lib file, and its location, then build your project and the link process should work.
This is assuming you are using one of the Visual Studio IDEs to build your project. If you need to do it manually then check the LINK options in MSDN.
It's time for a new signature.
|
|
|
|
|
I got it. Its working well. Thank you very much Richard.
|
|
|
|
|
You're welcome; good luck in your endeavours.
It's time for a new signature.
|
|
|
|
|
I created a function that receives several arguments.
The function processes text and stores it in a variable.
char* Value = NULL;
function (arg, arg, arg, Value);
function declaration
function (arg, arg, arg, char *Value)
I did a read out from within the function, and the result is successfully stored in my desired Value.
However when the function returns to continue.
A CRT_DEBUGGER_HOOK exception is thrown!
|
|
|
|
|
It would help if you posted the code within the function.
|
|
|
|
|
If my mind serves me right, then this should go smoothly!
functionA(const char* Text, char *Value);
char *Value;
functionA (Paragraph, Value)
If functionA creates a char array and adds it to Value argument, when the procedure finishes whatever condition Value was will remain the same. Or is that incorrect?!
|
|
|
|
|
Fareed Rizkalla wrote: Value was will remain the same.
Correct. However whatever Value points to may have been changed by functionA() .
It's time for a new signature.
|
|
|
|
|
You're correct.
This is because the pointer variable is passed by value.
If you want it to change you must either do this -
functionA(const char* Text, char** Value)
char* Value;
functionA(Paragraph, &Value); Or do this -
functionA(const char* Text, char*& Value)
char* Value;
functionA(Paragraph, Value);
|
|
|
|
|
Add & and it fixed it!
I tried adding & to the value being passed in the function, but the IDE started underlining red for errors.
|
|
|
|
|
Please post the code that is showing errors.
|
|
|
|
|
How can I get the standard behavior of hiding menu bar when pushing Alt key and showing the menu bar when I click on the App. e.g Internet explorer. I know how to capture the Alt key and doing manually, I just think this might be part of windows behavior though?
Any ideas?
|
|
|
|
|
Software2007 wrote: How can I get the standard behavior of hiding menu bar when pushing Alt key...
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|