Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.visual.basic    |    MS Visual Basic discussions, NOT dot-net    |    10,840 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 10,083 of 10,840    |
|    J French to All    |
|    Re: C DLL calls using VB    |
|    02 Jun 06 05:58:26    |
   
   XPost: comp.lang.basic.visual   
   From: erewhon@nowhere.uk   
      
   On Thu, 1 Jun 2006 22:40:36 -0700, "Otie"    
   wrote:   
      
      
      
   >In VB I do this:   
      
   >Declare Function SetCountryByNameA Lib "FindCity.dll" Alias   
   >"_SetCountryByNameA@51" (countryname As String) As Long   
      
   What is the @51 doing there   
      
   DLL calls can be by Name or by Number   
   - you are using both   
      
   It would be a good idea to check that the DLL uses the StdCall   
   convention.   
      
   Also: ( ByVal countryname As String) As Long   
      
   It is unlikely that a C DLL would want it ByRef   
      
   >Dim test1 As Long   
   >test1 = SetCountryByNameA("Germany")   
      
      
   >The C docs give me a FindCity.def file that contains:   
      
   >LIBRARY FindCity   
      
   >VERSION 1.20   
      
   >DESCRIPTION "Functions for using ACS Atlas data files."   
      
   >EXPORTS   
   > ACStimechangelookupA @1   
   > FindCityA @11   
   > SetCountryByNameA @51   
      
      
   >The docs say "You must tell your development program to link with   
   >findcity.lib."   
      
   >Do I care about this?   
      
   Probably the same code as that in the DLL is also in the .LIB file   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca