473,320 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Help Pls-how To Create User Defined Data Types

Hi All,
i m a new user to visual basic 6.can some one explain to me in detail as to how to create user defined data types?wat reference i should create for it?how to craete references?where should i add it in my project?
Feb 11 '08 #1
4 1724
debasisdas
8,127 Expert 4TB
Are you trying to refer any external DLL ?
Feb 11 '08 #2
Are you trying to refer any external DLL ?
HI debasisdas,

ya i want to refer to an external dll.
actually tis proj was already created.wen i compiled it i got an error "user defined type not defined".i enclose the code here.

Dim OBJ1 As Class1
Dim OBJ2 As Class2
Dim FRM As Form
Public RAD As Long

Private Sub cmdCheckCataract_Click()
Set FRM = Me
' TO DISPLAY THE RESULT IN SEPERATE FORM
'Set frm = New Form2
' FRM.Left = Me.Left + Me.Width
' FRM.Top = Me.Top
With picTemp
.Width = picImage.Width
.Height = picImage.Height
.PaintPicture picImage.Image, 0, 0
End With
OBJ2.getWhitePixels FRM, picTemp, FRM.picImage, Me.Caption
End Sub

Private Sub cmdEdgeDetection_Click()
Set FRM = Me
' TO DISPLAY THE RESULT IN SEPERATE FORM
'Set FRM = New Form2
' FRM.Left = Me.Left + Me.Width
' FRM.Top = Me.Top
With picTemp
.Width = picImage.Width
.Height = picImage.Height
.PaintPicture picImage.Image, 0, 0
End With
OBJ2.edgeDetection FRM, picTemp, FRM.picImage, Me.Caption
End Sub


Private Sub cmdGrayScale_Click()
Set FRM = Me
' TO DISPLAY THE RESULT IN SEPERATE FORM
' Set FRM = New Form2
' FRM.Left = Me.Left + Me.Width
' FRM.Top = Me.Top
With picTemp
.Width = picImage.Width
.Height = picImage.Height
.PaintPicture picImage.Image, 0, 0
End With
OBJ2.grayScale FRM, picTemp, FRM.picImage, Me.Caption
End Sub

Private Sub cmdLoadPicture_Click()
OBJ2.FILE_NAME = Me.Caption
OBJ2.loadImage Me, picImage
End Sub

here i m getting a error in the first two lines.i dont know where class1 and class2 are defined and how to reference to it.pls help
Feb 11 '08 #3
mafaisal
142 100+
Hello
if Class1 & Class2 are External, I this that is register in ur system,
Please go to project reference, search these dll there and select that
then try
Faisal

HI debasisdas,

ya i want to refer to an external dll.
actually tis proj was already created.wen i compiled it i got an error "user defined type not defined".i enclose the code here.

Dim OBJ1 As Class1
Dim OBJ2 As Class2
Dim FRM As Form
Public RAD As Long

Private Sub cmdCheckCataract_Click()
Set FRM = Me
' TO DISPLAY THE RESULT IN SEPERATE FORM
'Set frm = New Form2
' FRM.Left = Me.Left + Me.Width
' FRM.Top = Me.Top
With picTemp
.Width = picImage.Width
.Height = picImage.Height
.PaintPicture picImage.Image, 0, 0
End With
OBJ2.getWhitePixels FRM, picTemp, FRM.picImage, Me.Caption
End Sub

Private Sub cmdEdgeDetection_Click()
Set FRM = Me
' TO DISPLAY THE RESULT IN SEPERATE FORM
'Set FRM = New Form2
' FRM.Left = Me.Left + Me.Width
' FRM.Top = Me.Top
With picTemp
.Width = picImage.Width
.Height = picImage.Height
.PaintPicture picImage.Image, 0, 0
End With
OBJ2.edgeDetection FRM, picTemp, FRM.picImage, Me.Caption
End Sub


Private Sub cmdGrayScale_Click()
Set FRM = Me
' TO DISPLAY THE RESULT IN SEPERATE FORM
' Set FRM = New Form2
' FRM.Left = Me.Left + Me.Width
' FRM.Top = Me.Top
With picTemp
.Width = picImage.Width
.Height = picImage.Height
.PaintPicture picImage.Image, 0, 0
End With
OBJ2.grayScale FRM, picTemp, FRM.picImage, Me.Caption
End Sub

Private Sub cmdLoadPicture_Click()
OBJ2.FILE_NAME = Me.Caption
OBJ2.loadImage Me, picImage
End Sub

