To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 11487
11486  |  11488
Subject: 
Re: Installing SPIRIT.OCX in VC++
Newsgroups: 
lugnet.robotics
Date: 
Sat, 13 May 2000 04:41:38 GMT
Viewed: 
661 times
  
Hallo Daniele.

1.
First you have to install the SPIRIT.OCX-ActiveX-Control. Therefor copy your
DLL (or OCX) and the help- and licensefiles onto your harddisk. Best
position is the \windows\system- (Win95/98) or \winnt\system32- directory.
Next you have to register the ActiveX-Control in the registry. The windows
tool REGSVR32 is a client program that is used with the following
commandline parameters:

Example:    REGSVR32 \windows\system\spirit.ocx

All this is allready done by installing the LEGO-Mindstorm software.

2.
When creating a new VC++-project select MFC-Application-Wizard (exe). In the
next window use the ActiveX-Control option and finish the application as
usually.
Now you can add an ActiveX-Control as resource to your application
(Project->Add to project->Components and controls->Registered ActiveX
Controls). Scroll your way across until you come to the 'Spirit Control'
with a little lego icon on it. Finally you will have a new class called
CSpirit and you will see another control in your control-window: the
LEGO-control. Drop it onto your application in ResourceView!
At last go to the ClassWizard and to the member variable pane where you can
click on the control ID for the spirit control and add a new variable (p.E.
m_spirit).

That's it.

Now you will be able to use all methods (member-functions) of this instance.
First you need to set up communications by calling following functions:

m.spirit.SetComPort( long no);    // number of com-port connected to your
IR-tower
m.spirit.SetLinkType(long type);    // 0=IR-link, 1=Cable, 2=Radio
m.spirit.SetPBrick(long type);    // 0=Spirit, 1=RCX
m.spirit.InitComm();    // no arguments

Please take a look at the SDK-documentation (PDF-file) where you can find a
complete description of all these functions.

Hope i could help you...

N. Bogner



"Daniele Pongan" <dpongan@iiic.ethz.ch> schrieb im Newsbeitrag
news:391BF587.1956E503@iiic.ethz.ch...
Does anyone know how to install (to use) the Spirit.ocx in Visual C++?
Thanks

Giammi & Pongo



Message has 1 Reply:
  Re: Installing SPIRIT.OCX in VC++
 
Oops, the name of the expample-instance is m_spirit instead of m.spirit: m_spirit.SetComPort( long no); // number of com-port connected to your IR-tower m_spirit.SetLinkType(long type); // 0=IR-link, 1=Cable, 2=Radio m_spirit.SetPBrick(long type); (...) (25 years ago, 13-May-00, to lugnet.robotics)

Message is in Reply To:
  Installing SPIRIT.OCX in VC++
 
Does anyone know how to install (to use) the Spirit.ocx in Visual C++? Thanks Giammi & Pongo (25 years ago, 12-May-00, to lugnet.robotics)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
18 hours ago
Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR