Results 1 to 2 of 2

Thread: type mismatch

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    15
    Public Declare Function WriteFile Lib "kernel32" _
    (ByVal hFile As Long, ByVal lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, _
    lpNumberOfBytesWritten As Long, Optional ByVal lpOverlapped As Long = 0&) As Long

    Dim lBytesWritten As Long
    Dim hStdIn As Long
    Dim hStdOut As Long
    Dim iPos As Integer

    Dim startStr, endStr, httpStr, hyStr As String

    startStr = "HTTP/1.0 200 OK" & vbCrLf & "Content-Type: _ text/html" & vbCrLf & vbCrLf & "hello"

    hStdOut = stdout()
    WriteFile hStdOut, startStr, Len(startStr + Ch(3)), _ lBytesWritten

    this is a vb application that try to change to cgi. the file is in a module. after make bla.exe file, the error says
    "type mismatched" and highlighted the startStr in WriteFile
    DOES ANYBODY HAS ANY IDEA ABOUT HOW TO FIX THIS PROBLEM? I THOUGHT IT SUPPOSE TO BE STRING.

    the example in microsoft website about writing cgi applications in visual basic is doing the same thing, I have all the things declared just like that(all public.. all functions) and it is working well, so what is wrong with mine?
    http://support.microsoft.com/support.../Q239/5/88.ASP
    THANK YOU VERY MUCH.

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    This may or may not help , but you have not actually declared startStr as String. You have declared it as Variant
    Mark
    -------------------

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