Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2005

Tip: Looking for answers? Try searching our database.

Typelib error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joel Whitehouse - 06 Jul 2005 21:11 GMT
Hey guys, I was trying to add typelib functionality to a VS2003
multithreaded .dll that I'm writing.

I read some instructions on how to do this, so I created a .odl file and
added it to the project.  I didn't see an option for adding a .odl file
like there's an option for adding a .cpp file, but I did it anyway, and
I keep getting this error:

c:\MyProjects\MastControllerLibrary\MastController\MastController.odl(33):
error MIDL2025 : syntax error : expecting ; near "Calibrate"

Here's my Mastcontroller.odl file:

// This is the type library for TLBSamp.dll
      [
      // Use GUIDGEN.EXE to create the UUID that uniquely identifies
      // this library on the user's system. NOTE: This must be done!!
         uuid(8926D077-00E3-4170-96C9-6F52F672E8B4),
      // This helpstring defines how the library will appear in the
      // References dialog of VB.
         helpstring("Rotor control library"),
      // Assume standard English locale.
         lcid(0x0409),
      // Assign a version number to keep track of changes.
         version(1.0)
      ]
      library TLBSample
      {

      // Now define the module that will "declare" your C functions.
      [
         helpstring("Control functions exported by MastController.dll"),
         version(1.0),
      // Give the name of your DLL here.
         dllname("MastController.dll")
      ]
      module MyDllFunctions
      {

        [
            helpstring("Calibrates the mast hardware."),
            entry("Calibrate")
        ]
    //Error occurs on the following line:
        HRESULT PASCAL Calibrate( [in] HWND hWnd, [in] UINT Msg );
        [
            helpstring("Initializes the control software's access to
the test hardware."),
            entry("Initialize")
        ]
        HRESULT PASCAL Initialize( [in] LPCTSTR lpszFileName, [in] HWND hWnd  );
        [
            helpstring("Move's the azimuth rotor."),
            entry("MoveAz")
        ]
        HRESULT PASCAL MoveAz( [in] HWND hWnd, [in] UINT Msg, [in] INT nAzimuth );
        [
            helpstring("Moves the elevation rotor."),
            entry("MoveEl")
        ]
        HRESULT PASCAL MoveEl( [in] HWND hWnd, [in] UINT Msg, [in] INT
nElevation );
        [
            helpstring("Stops the rotors."),
            entry("Stop")
        ]
        HRESULT PASCAL Stop( void );
        [
            helpstring("Returns the state of the external hardware."),
            entry("IsAlive")
        ]
        HRESULT PASCAL IsAlive( [in, out] INT & isAlive );
        [
            helpstring("Returns the state of the external hardware."),
            entry("IsMoving")
        ]
        HRESULT PASCAL IsMoving( [in, out] INT & directions);
        [
            helpstring("Calibrates the mast hardware."),
            entry("Calibrate")
        ]
        HRESULT PASCAL NotifyOnComplete([in]  HWND hWnd, [in] UINT Msg);

      } // End of Module
      }; // End of Library

What am I doing wrong?  Is there some other way I should add a .odl to
my project to make the work?

-Joel
Steve Alpert - 07 Jul 2005 17:32 GMT
How do you expect it to know about HWND?  Most of the work I have done is with
IDL files and they have an include (like ocidl.idl) at the top.

/steveA

> Hey guys, I was trying to add typelib functionality to a VS2003
> multithreaded .dll that I'm writing.
[quoted text clipped - 6 lines]
> c:\MyProjects\MastControllerLibrary\MastController\MastController.odl(33):
> error MIDL2025 : syntax error : expecting ; near "Calibrate"

    ...[stuff deleted]...
Signature

Steve Alpert
my email Fgrir_Nycreg @ vqk.pbz is encrypted with ROT13 (www.rot13.org) and spaces


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.