English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Here is what I am trying to do. It works with modules but not classes


typedef TESTDATA
x1 as double
y1 as double
x2 as double
y2 as double
dist as double
end type

sub func()
dim test as TESTDATA
dim TestClass as clsTest

set TestClass = new clsTest
TestData.x1 = 0
TestData.y1 = 0
TestData.x2 = 10
TestData.y2 = 10
TestClass.GetDistance TestData

end sub

2006-12-08 05:53:01 · 1 answers · asked by Zefram 2 in Computers & Internet Programming & Design

1 answers

Well if you can you really should make any UDTs into their own classes but if you can't, there is one little trick you must do to get around it. Again I strongly recommend you convert it to a class rather than do this but if you MUST use the UDT as is you can include it as public within a DLL or EXE (along with the class that uses it) and include a reference to this library in your project.

I some how managed to find a site that talks about this technique along with the example code to demonstrate it. This is the only way I know of getting around the passing of UDT restriction among classes.

Hope it helps and good luck!

2006-12-08 09:18:31 · answer #1 · answered by Martyr2 7 · 0 0

fedest.com, questions and answers