473,836 Members | 1,450 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ActiveX.exe and RaiseEvent

A VB6 ActiveX.exe raises an event which is seen by the VB6 App.

Same setup in VB2005. The event to be raised is in form frmSweep. As in VB6,
frmSweep is hidden when the events take place.

I know by actions on the screen and sounds in the speakers that VB2005 is
using the ActiveX.exe correctly.

However the events are never raised !!!

There are no Errors or Warnings shown after rebuilding the VB2005 App

Anyone have a clue as to why no events are raised?

Galen
Jun 29 '06
23 3489
On a much earlier thread in this newsgroup, I think it was "ActiveX.dl l more
problems", I had basically the same problems. That's why I tried the
ActiveX.exe with separate thread.

Originally I used the Jungo code written expressly for VB2005. At that time
the best I could get was about 1.5 Heart beats per minute (a data burst
every 706 ms). That's when Jungo suggested I encapsulate the older USB
drivers in a VB6 ActiveX as the Net drivers were definitely slower.

I will read through the material you have given me but it doesn't look too
promising.

My thought is, if there was some way to transmit the address of the main
thread byte array to the separate thread, then the BurstData event would
only have to deliver a flag. The separate thread would have already put the
data in the main thread byte array.

Comments?

Galen

"Walter Wang [MSFT]" <wa****@online. microsoft.comwr ote in message
news:PX******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Galen,

Thank you for the source code.

I've gone through the code and also done some research on the COM Interop
performance.

Based on my research, the bottleneck should be the BurstData event raised
from VB6. I've created some test projects to benchmark the difference
between VB6 and VB2005 handling the event. Handling the event in VB2005 is
much slower than in VB6. This is difficult to overcome due to the nature
of
marshaling between COM and .NET.

After I reviewed the source code of the ActiveX DLL project, I think it's
possible to implement it in VB2005 using P/Invoke to call the USB device
APIs. Also, thread is supported in VB2005 natively.

Although P/Invoke still has some overhead, it's much faster than COM
Interop. Please see following documentation for more information on
Managed/Unmanaged Code Interoperabilit y:

#An Overview of Managed/Unmanaged Code Interoperabilit y
http://msdn.microsoft.com/library/de...us/dndotnet/ht
ml/manunmancode.as p
This article provides basic facts about interoperabilit y between managed
and unmanaged code, and guidelines and common practices for accessing and
wrapping unmanaged API from managed code and for exposing managed APIs to
unmanaged callers. Security and reliability considerations, performance
data, and general practices for development processes are also
highlighted.

With every transition from managed code to unmanaged code (and vice
versa),
there is some performance overhead. The amount of overhead depends on the
types of parameters used. The CLR interop layer uses three levels of
interop call optimization based on transition type and parameter types:
just-in-time (JIT) inlining, compiled assembly stubs, and interpreted
marshaling stubs (in order of fastest to slowest type of call).

Approximate overhead for a platform invoke call: 10 machine instructions
(on an x86 processor).

Approximate overhead for a COM interop call: 50 machine instructions (on
an
x86 processor).
Here are some more resources on P/Invoke:

#Platform Invoke Tutorial
http://msdn.microsoft.com/library/de...us/csref/html/
vcwlkplatformin voketutorial.as p

#.NET: P/Invoke Revisited -- MSDN Magazine, October 2004
http://msdn.microsoft.com/msdnmag/issues/04/10/NET/
Talks about: Marshaling Structures, Object Lifetime and Pinning,
Marshaling
Value Types vs. Reference Types, StructLayoutAtt ribute, Non-Blittable
Marshaling.

#GotDotNet User Sample: Platform Invoke Samples
http://www.gotdotnet.com/community/u...mpleguid=f6f4c
339-22fd-44bb-a4fc-cfd874527ffb
The platform invoke samples demonstrate how to call functions exported
from
an unmanaged library: how to declare different types, how to use available
attributes to modify default behavior, how to use methods of the Marshal
class when needed, and which aspects of garbage collection and threading
could affect results.

