473,395 Members | 1,937 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

importing a tlb in Visual Studio 2005

I am trying to import a tlb from a COM server(exe) I wrote with the
following statement:

#import "C:\\em2\\EM\\src\\core\\UMOSEFax\\Debug\\UMOSEFax .tlb"
no_namespace auto_search

the tlh and tli are generated in the debug directory but I get the
following error:

Error 1 error LNK2019: unresolved external symbol "long __cdecl
_com_dispatch_method(struct IDispatch *,long,unsigned short,unsigned
short,void *,wchar_t const *,...)" (?
_com_dispatch_method@@YAJPAUIDispatch@@JGGPAXPB_WZ Z) referenced in
function "public: short __thiscall IUMOSEFax::AddFile(class
_bstr_t)" (?AddFile@IUMOSEFax@@QAEFV_bstr_t@@@Z) command.obj

Is there some linker setting I am missing here? The DLL I am trying
to compile is unmanaged.

Jun 15 '07 #1
4 6510
ku************@gmail.com wrote:
I am trying to import a tlb from a COM server(exe) I wrote with the
following statement:

#import "C:\\em2\\EM\\src\\core\\UMOSEFax\\Debug\\UMOSEFax .tlb"
no_namespace auto_search

the tlh and tli are generated in the debug directory but I get the
following error:

Error 1 error LNK2019: unresolved external symbol "long __cdecl
_com_dispatch_method(struct IDispatch *,long,unsigned short,unsigned
short,void *,wchar_t const *,...)" (?
_com_dispatch_method@@YAJPAUIDispatch@@JGGPAXPB_WZ Z) referenced in
function "public: short __thiscall IUMOSEFax::AddFile(class
_bstr_t)" (?AddFile@IUMOSEFax@@QAEFV_bstr_t@@@Z) command.obj

Is there some linker setting I am missing here? The DLL I am trying
to compile is unmanaged.
It looks like you're missing comsupp.lib from your linker inputs, or
possibly your library path is incorrect so the linker is finding an
incorrect version. I believe that the compiler-generated files
automatically reference the correct library (there are actually 4 different
libraries), so I'd lean towards the lib path being off. Try adding /verbose
to your linker settings to see where (or if!) the linker is finding
comsupp[w][d].lib.

-cd
Jun 15 '07 #2
Jun 15 '07 #3
On Jun 15, 8:19 am, kurt.kurtsm...@gmail.com wrote:
On Jun 15, 7:03 am, "Carl Daniel [VC++ MVP]"

<cpdaniel_remove_this_and_nos...@mvps.org.nospamwr ote:
kurt.kurtsm...@gmail.com wrote:
I am trying to import a tlb from a COM server(exe) I wrote with the
following statement:
#import "C:\\em2\\EM\\src\\core\\UMOSEFax\\Debug\\UMOSEFax .tlb"
no_namespace auto_search
the tlh and tli are generated in the debug directory but I get the
following error:
Error 1 error LNK2019: unresolved external symbol "long __cdecl
_com_dispatch_method(struct IDispatch *,long,unsigned short,unsigned
short,void *,wchar_t const *,...)" (?
_com_dispatch_method@@YAJPAUIDispatch@@JGGPAXPB_WZ Z) referenced in
function "public: short __thiscall IUMOSEFax::AddFile(class
_bstr_t)" (?AddFile@IUMOSEFax@@QAEFV_bstr_t@@@Z) command.obj
Is there some linker setting I am missing here? The DLL I am trying
to compile is unmanaged.
It looks like you're missing comsupp.lib from your linker inputs, or
possibly your library path is incorrect so the linker is finding an
incorrect version. I believe that the compiler-generated files
automatically reference the correct library (there are actually 4 different
libraries), so I'd lean towards the lib path being off. Try adding /verbose
to your linker settings to see where (or if!) the linker is finding
comsupp[w][d].lib.
-cd- Hide quoted text -
- Show quoted text -

