Results 1 to 2 of 2

Thread: File not found: kernel

  1. #1

    Thread Starter
    Lively Member yahui's Avatar
    Join Date
    Jan 2001
    Posts
    102
    Hi,

    I've tried to load the whole of my original VB 3 program in VB 6. However, whenever I tried to run it, an error will occur "Run Time Error 53: File not found: kernel". (I did not change the program's original directory.)

    The following is the code is I've used:
    *******************************************************
    Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer

    Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, lpKeyName As Any, lpString As Any, ByVal lplFileName As String) As Integer

    fname = "treasury.ini"
    sectionName = "Treasury"
    entryname = "TreasuryDB"
    defaultDB = "c:\treasury\treasury.mdb"
    keyvalue = String$(57, 0)

    rc = GetPrivateProfileString(sectionName, entryname, defaultDB, keyvalue, Len(keyvalue), fname)

    *******************************************************

    Can anyone help me to resolve this problem?

    Thank you very much.


    Regards.



  2. #2
    Hyperactive Member PJB's Avatar
    Join Date
    Aug 2000
    Location
    dunno at the moment
    Posts
    302
    i really don't know but should it be Kernel32

    Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long

    Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long

    and adjust the rest of your code accordingly, this is just a guess by the way

    [Edited by PJB on 01-04-2001 at 09:25 PM]
    VB6.0 SP4
    Windows 2000
    I'm thinking of a number between

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width