Message 1 of 6
Executing a COM function from a COM event in Visual Basic ?
Not applicable
11-13-2001
08:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello evrybody,
I have created an ARX file that i load in a visual basic project. This file
expose a COM object with events. Here is my problem :
In visual basic, in the main form i declare it like that :
____________________________________________________________
Dim WithEvents MyObj as MyArx.Application
' One of the event of MyObj :
Private Sub MyObj_OneEvent(Value1 as double, Value2 as double)
Dim NewValue
NewValue = SomeFunctionInVB (Value1, Value2)
MyObj.Function1(NewValue)
End Sub
' I'm making calculation in VB and sending back the result in C++.
____________________________________________________________
' Then, some calculation are done in C++ and Function1 will Fire a second
event :
Private Sub MyObj_OtherEvent (Value3 as double)
AnOtherFunctionInVB (Value3)
End Sub
_____________________________________________________________
My question is :
- Is it possible to execute a function from an event of the same COM class
(class ATL_NO_VTABLE CApplication :...) ?
It doesn't seem to work. I loose everything in AutoCAD, and also in Visual
Basic ... no answer ... When i try to execute the program in debug mode wiht
breakpoints in VC++, nothing happened ...
I use Visual Baisc 6, Visual C++ 6 and AutoCAD 2000 ... Without the Function
in the event, everything work very well.
What do you suggest ? Thank's.
Driss.
I have created an ARX file that i load in a visual basic project. This file
expose a COM object with events. Here is my problem :
In visual basic, in the main form i declare it like that :
____________________________________________________________
Dim WithEvents MyObj as MyArx.Application
' One of the event of MyObj :
Private Sub MyObj_OneEvent(Value1 as double, Value2 as double)
Dim NewValue
NewValue = SomeFunctionInVB (Value1, Value2)
MyObj.Function1(NewValue)
End Sub
' I'm making calculation in VB and sending back the result in C++.
____________________________________________________________
' Then, some calculation are done in C++ and Function1 will Fire a second
event :
Private Sub MyObj_OtherEvent (Value3 as double)
AnOtherFunctionInVB (Value3)
End Sub
_____________________________________________________________
My question is :
- Is it possible to execute a function from an event of the same COM class
(class ATL_NO_VTABLE CApplication :...) ?
It doesn't seem to work. I loose everything in AutoCAD, and also in Visual
Basic ... no answer ... When i try to execute the program in debug mode wiht
breakpoints in VC++, nothing happened ...
I use Visual Baisc 6, Visual C++ 6 and AutoCAD 2000 ... Without the Function
in the event, everything work very well.
What do you suggest ? Thank's.
Driss.