Results 1 to 4 of 4

Thread: [RESOLVED] Registry Code Error - Type Mismach

  1. #1

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Resolved [RESOLVED] Registry Code Error - Type Mismach

    I get a "Type Mismatch" for this line of code:

    VB Code:
    1. If RegReadSZ(HKEY_LOCAL_MACHINE, strSubKey, "Reg_FirstTime", strRet) <> "No" Then
    My usual boring signature: Something

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Registry Code Error - Type Mismach

    What function does RegReadSZ do?

    I've had that error in the past when a reg key doesn't exist so I've used this. (using your example)

    VB Code:
    1. Dim sKey as String
    2.  
    3. sKey = RegReadSZ(HKEY_LOCAL_MACHINE, strSubKey, "Reg_FirstTime", strRet)
    4.  
    5. If sKey <> "" Then
    6.  
    7.     If sKey <> "No" Then
    8.     'do your stuff
    9.     End If
    10.  
    11. End If

  3. #3

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Registry Code Error - Type Mismach

    thanks
    My usual boring signature: Something

  4. #4
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    Re: [RESOLVED] Registry Code Error - Type Mismach

    Quote Originally Posted by dclamp
    I get a "Type Mismatch" for this line of code:

    VB Code:
    1. If RegReadSZ(HKEY_LOCAL_MACHINE, strSubKey, "Reg_FirstTime", strRet) <> "No" Then
    That looks awfully like some code I've created at some time. If it is, then RegReadSZ returns a Long error code. The string Value "No" (or whatever) is returned in strRet. (It's just my way of returning a code as well as a Value)

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