Solved

DDE without a control.

Posted on 2004-08-25
4
297 Views
Last Modified: 2010-05-18
I'm trying to create a class module that encapsulates some dde commands that I use to interact with an older program.  However, I need a control like a label or textbox in order to have dde functionality, and as far as I can tell, these cannot be created through code alone.  Passing a reference to such an object works, but is crufty.  

Is there any way to create one of these objects through code alone?  I know you can add to an existing control array, but I want a completely new instance.  I've tried

Dim something as New Label

which gives the error "Invalid use of New keyword".  

Alternatively, is there a way to use DDE that isn't attached to one of these controls?  I've seen http://www.angelfire.com/biz/rhaminisys/ddclient.html commercial DDE classes that seem to do something similar, so it must be possible.
0
Comment
Question by:LastToKnow0
[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
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:nichia
ID: 11894805
'Adding a control to the form during runtime
Dim myControl As Control
Set myControl = Me.Controls.Add("VB.Label", "myControl")
myControl.Visible = True
myControl.Caption = "DDE Label"
0
 
LVL 1

Author Comment

by:LastToKnow0
ID: 11894926
Is there a way to do this from a class module, or code that is not attached to a form?
0
 
LVL 3

Accepted Solution

by:
nichia earned 300 total points
ID: 11895094
As far as I know, there is no way to have a Label or TextBox control reside outside a form.

You may have to use the DDE API to do this.

Here is a reference which I will look at now too:

Perform Interprocess Communication
Using the DDE Management Library

http://www.thescarms.com/vbasic/DDEML.asp
0
 
LVL 1

Author Comment

by:LastToKnow0
ID: 11895229
Oy, that looks complicated.  On the other hand, it seems to do exactally what I need.  Thanks.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

690 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