[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Exposing Winsock_DataArrival Event (or any other event from a .dll) ) in a custom ActveX .dll

Posted on 2001-07-18
7
Medium Priority
?
340 Views
Last Modified: 2013-11-25
I am writing an ActiveX dll, which encapsulates the Winsock Component to perform SMTP commands via port 25 I have written this using the winsock control inside a standard .exe with no problems at all. However in a .dll I can only use the CreateObject(ProgID) in my code
(as there is no form for the control to sit on).  Again no problem, I can access the methods and set properties etc...  My code relies on the Winsock_DataArrival event to execute certain rules.  How can I expose the events of an object instance which has been created programmatically?  I have a feeling that the key lies somewhere in either WithEvents or RaiseEvents (or both).
Ideally to keep things as simple as possible, I do not want to use the Winsock API!

Any help with the above would be of great help.

Many thanks in advance,

Dave
0
Comment
Question by:davee_jay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 4

Accepted Solution

by:
VincentLawlor earned 200 total points
ID: 6294333
Use WithEvents and Raise event from your DLL

In your main code write handlers for these events.

There's loads of help available in MSDN.

http://mdsn.microsoft.com

Vin.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7156171
Hi davee_jay,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept VincentLawlor@devx's comment(s) as an answer.
    ** I'm not sure this is complete enough to be PAQworthy.

davee_jay, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Author Comment

by:davee_jay
ID: 7156545
My apologies for not getting back to you sooner.  I did indeed use WithEvents as was my hunch, and after a bit of input from MSDN and some experimenting I got it working.

I totally forgot to update the 'experts' question.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 49

Expert Comment

by:DanRollins
ID: 7156597
davee_jay,
Here's a tip for the future, in case you continue to use this site:  Most experts would rather not receive a C on their grading record.  I'm sure you meant well, but please review the EE grading guidelines:  http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp#3  Thanks!
-- Dan
0
 
LVL 1

Author Comment

by:davee_jay
ID: 7156643
Ah, any chance that grading can be ammended once it has been submitted, because after looking at the guidelines, it looks more relevant to give an A)?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7157578
You can post a message to Community Support by clicking here: http://www.experts-exchange.com/jsp/qAskQuestion.jsp?ta=commspt 
Indicate that you made a mistake in grading and specify your desire.  Be sure to include the question ID.  It is: Q_20152835

-- Dan
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7159217
Grade changed as requested

Computer101
E-E Moderator
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question