Type Missmatch [dim b() as byte] 
Author Message
 Type Missmatch [dim b() as byte]

I get a "type missmatch" when I execute the following command:

bData() = Inet1.OpenURL(strURL, icByteArray)

in the VB code shown below.  Any help would be great...

Dim strURL As String
Dim bData() As Byte     ' Data variable
Dim intFile As Integer   ' FreeFile variable

t_from_file = "tycologo.jpg"
t_to_file = "c:\aaa\RRRRRR.jpg"

strURL = "ftp://64.226.65.34"

intFile = FreeFile()      ' Set intFile to an unused
                        ' file.
' The result of the OpenURL method goes into the Byte
' array, and the Byte array is then saved to disk.

bData() = Inet1.OpenURL(strURL, icByteArray)
Open t_to_file For Binary Access Write As #intFile
Put #intFile, , bData()
Close #intFile



Thu, 01 Jul 2004 09:10:32 GMT  
 Type Missmatch [dim b() as byte]
this worked for me...
Private Sub Form_Load()
Dim bArray() As ByteDim t_from_file As StringDim t_to_file As String
Dim intFile As Integer   ' FreeFile variable    t_from_file =
"http://www.google.com/images/res1.gif"    t_to_file = "c:\res1.gif"
intFile = FreeFile()      ' Set intFile to an unused
' file.    ' The result of the OpenURL method goes into the Byte    ' array,
and the Byte array is then saved to disk.        bArray =
Inet1.OpenURL(t_from_file, icByteArray)    Open t_to_file For Binary Access
Write As #intFile    Put #intFile, , bArray    Close #intFile
End Sub
Kind of off topic but...

http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;Q232194


Quote:
> I get a "type missmatch" when I execute the following command:

> bData() = Inet1.OpenURL(strURL, icByteArray)

> in the VB code shown below.  Any help would be great...

> Dim strURL As String
> Dim bData() As Byte     ' Data variable
> Dim intFile As Integer   ' FreeFile variable

> t_from_file = "tycologo.jpg"
> t_to_file = "c:\aaa\RRRRRR.jpg"

> strURL = "ftp://64.226.65.34"

> intFile = FreeFile()      ' Set intFile to an unused
>                         ' file.
> ' The result of the OpenURL method goes into the Byte
> ' array, and the Byte array is then saved to disk.

> bData() = Inet1.OpenURL(strURL, icByteArray)
> Open t_to_file For Binary Access Write As #intFile
> Put #intFile, , bData()
> Close #intFile



Thu, 01 Jul 2004 11:17:58 GMT  
 Type Missmatch [dim b() as byte]
ooh, thats ugly, lets try this again...

Private Sub GetImage

Dim bArray() As Byte
Dim t_from_file As String
Dim t_to_file As String
Dim intFile As Integer   ' FreeFile variable

    t_from_file = "http://www.google.com/images/res1.gif"
    t_to_file = "c:\res1.gif"
    intFile = FreeFile()      ' Set intFile to an unused
                                ' file.
    ' The result of the OpenURL method goes into the Byte
    ' array, and the Byte array is then saved to disk.
    bArray = Inet1.OpenURL(t_from_file, icByteArray)

    Open t_to_file For Binary Access
    Write As #intFile
    Put #intFile, , bArray
    Close #intFile

End Sub


Quote:
> this worked for me...
> Private Sub Form_Load()
> Dim bArray() As ByteDim t_from_file As StringDim t_to_file As String
> Dim intFile As Integer   ' FreeFile variable    t_from_file =
> "http://www.google.com/images/res1.gif"    t_to_file = "c:\res1.gif"
> intFile = FreeFile()      ' Set intFile to an unused
> ' file.    ' The result of the OpenURL method goes into the Byte    '
array,
> and the Byte array is then saved to disk.        bArray =
> Inet1.OpenURL(t_from_file, icByteArray)    Open t_to_file For Binary
Access
> Write As #intFile    Put #intFile, , bArray    Close #intFile
> End Sub
> Kind of off topic but...

> http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;Q232194



> > I get a "type missmatch" when I execute the following command:

> > bData() = Inet1.OpenURL(strURL, icByteArray)

> > in the VB code shown below.  Any help would be great...

> > Dim strURL As String
> > Dim bData() As Byte     ' Data variable
> > Dim intFile As Integer   ' FreeFile variable

> > t_from_file = "tycologo.jpg"
> > t_to_file = "c:\aaa\RRRRRR.jpg"

> > strURL = "ftp://64.226.65.34"

> > intFile = FreeFile()      ' Set intFile to an unused
> >                         ' file.
> > ' The result of the OpenURL method goes into the Byte
> > ' array, and the Byte array is then saved to disk.

> > bData() = Inet1.OpenURL(strURL, icByteArray)
> > Open t_to_file For Binary Access Write As #intFile
> > Put #intFile, , bData()
> > Close #intFile



Thu, 01 Jul 2004 11:25:02 GMT  
 Type Missmatch [dim b() as byte]
Checkout the CByte conversion function. You can convert the variable before passing it to the function. This will help
if the other solution mentioned does not

HTH

--
Trevor Benedict R
Microsoft Certified Professional
Mascot Malaysia.



Sat, 03 Jul 2004 12:10:53 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Type Missmatch [dim b() as byte]

2. Type missmatch

3. Treeview add node type missmatch error

4. Need to convert a 16 byte array of bytes to 4 byte integer

5. Dim oappWD as Word.Application: User defined type not defined

6. Dim oappWD as Word.Application: User defined type not defined

7. Arrays dim'd at class scope get type mismatch

8. Dim as type work-around?

9. dim as object type

10. Multi-Dim array within Type statement?

11. Dim Arrays in User Types

12. Dim as what type ....????

 

 
Powered by phpBB® Forum Software