VBC Compiler

jnash

Well-known member
Joined
Oct 20, 2006
Messages
111
Programming Experience
Beginner
i want to compile this form below using vbc, but i know that im either missing references for the flash and the media player when i compile it, which references do i use everything i try doesnt seem to work
also VBC is giving out a error saying that .imagelocation is not a member of picturebox (which it is !!)

im using this to compile

VB.NET:
vbc /t:winexe /reference:System.dll,System.Windows.Forms.dll,System.Data.DLL,system.drawing.dll /out:testform form1.vb
and the basic form i want to compile using vbc is this:

VB.NET:
Imports System
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports system.Drawing.color
Imports AxWMPLib.AxWindowsMediaPlayer
Imports AxWMPLib.AxWindowsMediaPlayer
Imports xInterop.ShockwaveFlashObjects
Public Class FirstForm
Shared Sub Main()
Dim temp As New System.Drawing.Point
Dim temp1 As New System.Drawing.Size

Dim FirstForm As New form
FirstForm.Text = "FirstForm"
FirstForm.BackColor =Black


Dim audio1 As New AxWMPLib.AxWindowsMediaPlayer
temp.X =189
temp.Y =307
audio1.Location = temp
temp1.width = 375
temp1.height = 115
audio1.Size = temp1 
audio1.Parent = FirstForm
audio1.URL ="C:\Documents and Settings\halo9\My Documents\Visual Studio 

2005\Projects\Multimedia Authoring System\bin\media\Audio\Audio1.MP3"
Dim image1 As New PictureBox
temp.X =186
temp.Y =142
image1.Location = temp
temp1.width = 372
temp1.height = 150
image1.Size = temp1
image1.Parent = FirstForm
image1.ImageLocation ="C:\Documents and Settings\halo9\My Documents\Visual Studio 

2005\Projects\Multimedia Authoring System\bin\media\Image\Image1.Jpeg"
image1.SizeMode = PictureBoxSizeMode.StretchImage


Dim tbox As New Textbox
temp.X =187
temp.Y =34
tbox.Location = temp
temp1.width = 377
temp1.height = 97
tbox.Size = temp1
tbox.Parent = FirstForm
tbox.Text = "Helllo"
tbox.BorderStyle = BorderStyle.FixedSingle


Dim tbox As New Textbox
temp.X =243
temp.Y =28
tbox.Location = temp
temp1.width = 0
temp1.height = 0
tbox.Size = temp1
tbox.Parent = FirstForm
tbox.Text = ""
tbox.BorderStyle = BorderStyle.FixedSingle

FirstForm.Showdialog()


end sub
end Class
The errors im getting are:

VB.NET:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\halo9>cd desktop

C:\Documents and Settings\halo9\Desktop>vbc /t:winexe /reference:System.dll,Syst
em.Windows.Forms.dll,System.Data.DLL,system.drawing.dll /out:testform firstform.
vb
Microsoft (R) Visual Basic .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322.573
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

C:\Documents and Settings\halo9\Desktop\FirstForm.vb(5) : error BC30466: Namespa
ce or type 'AxWindowsMediaPlayer' for the Imports 'AxWMPLib.AxWindowsMediaPlayer
' cannot be found.

Imports AxWMPLib.AxWindowsMediaPlayer
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\halo9\Desktop\FirstForm.vb(6) : error BC30466: Namespa
ce or type 'AxWindowsMediaPlayer' for the Imports 'AxWMPLib.AxWindowsMediaPlayer
' cannot be found.

Imports AxWMPLib.AxWindowsMediaPlayer
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\halo9\Desktop\FirstForm.vb(7) : error BC30466: Namespa
ce or type 'ShockwaveFlashObjects' for the Imports 'xInterop.ShockwaveFlashObjec
ts' cannot be found.

Imports xInterop.ShockwaveFlashObjects
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\halo9\Desktop\FirstForm.vb(18) : error BC30002: Type '
AxWMPLib.AxWindowsMediaPlayer' is not defined.

Dim audio1 As New AxWMPLib.AxWindowsMediaPlayer
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\halo9\Desktop\FirstForm.vb(35) : error BC30456: 'Image
Location' is not a member of 'System.Windows.Forms.PictureBox'.

image1.ImageLocation ="C:\Documents and Settings\halo9\My Documents\Visual Studi
o 2005\Projects\Multimedia Authoring System\bin\media\Image\Image1.Jpeg"
~~~~~~~~~~~~~~~~~~~~

C:\Documents and Settings\halo9\Desktop\FirstForm.vb(51) : error BC30288: Local
variable 'tbox' is already declared in the current block.

Dim tbox As New Textbox
    ~~~~

C:\Documents and Settings\halo9\Desktop>
Its really baffling me Thanks

Jon
 
Thanks john, i did some more researching into the exception and realised its something to do with the state of the active X control, with that information i looked at a generated form and extracted the coding required to initialize and it worked thanks again !

Jon
 
axWmp actually doesn't need the generated initializing code to work, I tested this last night by just added the control in form Load event (and set Url there also afterwards) and there were no problems with doing so. But you can get many good tips on how the visual Designer does code there still, stuff we take for granted when just adding a control to form setting some properties is all generated into that code.
 
Back
Top