Solved

visual basic errors from MS sample

Posted on 2013-10-23
2
1,115 Views
Last Modified: 2013-10-23
Hi,

It's been quite a while since I worked with Visual Basic, and so I'm running into errors just trying to build a simple MS application using these instructions:  http://support.microsoft.com/kb/74861
I created the project as a Windows Forms Application.
Sub Form_Load ()
      'This procedure will start the VB source application.
      z% = Shell("SOURCE", 1)
      z% = DoEvents()   'Causes Windows to finish processing Shell command.
      Text1.LinkMode = NONE   'Clears DDE link if it already exists.
      Text1.LinkTopic = "Source|Form1"   'Sets up link with VB source.
      Text1.LinkItem = "Text1"           'Set link to text box on source.
      Text1.LinkMode = MANUAL            'Establish a manual DDE link.
      ManualLink.Value = TRUE            'Sets appropriate option button.
   End Sub

Open in new window

Other than my form being called Form1, I didn't change anything. However, I already get these errors:
Error	1	'z' is not declared. It may be inaccessible due to its protection level.	D:\Development\VB\MyDDE-VBtest\MyDDE-VBtest\Form1.vb	16	9	MyDDE-VBtest
Error	2	'z' is not declared. It may be inaccessible due to its protection level.	D:\Development\VB\MyDDE-VBtest\MyDDE-VBtest\Form1.vb	18	9	MyDDE-VBtest
Error	3	'DoEvents' is not declared. It may be inaccessible due to its protection level.	D:\Development\VB\MyDDE-VBtest\MyDDE-VBtest\Form1.vb	18	14	MyDDE-VBtest
Error	4	'LinkMode' is not a member of 'System.Windows.Forms.TextBox'.	D:\Development\VB\MyDDE-VBtest\MyDDE-VBtest\Form1.vb	20	9	MyDDE-VBtest
Error	5	'LinkTopic' is not a member of 'System.Windows.Forms.TextBox'.	D:\Development\VB\MyDDE-VBtest\MyDDE-VBtest\Form1.vb	22	9	MyDDE-VBtest
Error	6	'LinkItem' is not a member of 'System.Windows.Forms.TextBox'.	D:\Development\VB\MyDDE-VBtest\MyDDE-VBtest\Form1.vb	23	9	MyDDE-VBtest
Error	7	'LinkMode' is not a member of 'System.Windows.Forms.TextBox'.	D:\Development\VB\MyDDE-VBtest\MyDDE-VBtest\Form1.vb	24	9	MyDDE-VBtest
Error	8	'Value' is not a member of 'System.Windows.Forms.RadioButton'.	D:\Development\VB\MyDDE-VBtest\MyDDE-VBtest\Form1.vb	25	9	MyDDE-VBtest

Open in new window

Can anyone tell me what's going on here?  Is there a secret to building sample code from MS?  Unfortunately the article doesn't say anything about any additional references or libraries or anything that I need to add.

How do I fix this?

Thanks!

P.S. I'm using Visual Studio 2010 on Win 7. I have admin privileges.
0
Comment
Question by:ugeb
2 Comments
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
Comment Utility
Hi ugeb;

The link you posted is for Visual Basic prior to Visual Basic .Net. That code is not supported in the newer Visual Studio 2010 but will only compile under Visual Basic 6 or earlier.

Please see the following link for information on DDE and .Net Framework.
Using DDE in .NET to Communicate with WinWedge
0
 
LVL 11

Author Closing Comment

by:ugeb
Comment Utility
Fantastic, thank you for the DDE .net link, it's exactly what I've been searching for!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now