Hey everyone!
I'm trying to have an IDL interface for a vc++.net .dll so that I can
access it through VB easier. The problem is that when I compile, the
compiler doesn't generate a .tlb file! How can I ge that .tlb file?
Thanks in advance!
-Joel
Here are my linker flags:
/OUT:"Debug/MastController.dll" /INCREMENTAL /NOLOGO /DLL
/DEF:".\MastController.def" /MIDL:@"MastController.odl"
/TLBOUT:"Debug/MastController.tlb" /TLBID:4 /DEBUG
/PDB:"Debug/MastController.pdb" /SUBSYSTEM:WINDOWS
/IMPLIB:"Debug/MastController.lib" /MACHINE:X86
C:\MyProjects\MastControllerLibrary\Lib\nidaq32.li b
C:\MyProjects\MastControllerLibrary\Lib\nidex32.li b
---------------------------------------------------------------------
Here's my code:
AFX_API_EXPORT HRESULT PASCAL Calibrate( HWND hWnd, UINT Msg );
AFX_API_EXPORT HRESULT PASCAL Initialize( LPCTSTR lpszFileName, HWND
hWnd );
AFX_API_EXPORT HRESULT PASCAL MoveAz( HWND hWnd, UINT Msg, INT nAzimuth );
AFX_API_EXPORT HRESULT PASCAL MoveEl( HWND hWnd, UINT Msg, INT nElevation );
AFX_API_EXPORT HRESULT PASCAL Stop( void );
AFX_API_EXPORT HRESULT PASCAL IsAlive( INT & isAlive );
AFX_API_EXPORT HRESULT PASCAL IsMoving(INT & directions);
AFX_API_EXPORT HRESULT PASCAL NotifyOnComplete(HWND hWnd, UINT Msg);
-----------------------------------------------------------------------
And here's my .ODL file
// This is the type library for TLBSamp.dll
[
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),
]
library TLBSample
{
[
helpstring("Control functions exported by MastController.dll"),
version(1.0),
dllname("MastController.dll")
]
module MyDllFunctions
{
[
helpstring("Calibrates the mast hardware."),
entry("Calibrate")
]
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