Here is the verbose output. I am assuming it is finding the right
comsupp.lib as it finds the 8.0 version?

------ Rebuild All started: Project: UMOSEFaxPrint, Configuration:
Debug Win32 ------
Deleting intermediate and output files for project 'UMOSEFaxPrint',
configuration 'Debug|Win32'
Compiling...
ddihook.cpp
debug.cpp
devmode.cpp
dllentry.cpp
enable.cpp
intrface.cpp
Generating Code...
Compiling...
command.cpp
c:\em2\em\src\core\umosefaxprint\command.cpp(255) : warning C4101:
'pDispatch' : unreferenced local variable
c:\em2\em\src\core\umosefaxprint\command.cpp(254) : warning C4101:
'ppvObj' : unreferenced local variable
c:\em2\em\src\core\umosefaxprint\command.cpp(253) : warning C4101:
'm_dwActiveACDID' : unreferenced local variable
Compiling resources...
Compiling manifest to resources...
Linking...
Starting pass 1
Processed /DEFAULTLIB:uuid.lib
Processed /DEFAULTLIB:comsupp.lib
Processed /DEFAULTLIB:user32.lib
Processed /DEFAULTLIB:ole32.lib
Processed /DEFAULTLIB:oleaut32.lib
Processed /DEFAULTLIB:LIBCMTD
Processed /DEFAULTLIB:OLDNAMES
Searching libraries
Searching C:\Program Files\Microsoft Visual Studio 8\VC\LIB
\comsupp.lib:
Found "void __stdcall _com_issue_error(long)" (?
_com_issue_error@@YGXJ@Z)
Referenced in command.obj
Loaded comsupp.lib(comsupp.obj)
Found "void __stdcall _com_raise_error(long,struct IErrorInfo
*)" (?_com_raise_error@@YGXJPAUIErrorInfo@@@Z)
Referenced in comsupp.lib(comsupp.obj)
Loaded comsupp.lib(comraise.obj)
Found "long __cdecl _com_invoke_helper(struct IDispatch
*,long,unsigned short,unsigned short,void *,unsigned short const
*,char *,struct IErrorInfo * *)" (?
_com_invoke_helper@@YAJPAUIDispatch@@JGGPAXPBGPADP APAUIErrorInfo@@@Z)
Referenced in comsupp.lib(comsupp.obj)
Loaded comsupp.lib(invkprxy.obj)
Found "long __stdcall _com_handle_excepinfo(struct tagEXCEPINFO
&,struct IErrorInfo * *)" (?
_com_handle_excepinfo@@YGJAAUtagEXCEPINFO@@PAPAUIE rrorInfo@@@Z)
Referenced in comsupp.lib(invkprxy.obj)
Loaded comsupp.lib(invkerr.obj)
Searching C:\Program Files\Microsoft Visual Studio 8\VC\LIB
\kernel32.lib:
Found __imp__DebugBreak@0
Referenced in command.obj
Loaded kernel32.lib(KERNEL32.dll)
Found __imp__CreateFileW@28
Referenced in command.obj
Loaded kernel32.lib(KERNEL32.dll)
Found __imp__GetTempFileNameW@16
Referenced in command.obj
Loaded kernel32.lib(KERNEL32.dll)
Found __imp__GetTempPathW@8
Referenced in command.obj
Loaded kernel32.lib(KERNEL32.dll)
Found __imp__InterlockedDecrement@4
Referenced in command.obj
Referenced in intrface.obj
Loaded kernel32.lib(KERNEL32.dll)
Found __imp__OutputDebugStringA@4
Referenced in debug.obj
Loaded kernel32.lib(KERNEL32.dll)
Found __imp__OutputDebugStringW@4
Referenced in debug.obj
Loaded kernel32.lib(KERNEL32.dll)
Found __imp__SetLastError@4
Referenced in devmode.obj
Referenced in intrface.obj
Loaded kernel32.lib(KERNEL32.dll)
Found __imp__InterlockedIncrement@4
Referenced in intrface.obj
Loaded kernel32.lib(KERNEL32.dll)
Found __imp__CloseHandle@4
Referenced in intrface.obj
Loaded kernel32.lib(KERNEL32.dll)
Found __imp__GetLastError@0
Referenced in intrface.obj
Referenced in comsupp.lib(invkprxy.obj)
Loaded kernel32.lib(KERNEL32.dll)
Found __imp__WriteFile@20
Referenced in intrface.obj
Loaded kernel32.lib(KERNEL32.dll)
Found __imp__LocalFree@4
Referenced in comsupp.lib(comraise.obj)
Loaded kernel32.lib(KERNEL32.dll)
Found __imp__lstrlenW@4
Referenced in comsupp.lib(invkprxy.obj)
Loaded kernel32.lib(KERNEL32.dll)
Found __IMPORT_DESCRIPTOR_KERNEL32
Referenced in kernel32.lib(KERNEL32.dll)
Referenced in kernel32.lib(KERNEL32.dll)
Referenced in kernel32.lib(KERNEL32.dll)
Referenced in kernel32.lib(KERNEL32.dll)
Referenced in kernel32.lib(KERNEL32.dll)
Referenced in kernel32.lib(KERNEL32.dll)
Referenced in kernel32.lib(KERNEL32.dll)
Referenced in kernel32.lib(KERNEL32.dll)
Referenced in kernel32.lib(KERNEL32.dll)
Referenced in kernel32.lib(KERNEL32.dll)
Referenced in kernel32.lib(KERNEL32.dll)
Referenced in kernel32.lib(KERNEL32.dll)
Referenced in kernel32.lib(KERNEL32.dll)
Referenced in kernel32.lib(KERNEL32.dll)
Loaded kernel32.lib(KERNEL32.dll)
Found __NULL_IMPORT_DESCRIPTOR
Referenced in kernel32.lib(KERNEL32.dll)
Loaded kernel32.lib(KERNEL32.dll)
Found KERNEL32_NULL_THUNK_DATA
Referenced in kernel32.lib(KERNEL32.dll)
Loaded kernel32.lib(KERNEL32.dll)
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\user32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\gdi32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\winspool.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\comdlg32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\advapi32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\shell32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\ole32.lib:
Found __imp__CoUninitialize@0
Referenced in command.obj
Loaded ole32.lib(ole32.dll)
Found __imp__CoGetClassObject@20
Referenced in command.obj
Loaded ole32.lib(ole32.dll)
Found __imp__CLSIDFromProgID@8
Referenced in command.obj
Loaded ole32.lib(ole32.dll)
Found __imp__CoInitialize@4
Referenced in command.obj
Loaded ole32.lib(ole32.dll)
Found __imp__StringFromGUID2@12
Referenced in intrface.obj
Loaded ole32.lib(ole32.dll)
Found __IMPORT_DESCRIPTOR_ole32
Referenced in ole32.lib(ole32.dll)
Referenced in ole32.lib(ole32.dll)
Referenced in ole32.lib(ole32.dll)
Referenced in ole32.lib(ole32.dll)
Referenced in ole32.lib(ole32.dll)
Loaded ole32.lib(ole32.dll)
Found ole32_NULL_THUNK_DATA
Referenced in ole32.lib(ole32.dll)
Loaded ole32.lib(ole32.dll)
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\oleaut32.lib:
Found __imp__SysAllocString@4
Referenced in command.obj
Loaded oleaut32.lib(OLEAUT32.dll)
Found __imp__SysFreeString@4
Referenced in command.obj
Referenced in comsupp.lib(invkerr.obj)
Loaded oleaut32.lib(OLEAUT32.dll)
Found __imp__GetErrorInfo@8
Referenced in comsupp.lib(comsupp.obj)
Loaded oleaut32.lib(OLEAUT32.dll)
Found __imp__VariantChangeType@16
Referenced in comsupp.lib(invkprxy.obj)
Loaded oleaut32.lib(OLEAUT32.dll)
Found __imp__VariantClear@4
Referenced in comsupp.lib(invkprxy.obj)
Loaded oleaut32.lib(OLEAUT32.dll)
Found __imp__VariantInit@4
Referenced in comsupp.lib(invkprxy.obj)
Loaded oleaut32.lib(OLEAUT32.dll)
Found __imp__SetErrorInfo@8
Referenced in comsupp.lib(invkprxy.obj)
Loaded oleaut32.lib(OLEAUT32.dll)
Found __imp__CreateErrorInfo@4
Referenced in comsupp.lib(invkerr.obj)
Loaded oleaut32.lib(OLEAUT32.dll)
Found __IMPORT_DESCRIPTOR_OLEAUT32
Referenced in oleaut32.lib(OLEAUT32.dll)
Referenced in oleaut32.lib(OLEAUT32.dll)
Referenced in oleaut32.lib(OLEAUT32.dll)
Referenced in oleaut32.lib(OLEAUT32.dll)
Referenced in oleaut32.lib(OLEAUT32.dll)
Referenced in oleaut32.lib(OLEAUT32.dll)
Referenced in oleaut32.lib(OLEAUT32.dll)
Referenced in oleaut32.lib(OLEAUT32.dll)
Loaded oleaut32.lib(OLEAUT32.dll)
Found OLEAUT32_NULL_THUNK_DATA
Referenced in oleaut32.lib(OLEAUT32.dll)
Loaded oleaut32.lib(OLEAUT32.dll)
Searching C:\Program Files\Microsoft Visual Studio 8\VC\LIB
\uuid.lib:
Found _IID_IDispatch
Referenced in command.obj
Loaded uuid.lib(oaidl_i.obj)
Found _IID_IClassFactory
Referenced in command.obj
Referenced in intrface.obj
Loaded uuid.lib(unknwn_i.obj)
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
...

