|
|
look at api starting with Net*
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Hello everyone,
Two questions about COM tlb file,
1. I am wondering what are the content of COM tlb file? I think it should be something like import library file (.lib) for a DLL which contains address and signature of exported functions.
2. Why for C# COM client, tlb file is not needed? Why for C/C++ (native) client, tlb file is needed?
thanks in advance,
George
|
|
|
|
|
George_George wrote: 1. I am wondering what are the content of COM tlb file? I think it should be something like import library file (.lib) for a DLL which contains address and signature of exported functions.
you are somewhat right, yes it contain the decalartion of interface and related constant and enum. which vc++ compiler read to generate equivalent tlb and tlh files.
George_George wrote: Why for C# COM client, tlb file is not needed? Why for C/C++ (native) client, tlb file is needed?
it not necessary to have tlb file even in vc++(native) to use com component, you can directly import com dll or add Header File geenrated by actual com workspace .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Thanks ThatsAlok,
ThatsAlok wrote: it not necessary to have tlb file even in vc++(native) to use com component, you can directly import com dll or add Header File geenrated by actual com workspace .
If I have a C++ client and a C# COM component. Without a tlb file, how could the C++ client utilizing the C# COM component? I do not think it could be achieved by using header file, since C# does not have any header files.
For managed C++ client, we could import DLL directly, but for unmanaged C++ client, how could we utilize C# COM interfaces/classes without a tlb?
regards,
George
|
|
|
|
|
George_George wrote: For managed C++ client, we could import DLL directly, but for unmanaged C++ client, how could we utilize C# COM interfaces/classes without a tlb?
since c# com component deploy managed stuff, i believe might be you are not able to use it in c++ native.. but by the way... what C# dll is COM Server Exe or DLL
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Thanks ThatsAlok,
I have tested that we could invoke C# (COM) function from C++ unmanaged code.
regards,
George
|
|
|
|
|
George_George wrote: I have tested that we could invoke C# (COM) function from C++ unmanaged code.
I don't have much Experience in InterOpr!, but just want know what C~ compiler is producing, is it dll or exe
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Hi ThatsAlok,
I am using C++ unmanaged native exe and C# COM server.
regards,
George
|
|
|
|
|
George_George wrote: I am using C++ unmanaged native exe and C# COM server.
try #import "Path to application with app name"
and see if any .tlh and .tli file generated
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Hi ThatsAlok,
I have found there is no .tlh and .tli generated in C# COM server project. Do you know how to make then generated?
regards,
George
|
|
|
|
|
George_George wrote: I have found there is no .tlh and .tli generated in C# COM server project. Do you know how to make then generated?
look if this help How to call a COM C# component from VC++?[^]..
and by the way the original name is Alok
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Thanks ThatsAlok, good resource!
regards,
George
|
|
|
|
|
George_George wrote: If I have a C++ client and a C# COM component. Without a tlb file, how could the C++ client utilizing the C# COM component?
Because the C# COM component implements IDispatch among other interfaces. With this one you have an automatized component, and you don't need to know the name of the method invoked, only their number (1, 2, 3, etc) which can be found in the extra information of the component, defined with IDL language.
|
|
|
|
|
Thanks Fernando,
In my C# COM Server project, no IDL file is generated, do you know how to generate it?
regards,
George
|
|
|
|
|
|
Thanks shouvik!
I think only containing interface information is not enough. I think it should also contain the CLSID (implementation class guid of the interface) information, right?
Or else, in client program, how could we know and pass both the IID and CLSID information to QueryInterface?
regards,
George
|
|
|
|
|
Might be they have some wrap over class informations written within the COM component. I actually am more like a novice when it comes to COM. Please forgive me
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
Thanks all the same shouvik! Do you have any recommendations for learning resources?
regards,
George
|
|
|
|
|
|
Thanks shouvik, great links!
regards,
George
|
|
|
|
|
#include <iostream>
using namespace std;
int reduce(int n,int m)
{for (m=2;m<n;m++)
(if (n%m="=0)
cout<<m<<endl;
return" n="" m;)
(if="" (n="=m)
cout<<m<<endl;
return" m;)
}
int="" main()
{="" int="" n,m;
cout<<"please="" write="" a="" number:"<<endl;
cin="">>n;
reduce(n,m);
return 0;
} what is wrong with my cade?who can perfect it for me?
|
|
|
|
|
can you give us the intent of the code?
i.e. what do you WANT it to do?
bryce
|
|
|
|
|
thank you for your enlisting,although i have figured out it,but i will give more explanation to the problem next time
|
|
|
|
|
Hi everyone,
I am beginner and I don't know the difference between
cout<
|
|
|
|