Typelib error

  • Thread starter Joel Whitehouse
  • Start date
J

Joel Whitehouse

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
 
S

Steve Alpert

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

Joel said:
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"

...[stuff deleted]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top