Solved

DDE without a control.

Posted on 2004-08-25
4
286 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
  • 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Link a textbox in excel to a cell with more than 255 characters. 5 88
add text to end of existing text in file 16 70
Visual Basic Excel Formatting error 4 106
Help me. 3 54
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

770 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