#GotDotNet User Sample: Interop Declarations for Windows.h
http://www.gotdotnet.com/community/u...mpleguid=f1dd7
0e4-c212-4a6f-bff7-c82e34c8836f
When a Win32 API is not exposed by the .NET framework you must manually
write an interop wrapper to access that API. Writing these wrappers is
difficult and error prone. This post includes C# definitions of many
common
Win32APIs and their related data structures

#pinvoke.net: the interop wiki!
http://www.pinvoke.net
PINVOKE.NET attempts to address the difficulty of calling Win32 or other
unmanaged APIs in managed code (languages such as C# and VB.NET). This
site
is a repository where you can find, edit, and add PInvoke signatures,
user-defined types. Think of this as the 21st century version of VB6's
"API
Text Viewer".

Hope this helps. Please feel free to post here if anything is unclear.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 4 '06 #11
Hi Galen,

Thank you for your update.

I've checked your previous posts about this issue and seen more clearly
now.

Based on my test, even if the BurstData event is not passing the byte
array, the performance is still much worse. I think one possible solution
is to use windows message to pass the data between VB6 and VB2005.

1) In VB6 ActiveX DLL, add following declarations:

Private Const WM_COPYDATA = &H4A

Private Type COPYDATASTRUCT
dwData As Long
cbData As Long
lpData As Long
End Type

Private Declare Function SendMessage Lib "user32" Alias "SendMessag eA"
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long

2) Change class CMain to let the VB2005 client pass in a window handle,
this will be used to send the message WM_COPYDATA back to.

Public Sub SendData(ByVal hwnd As Long, ByVal data() As Byte)
Dim cds As COPYDATASTRUCT
cds.cbData = ubound(data) - lbound(data) + 1
cds.lpData = VarPtr(data(0))
SendMessage ByVal hwnd, WM_COPYDATA, ByVal hwnd, cds
End Sub

3) In VB2005, overrides a WinForm's WndProc event to handle the WM_COPYDATA
message:

Private Const WM_COPYDATA As Integer = &H4A

<System.Runtime .InteropService s.StructLayout( System.Runtime. InteropServices .
LayoutKind.Sequ ential)_
Private Structure COPYDATASTRUCT
Public dwData As IntPtr
Public cbData As Integer
Public lpData As Integer
End Structure

Protected Overrides Sub WndProc(ByRef m As System.Windows. Forms.Message)
If m.Msg = WM_COPYDATA Then
Dim cds As COPYDATASTRUCT = New COPYDATASTRUCT( )
cds =
System.Runtime. InteropServices .Marshal.PtrToS tructure(m.LPar am,
cds.GetType())
If (cds.cbData 0) Then
Dim data(cds.cbData - 1) As Byte
Dim source As IntPtr = New IntPtr(cds.lpDa ta)
Dim length As Integer = cds.cbData
System.Runtime. InteropServices .Marshal.Copy(s ource, data, 0,
length)
End If
End If
MyBase.WndProc( m)
End Sub

4) At last, you pass "Me.Handle" in VB2005 WinForm to VB6 as the window
handle.

Hope this helps. Please feel free to post here if anything is unclear.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 5 '06 #12
Whew!

I'll give this a try and get back to you.

Thanks

Galen

"Walter Wang [MSFT]" <wa****@online. microsoft.comwr ote in message
news:J3******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Galen,

Thank you for your update.

I've checked your previous posts about this issue and seen more clearly
now.

Based on my test, even if the BurstData event is not passing the byte
array, the performance is still much worse. I think one possible solution
is to use windows message to pass the data between VB6 and VB2005.

1) In VB6 ActiveX DLL, add following declarations:

Private Const WM_COPYDATA = &H4A

Private Type COPYDATASTRUCT
dwData As Long
cbData As Long
lpData As Long
End Type

Private Declare Function SendMessage Lib "user32" Alias "SendMessag eA"
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long

2) Change class CMain to let the VB2005 client pass in a window handle,
this will be used to send the message WM_COPYDATA back to.

