473,836 Members | 2,005 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 3488
Hi Galen,

I am interested in this issue. Would you mind letting me know the result of
the suggestions? If you need further assistance, feel free to let me know.
I will be more than happy to be of assistance.

Have a great day!

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 14 '06 #21

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

I am interested in this issue. Would you mind letting me know the result
of
the suggestions? If you need further assistance, feel free to let me know.
I will be more than happy to be of assistance.

Have a great day!

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.
I have split the dll's so Cmain works with main thread and CThread is in
it's own ActiveX.dll.

In my limited time I have looked at BackgroundWorke r in the Help pages but
find no examples of tying this to a dll.

On my web site http://home.surewest.net/galen/download/download.html is
USBdrvr.zip which contains the CThread class dll.

I use the name MyUSB for the Cmain stuff and I thought I would use MyWrkr
for the CThread stuff.

How do I create that MyWrkr and make it a separate thread?

Galen
Jul 14 '06 #22
Hi Galen,

Thank you for your update.

Since we're trying to use Windows message to send back the data, I think
using a simple thread would be enough for our purpose.

We need to create a simple class to represent the parameters needs to pass
to the worker thread, I've created a simple method that needs three
parameters:

<vb6>

Public Sub DoWork(ByVal hwnd As Long, ByVal count As Long, ByVal delay As
Long)
Dim b(20) As Byte
Dim cds As COPYDATASTRUCT
Dim i As Long

For i = LBound(b) To UBound(b)
b(i) = i
Next

For i = 0 To count - 1
cds.cbData = 10
cds.lpData = VarPtr(b(0))
SendMessage ByVal hwnd, WM_COPYDATA, ByVal hwnd, cds
Sleep delay
Next
End Sub
<VB2005>

Public Class WorkerArgs
Public hwnd As IntPtr
Public count As Integer
Public delay As Integer

Public Sub New(ByVal h As IntPtr, ByVal c As Integer, ByVal d As
Integer)
hwnd = h
count = c
delay = d
End Sub
End Class

Then we use ParameterizedTh readStart to start this new thread:

<VB2005>

Dim worker As New vbworker.Class1

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim t As Thread = New Thread(New ParameterizedTh readStart(Addre ssOf
DoWork))
t.Start(New WorkerArgs(Me.H andle, 10000, 1))
End Sub

Private Sub DoWork(ByVal arg As Object)
Dim wa As WorkerArgs = CType(arg, WorkerArgs)
worker.DoWork(w a.hwnd, wa.count, wa.delay)
End Sub

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 17 '06 #23
Hi Galen,

Since this thread is going rather long, to accelerate the process, you can
email me if you like. I'll be glad to continue working on this with you.
Thanks.

Have a nice day!

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 20 '06 #24

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
10107
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
10844
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
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
5649
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...
0
5826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4452
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4016
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3115
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.