Quantcast
Channel: SCN : Discussion List - PowerBuilder Developer Center
Viewing all articles
Browse latest Browse all 2881

accessing a .dll / ole function

$
0
0

I'm unable to process a function call on an ole control on a PB visual user object (or window) from a non-visual control.  I'm using PB 12.5. 

 

By way of background, I contracted out the development of a .dll to reverse-geocode latitudes and longitudes to return the location address.

 

The contractor created the .dll - I gather in VB - which he set up for demonstration on a PB Window on my computer using TeamViewer.

The .dll registered ok and it worked fine.  His hard-code from a button on the demo window was:

 

     String l

 

     l = ole_1.Object.of_return_location_name('22.725313','75.865555')

 

This correctly returned an address in India.

 

I coded in a similar way in a function in a PB visual object in my application with a call to the function from a non-visual object (I used a visual object because I'm unaware of how I could utilise  the ole/.dll from a non-visual object ).  I placed the ole control on the visual object and name it ole_gps.

 

My code in the PB visual object function was:

 

If IsValid(ole_gps) Then

 

     as_location = ole_gps.Object.of_return_location_name(as_latitude, as_longitude)

Else

     // error processing

End if

 

The function call code from my non-visual user object is:

 

uv_lat_long  luv_lat_long  // declare variable

 

luv_lat_long  = CREATE uv_lat_long // create

 

//

//

If IsValid(luv_lat_long) Then

    

     ls_location = luv_lat_long.of_reverse_geocode(ls_latitude, ls_longitude)

 

Else

      // error

End if

 

The visual object function is accessed in luv_lat_long ok but I get a null object error on the function call to the ole:

 

       as_location = ole_gps.Object.of_return_location_name(as_latitude, as longitude)

 

It seems I need some code to instantiate / initialise the ole object.  Any advice appreciated - ideally if there's anyway to call the .dll direct from my non-visual object code.


Viewing all articles
Browse latest Browse all 2881

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>