Public Sub SendData(ByVal hwnd As Long, ByVal data() As Byte)
Dim cds As COPYDATASTRUCT
cds.cbData = ubound(data) - lbound(data) + 1
cds.lpData = VarPtr(data(0))
SendMessage ByVal hwnd, WM_COPYDATA, ByVal hwnd, cds
End Sub

3) In VB2005, overrides a WinForm's WndProc event to handle the
WM_COPYDATA
message:

Private Const WM_COPYDATA As Integer = &H4A

<System.Runtime .InteropService s.StructLayout( System.Runtime. InteropServices .
LayoutKind.Sequ ential)_
Private Structure COPYDATASTRUCT
Public dwData As IntPtr
Public cbData As Integer
Public lpData As Integer
End Structure

Protected Overrides Sub WndProc(ByRef m As System.Windows. Forms.Message)
If m.Msg = WM_COPYDATA Then
Dim cds As COPYDATASTRUCT = New COPYDATASTRUCT( )
cds =
System.Runtime. InteropServices .Marshal.PtrToS tructure(m.LPar am,
cds.GetType())
If (cds.cbData 0) Then
Dim data(cds.cbData - 1) As Byte
Dim source As IntPtr = New IntPtr(cds.lpDa ta)
Dim length As Integer = cds.cbData
System.Runtime. InteropServices .Marshal.Copy(s ource, data, 0,
length)
End If
End If
MyBase.WndProc( m)
End Sub

4) At last, you pass "Me.Handle" in VB2005 WinForm to VB6 as the window
handle.

Hope this helps. Please feel free to post here if anything is unclear.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 5 '06 #13
Well I must have done something wrong. After the thread in CThread is
started and ThreadWait is True, the USB device creates the sounds (at 75
beats per minute) and you can hear them in the loudspeaker.

I break after the sound create command is given and before the ThreadWait is
set to False. The sounds coming out of the speaker are real slow, like 1
beat per minute. Blows my mind. Here's my code changes:

In the VB6 code the only call to SendData is in the CallBackForm routine
which is only used when CThread is active.

In the module starting the action I added:
MyUSB.WinHandle = frmSweep.Handle

This is frmSweep. Note that GD_StatError is still used
Private WithEvents GD As HeartBeat.CMain
Private Const WM_COPYDATA As Integer = &H4A
<System.Runtime .InteropService s.StructLayout( System.Runtime. InteropServices .LayoutKind.Seq uential)>
_
Private Structure COPYDATASTRUCT
Public dwData As IntPtr
Public cbData As Integer
Public lpData As Integer
End Structure

Protected Overrides Sub WndProc(ByRef m As System.Windows. Forms.Message)
If m.Msg = WM_COPYDATA Then
Dim cds As COPYDATASTRUCT = New COPYDATASTRUCT( )
cds =
System.Runtime. InteropServices .Marshal.PtrToS tructure(m.LPar am, _
cds.GetType())
If (cds.cbData 0) Then
' Dim data(cds.cbData - 1) As Byte
Dim source As IntPtr = New IntPtr(cds.lpDa ta)
Dim length As Integer = cds.cbData
System.Runtime. InteropServices .Marshal.Copy(s ource, _
ModUSB.bytAry, 0, length)
End If
End If
MyBase.WndProc( m)
ModUSB.dtStatus = 0
modMain.USBflag = True
End Sub

' Private Sub GD_BurstData(By Ref DatAry As System.Array) Handles
GD.BurstData
' ModUSB.bytAry = DatAry
' ModUSB.dtStatus = 0
' modMain.USBflag = True
' End Sub

Private Sub GD_StatError(By Ref Stat As Integer) Handles GD.StatError
ModUSB.dtStatus = Stat
modMain.USBflag = True
End Sub
This is in Cmain. Note that the CThread still sends message to CMain and the
Shared module
has: Public gHwnd As Long

Const WM_COPYDATA = &H4A

Public Event StatError(Stat As Long)

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMem ory" (pDst As
Any, PSrc As Any, ByVal ByteLen As Long)
Private Type COPYDATASTRUCT
dwData As Long
cbData As Long
lpData As Long
End Type
Private Declare Function SendMessage Lib "user32" Alias "SendMessag eA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long

