Программирование на Visual Basic, главный форум. Обсуждение тем программирования на VB 1—6.
Даже если вы плохо разбираетесь в VB и программировании вообще — тут вам помогут. В разумных пределах, конечно.
Правила форума
Темы, в которых будет сначала написано «что нужно сделать», а затем просьба «помогите», будут
закрыты.
Читайте
требования к создаваемым темам.
-
ForTex
-
- Новичок

-
-
- Сообщения: 45
- Зарегистрирован: 15.11.2002 (Пт) 8:18
- Откуда: Russia
-
ForTex » 21.04.2003 (Пн) 7:44
Можно ли как то через AddressOf обратьться к процедуре, объявленной как Public в модуле класса.... При помещении её в обычный модуль, всё проходит, а если я её помещаю в moduleClass, и из него же вызываю - вываливается сообщение Invalid Use AddressOf operator....
-
alibek
-
- Большой Человек

-
-
- Сообщения: 14205
- Зарегистрирован: 19.04.2002 (Пт) 11:40
- Откуда: Russia
alibek » 21.04.2003 (Пн) 8:51
RTFM!
Using the AddressOf Keyword
Any code you write to call a function pointer from Visual Basic must be placed in a standard .BAS module — you can't put the code in a class module or attach it to a form. When you call a declared function using the AddressOf keyword, you should be aware of the following conditions:
- AddressOf can only be used immediately preceding an argument in an argument list; that argument can be the name of a user-defined sub, function, or property.
- The sub, function, or property you call with AddressOf must be in the same project as the related declarations and procedures.
- You can only use AddressOf with user-defined subs, functions, or properties — you cannot use it with external functions declared with the Declare statement, or with functions referenced from type libraries.
- You can pass a function pointer to an argument that is typed As Any or As Long in a declared Sub, Function, or user-defined type definition.
Lasciate ogni speranza, voi ch'entrate.
-
GoGosha
-
- Постоялец

-
-
- Сообщения: 642
- Зарегистрирован: 02.08.2002 (Пт) 9:14
- Откуда: Russia
-
GoGosha » 21.04.2003 (Пн) 19:36
ForTex писал(а):Можно ли как то через AddressOf обратьться к процедуре, объявленной как Public в модуле класса.... При помещении её в обычный модуль, всё проходит, а если я её помещаю в moduleClass, и из него же вызываю - вываливается сообщение Invalid Use AddressOf operator....
Попробуй сделать в обычном модуле
Private Function LMyFunction()
LMyFunction = MyFunction
End Function
Вернуться в Visual Basic 1–6
Кто сейчас на конференции
Сейчас этот форум просматривают: AhrefsBot, Google-бот, Yandex-бот и гости: 10