473,608 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\\s rc\\core\\UMOSE Fax\\Debug\\UMO SEFax.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_m ethod(struct IDispatch *,long,unsigned short,unsigned
short,void *,wchar_t const *,...)" (?
_com_dispatch_m ethod@@YAJPAUID ispatch@@JGGPAX PB_WZZ) referenced in
function "public: short __thiscall IUMOSEFax::AddF ile(class
_bstr_t)" (?AddFile@IUMOS EFax@@QAEFV_bst r_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 6529
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\\s rc\\core\\UMOSE Fax\\Debug\\UMO SEFax.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_m ethod(struct IDispatch *,long,unsigned short,unsigned
short,void *,wchar_t const *,...)" (?
_com_dispatch_m ethod@@YAJPAUID ispatch@@JGGPAX PB_WZZ) referenced in
function "public: short __thiscall IUMOSEFax::AddF ile(class
_bstr_t)" (?AddFile@IUMOS EFax@@QAEFV_bst r_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_remov e_this_and_nos. ..@mvps.org.nos pamwrote:
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\\s rc\\core\\UMOSE Fax\\Debug\\UMO SEFax.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_m ethod(struct IDispatch *,long,unsigned short,unsigned
short,void *,wchar_t const *,...)" (?
_com_dispatch_m ethod@@YAJPAUID ispatch@@JGGPAX PB_WZZ) referenced in
function "public: short __thiscall IUMOSEFax::AddF ile(class
_bstr_t)" (?AddFile@IUMOS EFax@@QAEFV_bst r_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\c ore\umosefaxpri nt\command.cpp( 255) : warning C4101:
'pDispatch' : unreferenced local variable
c:\em2\em\src\c ore\umosefaxpri nt\command.cpp( 254) : warning C4101:
'ppvObj' : unreferenced local variable
c:\em2\em\src\c ore\umosefaxpri nt\command.cpp( 253) : warning C4101:
'm_dwActiveACDI D' : unreferenced local variable
Compiling resources...
Compiling manifest to resources...
Linking...
Starting pass 1
Processed /DEFAULTLIB:uuid .lib
Processed /DEFAULTLIB:coms upp.lib
Processed /DEFAULTLIB:user 32.lib
Processed /DEFAULTLIB:ole3 2.lib
Processed /DEFAULTLIB:olea ut32.lib
Processed /DEFAULTLIB:LIBC MTD
Processed /DEFAULTLIB:OLDN AMES
Searching libraries
Searching C:\Program Files\Microsoft Visual Studio 8\VC\LIB
\comsupp.lib:
Found "void __stdcall _com_issue_erro r(long)" (?
_com_issue_erro r@@YGXJ@Z)
Referenced in command.obj
Loaded comsupp.lib(com supp.obj)
Found "void __stdcall _com_raise_erro r(long,struct IErrorInfo
*)" (?_com_raise_er ror@@YGXJPAUIEr rorInfo@@@Z)
Referenced in comsupp.lib(com supp.obj)
Loaded comsupp.lib(com raise.obj)
Found "long __cdecl _com_invoke_hel per(struct IDispatch
*,long,unsigned short,unsigned short,void *,unsigned short const
*,char *,struct IErrorInfo * *)" (?
_com_invoke_hel per@@YAJPAUIDis patch@@JGGPAXPB GPADPAPAUIError Info@@@Z)
Referenced in comsupp.lib(com supp.obj)
Loaded comsupp.lib(inv kprxy.obj)
Found "long __stdcall _com_handle_exc epinfo(struct tagEXCEPINFO
&,struct IErrorInfo * *)" (?
_com_handle_exc epinfo@@YGJAAUt agEXCEPINFO@@PA PAUIErrorInfo@@ @Z)
Referenced in comsupp.lib(inv kprxy.obj)
Loaded comsupp.lib(inv kerr.obj)
Searching C:\Program Files\Microsoft Visual Studio 8\VC\LIB
\kernel32.lib:
Found __imp__DebugBre ak@0
Referenced in command.obj
Loaded kernel32.lib(KE RNEL32.dll)
Found __imp__CreateFi leW@28
Referenced in command.obj
Loaded kernel32.lib(KE RNEL32.dll)
Found __imp__GetTempF ileNameW@16
Referenced in command.obj
Loaded kernel32.lib(KE RNEL32.dll)
Found __imp__GetTempP athW@8
Referenced in command.obj
Loaded kernel32.lib(KE RNEL32.dll)
Found __imp__Interloc kedDecrement@4
Referenced in command.obj
Referenced in intrface.obj
Loaded kernel32.lib(KE RNEL32.dll)
Found __imp__OutputDe bugStringA@4
Referenced in debug.obj
Loaded kernel32.lib(KE RNEL32.dll)
Found __imp__OutputDe bugStringW@4
Referenced in debug.obj
Loaded kernel32.lib(KE RNEL32.dll)
Found __imp__SetLastE rror@4
Referenced in devmode.obj
Referenced in intrface.obj
Loaded kernel32.lib(KE RNEL32.dll)
Found __imp__Interloc kedIncrement@4
Referenced in intrface.obj
Loaded kernel32.lib(KE RNEL32.dll)
Found __imp__CloseHan dle@4
Referenced in intrface.obj
Loaded kernel32.lib(KE RNEL32.dll)
Found __imp__GetLastE rror@0
Referenced in intrface.obj
Referenced in comsupp.lib(inv kprxy.obj)
Loaded kernel32.lib(KE RNEL32.dll)
Found __imp__WriteFil e@20
Referenced in intrface.obj
Loaded kernel32.lib(KE RNEL32.dll)
Found __imp__LocalFre e@4
Referenced in comsupp.lib(com raise.obj)
Loaded kernel32.lib(KE RNEL32.dll)
Found __imp__lstrlenW @4
Referenced in comsupp.lib(inv kprxy.obj)
Loaded kernel32.lib(KE RNEL32.dll)
Found __IMPORT_DESCRI PTOR_KERNEL32
Referenced in kernel32.lib(KE RNEL32.dll)
Referenced in kernel32.lib(KE RNEL32.dll)
Referenced in kernel32.lib(KE RNEL32.dll)
Referenced in kernel32.lib(KE RNEL32.dll)
Referenced in kernel32.lib(KE RNEL32.dll)
Referenced in kernel32.lib(KE RNEL32.dll)
Referenced in kernel32.lib(KE RNEL32.dll)
Referenced in kernel32.lib(KE RNEL32.dll)
Referenced in kernel32.lib(KE RNEL32.dll)
Referenced in kernel32.lib(KE RNEL32.dll)
Referenced in kernel32.lib(KE RNEL32.dll)
Referenced in kernel32.lib(KE RNEL32.dll)
Referenced in kernel32.lib(KE RNEL32.dll)
Referenced in kernel32.lib(KE RNEL32.dll)
Loaded kernel32.lib(KE RNEL32.dll)
Found __NULL_IMPORT_D ESCRIPTOR
Referenced in kernel32.lib(KE RNEL32.dll)
Loaded kernel32.lib(KE RNEL32.dll)
Found KERNEL32_NULL_T HUNK_DATA
Referenced in kernel32.lib(KE RNEL32.dll)
Loaded kernel32.lib(KE RNEL32.dll)
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSD K
\lib\user32.lib :
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSD K
\lib\gdi32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSD K
\lib\winspool.l ib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSD K
\lib\comdlg32.l ib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSD K
\lib\advapi32.l ib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSD K
\lib\shell32.li b:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSD K
\lib\ole32.lib:
Found __imp__CoUninit ialize@0
Referenced in command.obj
Loaded ole32.lib(ole32 .dll)
Found __imp__CoGetCla ssObject@20
Referenced in command.obj
Loaded ole32.lib(ole32 .dll)
Found __imp__CLSIDFro mProgID@8
Referenced in command.obj
Loaded ole32.lib(ole32 .dll)
Found __imp__CoInitia lize@4
Referenced in command.obj
Loaded ole32.lib(ole32 .dll)
Found __imp__StringFr omGUID2@12
Referenced in intrface.obj
Loaded ole32.lib(ole32 .dll)
Found __IMPORT_DESCRI PTOR_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_THUN K_DATA
Referenced in ole32.lib(ole32 .dll)
Loaded ole32.lib(ole32 .dll)
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSD K
\lib\oleaut32.l ib:
Found __imp__SysAlloc String@4
Referenced in command.obj
Loaded oleaut32.lib(OL EAUT32.dll)
Found __imp__SysFreeS tring@4
Referenced in command.obj
Referenced in comsupp.lib(inv kerr.obj)
Loaded oleaut32.lib(OL EAUT32.dll)
Found __imp__GetError Info@8
Referenced in comsupp.lib(com supp.obj)
Loaded oleaut32.lib(OL EAUT32.dll)
Found __imp__VariantC hangeType@16
Referenced in comsupp.lib(inv kprxy.obj)
Loaded oleaut32.lib(OL EAUT32.dll)
Found __imp__VariantC lear@4
Referenced in comsupp.lib(inv kprxy.obj)
Loaded oleaut32.lib(OL EAUT32.dll)
Found __imp__VariantI nit@4
Referenced in comsupp.lib(inv kprxy.obj)
Loaded oleaut32.lib(OL EAUT32.dll)
Found __imp__SetError Info@8
Referenced in comsupp.lib(inv kprxy.obj)
Loaded oleaut32.lib(OL EAUT32.dll)
Found __imp__CreateEr rorInfo@4
Referenced in comsupp.lib(inv kerr.obj)
Loaded oleaut32.lib(OL EAUT32.dll)
Found __IMPORT_DESCRI PTOR_OLEAUT32
Referenced in oleaut32.lib(OL EAUT32.dll)
Referenced in oleaut32.lib(OL EAUT32.dll)
Referenced in oleaut32.lib(OL EAUT32.dll)
Referenced in oleaut32.lib(OL EAUT32.dll)
Referenced in oleaut32.lib(OL EAUT32.dll)
Referenced in oleaut32.lib(OL EAUT32.dll)
Referenced in oleaut32.lib(OL EAUT32.dll)
Referenced in oleaut32.lib(OL EAUT32.dll)
Loaded oleaut32.lib(OL EAUT32.dll)
Found OLEAUT32_NULL_T HUNK_DATA
Referenced in oleaut32.lib(OL EAUT32.dll)
Loaded oleaut32.lib(OL EAUT32.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_IClassFact ory
Referenced in command.obj
Referenced in intrface.obj
Loaded uuid.lib(unknwn _i.obj)
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSD K
...

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
3071
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 look for the first three chars and import rows into separate tables. E.g. if the first three chars begin with CCC, then this row goes into the CCC_table, if it is TTT then into the TTT_table etc... 2. Once I have my tables built up, I need to do...
3
2297
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 Asp.Net 1.1 / VB.NET. These web sites use Access Databases and NOT Microsoft SQL 2000. In the future I will need to make a few changes now and then to this web sites.
0
3330
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 Microsoft Visual Studio 2005 Software Development Kit. By providing a full help authoring environment within the Visual Studio 2005 SDK, Innovasys is providing developers building components and products that integrate with Visual Studio 2005 a...
2
3424
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
5621
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 Access ? -- Goofy
0
489
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 file has been used for code-signing before (to sign an InfoPath form), so therefore the file contains a valid code-signing key. I have the correct password to the PFX file (because I get a different error
8
6262
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
6050
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 Pervasive ODBC driver. The devenv.exe process hangs and will not respond with about 50% cpu usage and about 100 megs of memory used. I am running it on an Athlon 64 bit dual core with 32 bit Windows XP pro. I have 2 megs of memory so I don't...
1
3588
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 some files and work on it. Let say, I want add new page to web project named websiteOrder.sln, i will open websiteOrder.sln in my local computer, connected to websiteOrder.sln located in Visual Source Safe 6.0(source safe located in another...
0
8063
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8498
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8478
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8152
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8341
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3962
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1598
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.