Private TI As ThreadInfo, SharedArr() As ThreadData
Private LastRingIndex As Long
Private WithEvents CallbackForm As fCallBackTrigge r
Private DeviceForm As fCallBackTrigge r

Public Sub SendData(ByVal hWnd As Long, ByRef data() As Byte)
Dim cds As COPYDATASTRUCT
cds.cbData = UBound(data) - LBound(data) + 1
cds.lpData = VarPtr(data(0))
SendMessage ByVal hWnd, WM_COPYDATA, ByVal hWnd, cds
End Sub

Private Sub CallbackForm_Ch eckRingBufferQu eue() 'Callback from our invisible
Helper-Form ("Event-Pumping" as necessary)
Dim DataChunk As TBurstData
With SharedArr(0)
If .Stat = 0 Then
'let's catch up all the Buffers we've missed since our last check
'the Ringbuffer has slots for 64 "SixPacks" - so you we can buffer
'single delays of up to around 1 Sec inside the Event-Handling
Do While LastRingIndex <.RingIndex
LastRingIndex = (LastRingIndex + 1) Mod (UBound(.RingBu ffer) +
1) 'move one slot forward
DataChunk = .RingBuffer(Las tRingIndex) 'let's make a copy from
the slot...
SendData gHwnd, DataChunk.DatAr y
Loop
Else
Stat = .Stat
RaiseEvent StatError(Stat)
End If
End With
End Sub

Public Property Let WinHandle(ByVal value As Long)
gHwnd = value
End Property

Galen
"Galen Somerville" <ga***@communit y.nospamwrote in message
news:e4******** ******@TK2MSFTN GP03.phx.gbl...
Whew!

I'll give this a try and get back to you.

Thanks

Galen

"Walter Wang [MSFT]" <wa****@online. microsoft.comwr ote in message
news:J3******** ******@TK2MSFTN GXA01.phx.gbl.. .
>Hi Galen,

Thank you for your update.

I've checked your previous posts about this issue and seen more clearly
now.

Based on my test, even if the BurstData event is not passing the byte
array, the performance is still much worse. I think one possible solution
is to use windows message to pass the data between VB6 and VB2005.

1) In VB6 ActiveX DLL, add following declarations:

Private Const WM_COPYDATA = &H4A

Private Type COPYDATASTRUCT
dwData As Long
cbData As Long
lpData As Long
End Type

Private Declare Function SendMessage Lib "user32" Alias "SendMessag eA"
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long

2) Change class CMain to let the VB2005 client pass in a window handle,
this will be used to send the message WM_COPYDATA back to.

Public Sub SendData(ByVal hwnd As Long, ByVal data() As Byte)
Dim cds As COPYDATASTRUCT
cds.cbData = ubound(data) - lbound(data) + 1
cds.lpData = VarPtr(data(0))
SendMessage ByVal hwnd, WM_COPYDATA, ByVal hwnd, cds
End Sub

3) In VB2005, overrides a WinForm's WndProc event to handle the
WM_COPYDATA
message:

Private Const WM_COPYDATA As Integer = &H4A

<System.Runtim e.InteropServic es.StructLayout (System.Runtime .InteropService s.
LayoutKind.Seq uential)_
Private Structure COPYDATASTRUCT
Public dwData As IntPtr
Public cbData As Integer
Public lpData As Integer
End Structure

Protected Overrides Sub WndProc(ByRef m As System.Windows. Forms.Message)
If m.Msg = WM_COPYDATA Then
Dim cds As COPYDATASTRUCT = New COPYDATASTRUCT( )
cds =
System.Runtime .InteropService s.Marshal.PtrTo Structure(m.LPa ram,
cds.GetType( ))
If (cds.cbData 0) Then
Dim data(cds.cbData - 1) As Byte
Dim source As IntPtr = New IntPtr(cds.lpDa ta)
Dim length As Integer = cds.cbData
System.Runtime. InteropServices .Marshal.Copy(s ource, data, 0,
length)
End If
End If
MyBase.WndProc( m)
End Sub

4) At last, you pass "Me.Handle" in VB2005 WinForm to VB6 as the window
handle.

