Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a simple C++ project. It has 1 COM interface with 2 very simple function. Everything compiles fine, but a TLB file is not being generated?? Is there any setting I need to set in Visual Studio? I tried setting the /TLBOUT linker flag but that doesn't do anything.
I tried setting the option for registering the dll, but I get an error that registration failed.
Any ideas ?

C++
class CTestObj : public ITest
{
public:
    void __stdcall Method1 (CString input) {cout<<"Input String: "<<input<<endl;}
    void __stdcall Method2 (int data){cout<<"Input Number: "<<data<<endl;}
};
class  __declspec(uuid("{206C2246-1047-42a2-96EE-0F9FBE776823}"))
                  CTestObj;




Dependency walker is not showing any functions in the resulting DLL. Should I use dll export? Something along the lines of:
C++
Dependency Walker is showing no functions. Do I have to use dll export ??

Should I do something like this ?
<pre lang="c++">__declspec(dllexport) STDMETHOD(Method1) (CString input) = 0;</pre>
Posted
Updated 9-Aug-11 10:13am
v2

1 solution

Seems you are missing a few things. Take a look at this tutorial:
Step by Step COM Tutorial[^]

Best regards
Espen Harlinn
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-Aug-11 21:49pm    
Missing things to be put in place -- my 5.
--SA
Espen Harlinn 10-Aug-11 5:10am    
Thank you, Sergey!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900