Link to home
Start Free TrialLog in
Avatar of Rob4077
Rob4077Flag for Australia

asked on

Can I call a C Function from MS Access or do I need to re-write it?

With the help of some Experts on other questions I have been led to the following links that generate a URL that will launch maps.me app on Android and iOS devices to a desired GPS Lat, Long, Name and Zoom level. (e.g. -32.1458637,115.8353645, "My Place", 14) . I have a need to generate this URL from MS Access.

Two questions:
1) Is there is any way I could use or set up the existing C function or API to enable me to make a call from MS Access and have it return the URL instead of trying to translate the function into VBA?
2) It would also be useful if I could set it up so I could make a JSON call to it from another app so is there a way I can do that.

    https://www.programcreek.com/java-api-examples/index.php?source_dir=cgeo-master/mapswithme-api/src/com/mapswithme/maps/api/MwmRequest.java           
or
https://github.com/mapsme/omim/blob/master/api/src/c/api-client.c
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rob4077

ASKER

Thanks mbizup, you've answered Q1 - exactly what I needed and it was the answer I thought I would get.
The fact that no one has attempted to answer question 2 makes me realise it's not  a good question, which is a clear answer in itself.

Thanks

Rob
on #2, I would kick in that you certainly can do that, but making a JSON parser in you C++ DLL would be a significant undertaking.

But since your in control of the code, you can set it up so the call can be anything you want.  In terms of passing things easily, XML may be a better choice.

As far as question #1, I would do it in Access.   It would be far easier and cleaner to port the code to VBA and do it all in Access than it would to use sample code for a C++ DLL, write the interface, etc and maintain all that.

and looking at the code, I'm sure there is VBA or VB code floating around to encode a geopoint.

Jim.
Avatar of Rob4077

ASKER

Thanks Jim.

I actually tried to code it in VBA but struggled with the Bitshifting. Then I thought it may be better not reinventing the wheel. You've given me food for thought to try again.

As for the JSON part, i am intrigued by your comments about it and XML. I guess I need to do more research, except I don't even know where to start. I need the GeoCode to be available to both MS Access and another App as well. I will have to see if it can handle XML.