Hope this helps. Please feel free to post here if anything is unclear.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

============== =============== =============== ======
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
============== =============== =============== ======

This posting is provided "AS IS" with no warranties, and confers no
rights.


Jul 5 '06 #14
Hi Glen,

Thank you for your update.

This is a quick note to let you know that I am performing research on this
issue and will get back to you as soon as possible. I appreciate your
patience.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 6 '06 #15
I should have mentioned, the CThread has started but the ThreadWait is True
so no messages are sent from CThread.

Yet in the App the Event is taking place. This should not happen until
ThreadWait is made False.

Galen

"Walter Wang [MSFT]" <wa****@online. microsoft.comwr ote in message
news:Oy******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Glen,

Thank you for your update.

This is a quick note to let you know that I am performing research on this
issue and will get back to you as soon as possible. I appreciate your
patience.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 6 '06 #16
Hi Galen,

Thank you for your update.

I'm currently working on another possible solution using Memory Map File
and Win32 Event to exchange data between unmanaged and managed code. While
I'm working on this, I have a suggestion and need your help:

Since CreateThread uses Free threading model, and Visual Basic 6.0 only
supports Apartment-model threading model, using CreateThread here may not
be appropriate. You can refer to http://support.microsoft.com/kb/198607/
for more information. I recommend you remove CThread, merge its function
into CMain, and create CMain in a new thread from VB2005. Thus in CMain we
only need to periodically read from the USB device and send message back to
VB2005 main window. Also, you don't need to use the form "fCallBackTrigg er"
anymore; you can now enable the "Unattended Execution" and "Retained in
Memory" options in VB6 project's properties. You must turn on the
"Unattended Execution" option and the "Retained in Memory" option before
compilation to host a VB 6.0 component (ActiveX DLL) in a multi-threaded
environment. See http://support.microsoft.com/kb/307211/ for more
information.

Other related KB articles:

#PRB: Threading Issues with Visual Basic 6.0 ActiveX Components
http://support.microsoft.com/kb/241896/

Please kindly test this workaround and let me know the result. Thanks!
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 7 '06 #17
Cannot merge CThread with CMain.

I originally had the Jungo calls in VB2005 directly like the following:
dwstatus = WDU_TransferBul k(gDev, 2, False, 0, VarPtr(bytAry(L oc)), _
ByVal Blen, Xsfrd, ByVal Twait)
But the marshaling took to long. It's still mashaled to Cmain but the call
is shorter like:
Call BulkOut(bytAry, Blen , dwstatus)
The performance this way is acceptable.

There are hundreds of IN/Out calls to Cmain but only one call to CThread

I could remove CThread and it's support from the dll. Then create a second
dll with the CThread stuff in it.

Would that suffice for this new test?

Galen

"Walter Wang [MSFT]" <wa****@online. microsoft.comwr ote in message
news:H%******** ********@TK2MSF TNGXA01.phx.gbl ...
Hi Galen,

Thank you for your update.

I'm currently working on another possible solution using Memory Map File
and Win32 Event to exchange data between unmanaged and managed code. While
I'm working on this, I have a suggestion and need your help:

Since CreateThread uses Free threading model, and Visual Basic 6.0 only
supports Apartment-model threading model, using CreateThread here may not
be appropriate. You can refer to http://support.microsoft.com/kb/198607/
for more information. I recommend you remove CThread, merge its function
into CMain, and create CMain in a new thread from VB2005. Thus in CMain we
only need to periodically read from the USB device and send message back
to
VB2005 main window. Also, you don't need to use the form
"fCallBackTrigg er"
anymore; you can now enable the "Unattended Execution" and "Retained in
Memory" options in VB6 project's properties. You must turn on the
"Unattended Execution" option and the "Retained in Memory" option before
compilation to host a VB 6.0 component (ActiveX DLL) in a multi-threaded
environment. See http://support.microsoft.com/kb/307211/ for more
information.

Other related KB articles:

#PRB: Threading Issues with Visual Basic 6.0 ActiveX Components
http://support.microsoft.com/kb/241896/