read more »- Hide quoted text -

- Show quoted text -
I am a moron. I just realized I was not linking against the wide
version.

Sorry for wasting your time.
Jun 15 '07 #4
<ku************@gmail.comwrote in message
I just realized I was not linking against the wide version.

Sorry for wasting your time.
Not a problem - we've all been there :)

-cd


Jun 15 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Skc | last post by:
I have a .txt which has been exported as a .csv from an external source. What i need to do is to import this into SQL2000 (into a table) but I need to do special things on the data: 1. I need to...
3
by: Shapper | last post by:
Hello, I am starting 2 new projects to deliver in January 2006. I want to create them in Asp.Net 2.0 using Visual Studio 2005. All my clients web sites are Visual Studio 2003 projects in...
0
by: fiona | last post by:
Innovasys Ltd., a leader in help authoring and documentation tools, today announced the inclusion of a tailored version of the Innovasys HelpStudio help authoring product, HelpStudio Lite, in the...
2
by: Progman | last post by:
I have Visual Studio 2005 Standard edition. Is ti the same thing as the Express edition or Standard is more?
4
by: Goofy | last post by:
The add database ( MDF ) in Visual Studio 2005 seems to be in SQL Server 2005 format as far as I can tell. Does anyone know how I can import tables ( without having to start writing queries ) from...
0
by: Alun Jones | last post by:
I'm getting the above error in a dialog box from Visual Studio 2005 when trying to sign an assembly using a PFX file, and would like to know how to resolve the problem. Background: The PFX...
8
by: WT | last post by:
Is it normal that Visual Studio sets the PreInit handler for a Page from the OnInit code ? No chance to fire it as OnPreInit is run befor OnInit. ??? CS
3
by: Edwin Smith | last post by:
I have a 2 form project in VS2005 that now hangs whenever I try to do anything with the second form. This seems to have started when I added some SQL tables from a Pervasive v.9 database using the...
1
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.