here i m getting a error in the first two lines.i dont know where class1 and class2 are defined and how to reference to it.pls help
Feb 11 '08 #4
Hello
if Class1 & Class2 are External, I this that is register in ur system,
Please go to project reference, search these dll there and select that
then try
Faisal
hi Faisal,
wen i compile tis code i m gettting the error user defined type not defined.

Option Explicit
Dim fso As New FileSystemObject
Dim TS As TextStream
Dim TS1 As TextStream
Dim TEMP1$, TEMP2$
Private mvarFILE_NAME As String 'local copy
Dim X&, Y&
Dim R&, G&, B&
Dim IMAGE_HEIGHT&

Public Sub loadImage(FRM As Form, PB As PictureBox) 'To load the picture
On Error GoTo ERR
PB.Picture = LoadPicture(mvarFILE_NAME)
FRM.Width = PB.Width + 100
FRM.Height = PB.Height + 400
FRM.Visible = True
noOfForms = noOfForms + 1
With MDIForm1.tbrFile
.Buttons(2).Enabled = True
.Buttons(4).Enabled = True
.Buttons(6).Enabled = True
End With
With MDIForm1.tbrEdit
.Buttons(4).Enabled = True
End With
Exit Sub
ERR:
Unload FRM
MsgBox ERR.Description, vbCritical, "Unable to load the image"
Set TS = fso.OpenTextFile(App.Path & "\FILES_OPENED.TXT", ForReading, True)
Set TS1 = fso.OpenTextFile(App.Path & "\TEMP.TXT", ForWriting, True)
X = 1
While Not TS.AtEndOfLine
TEMP1 = TS.ReadLine
TEMP2 = Mid(TEMP1, InStr(1, TEMP1, ".") + 1, Len(TEMP1))
'TEMP2 = Mid(TEMP1, 4, Len(TEMP1))
If mvarFILE_NAME = TEMP2 Then
'MsgBox "DELETED"
Else
TEMP2 = "&" & X & "." & TEMP2
TS1.WriteLine (TEMP2)
MDIForm1.mnuFileFileopened(X).Caption = TEMP2
X = X + 1
End If
Wend
MDIForm1.mnuFileFileopened(X).Visible = False
Unload MDIForm1.mnuFileFileopened(X)
If X = 1 Then
MDIForm1.mnuFileBar5.Visible = False
Else
MDIForm1.mnuFileBar5.Visible = True
End If
FO_INDEX = X
TS.Close
TS1.Close
fso.DeleteFile App.Path & "\FILES_OPENED.TXT"
fso.MoveFile App.Path & "\TEMP.TXT", App.Path & "\FILES_OPENED.TXT"
End Sub

Public Property Let FILE_NAME(ByVal vData As String)
mvarFILE_NAME = vData
End Property

in 2nd ,3rd, line.wat apppropriate dll shld i add in the reference.how will i find wat is appropriate reference.
Feb 11 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Omavlana | last post by:
Hi, Why I am not able to assign any parameter value to paramField.ParameterFieldName property? It is always giving me <error: an exception of type: {System.ArgumentException} occured>
1
by: den.NET | last post by:
i use c++.NET 2003.i simply make a windows form.2 text boxs( takes the number),a buton and another multilined textbox.So simple,when u hit the button it just takes the number in the 1st text box...
3
by: | last post by:
Hello All, this is my first post. OK - The goal is to display the following (note: substitute 1' ' for 2'*') by using 3 recursive functions. 0123454321001234543210 **012343210012343210**...
1
by: B.Desai | last post by:
Hello Experts, Can you please help me out? I am very frustrated! I am trying to update import specification, and it does not let me do that. I have saved specification and now I need to add...
6
by: Eddy | last post by:
Hi ! I have to help a student with his school project. He is learning 'C', using Turbo C 2.1 on a Windows XP pc. ( don't ask me why pls ! ) I proposed him to decode a DCF77 time signal...
4
by: Zamolxe | last post by:
fter creating a Office prj in C# this error appears is the wordDoc is oppened, if the prj is compiled and runed from the IDE the WORD is opening and after a nanosec it closes. How can I fix this. ...
2
by: Raghu Raman | last post by:
Hi , am storing the session id in my database when the user signs in.The session_on start is firing nice & am doing my DB operations there & quite working good. But when the user closes the...
1
by: rohini4u | last post by:
i have a prob of c++ dat i m not being able to write as a prog.could anyone write the prog for me or give me any solution outline? the prob is--------------- take a char to char to pointer.store...
1
by: pjai | last post by:
Hi, I'm a newbie pls can you look at my site and help me correct it. I'm using dreamweaver and these pages are giving me problems in mozilla - text layers not lined up. Here's my link...
1
by: niko456 | last post by:
could you pls help me? what is meant by client height and scale height? what are their differences
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.