Please kindly test this workaround and let me know the result. Thanks!
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 7 '06 #18
Hi Galen,

Thank you for your update.

What I mean is removing multi-threading code and the callback form from
VB6. I agree with you than we may not simply merge CThread with CMain here.
Based on my understanding, CThread is used to continually send burst data
back to UI, CMain is used to communicate with the USB device since directly
call USB device APIs in VB2005 is slow, right? If it's possible, I
recommend we separate CMain and CThread, and create CThread from a separate
thread in VB2005.

--
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.
Jul 8 '06 #19
We are now together on this. I will try your suggestions and get back to
you.

Thanks

Galen

"Walter Wang [MSFT]" <wa****@online. microsoft.comwr ote in message
news:Ov******** ******@TK2MSFTN GP04.phx.gbl...
Hi Galen,

Thank you for your update.

What I mean is removing multi-threading code and the callback form from
VB6. I agree with you than we may not simply merge CThread with CMain
here. Based on my understanding, CThread is used to continually send burst
data back to UI, CMain is used to communicate with the USB device since
directly call USB device APIs in VB2005 is slow, right? If it's possible,
I recommend we separate CMain and CThread, and create CThread from a
separate thread in VB2005.

--
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 9 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5042
by: jva02 | last post by:
Hi, I'm confused why I can capture an event fired by an ActiveX object when it's loaded via an <object> tag, but not when loaded using "new ActiveXObject". Here's a basic example: vb ActiveX object: Private Declare Sub Sleep Lib "kernel32" (ByVal dwmilliseconds As Long)
1
1641
by: Guille | last post by:
Hi all! I'm having some weird behaviour in a .NET application i'm developing. I'll try to explain: I've created a Class that wraps an asynchronous socket. When connect callback is called, i raise a class event : ' Create socket sock = New Socket(AddressFamily.InterNetwork, _
8
10108
by: Nicolas | last post by:
How do I do a RaiseEvent in csharp I'm ok in VB but csharp confused me a lot. ******* code ******** private FileSystemWatcher watcher = new FileSystemWatcher(); public delegate void Changed(WatcherChangeTypes exch); public delegate void Created(string fileName); public delegate void ReCreated(string OldName, string newName); public delegate void OverRun(string Message);
2
5360
by: Bill | last post by:
I have a VB6 ActiveX EXE app that generates events that I would like to handle in a C# application. The events in the VB app are defined like: Public Event SometingHappened(what As String) and raised like so: Public Sub EventNotification(ByVal what As String) RaiseEvent SometingHappened(what)
2
1442
by: Lim | last post by:
I've developed a program that raise an event. This program works fine on a Windows 2000 Professional PC. However when I try to run the program on a Windos XP Professional PC, the program will not execute the raiseevent function. How can I resolve the problem?
2
2009
by: dmoonme | last post by:
I'm trying to rename some files in a directory. Pretty basic stuff - renaming the files works fine but the problem I have is updated the text in textbox. All I want to do is appendtext to a textbox. The problem is that duplicate text occurs. Hopefully my code will explain better what I'm trying to do and what i'm doing wrong :) Thanks for your help! Public Class Form1 Private Sub btnRun_Click(ByVal sender As System.Object, ByVal e...
7
6545
by: Onokiyo | last post by:
Hello, I have the code below and somehow the message from RaiseEvent doesn't pop up at all. Can someone help me please? '------CODE '------/form1.vb/VB2005/Framework20--------- Imports System
1
2059
by: Terry Olsen | last post by:
I have a program with a couple of long running processes that i'm calling on a separate thread. When the process is completed, I want to raise an event to tell the main thread that it's done. I set it up this way... Public Class frmLongRunningProcess Public Enum Proc ParseZipFiles = 0
0
1866
by: drtwkim | last post by:
Hi.. I can't speak english very well. I have writting code a program with VB & Python - COM Server : Visual basic (ActiveX EXE) - COM Client : Python I expect to attempt that is retrieved a return value. but, don't returned a event value ( in python)
0
9820
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9671
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10845
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10549
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7792
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6979
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5650
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4019
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.