|
Hi,
I want to develop GUI-based plugin for Win32 IDE, like I want to add a menu item to VC++ IDE. I m a amateur in COM & ATL programming, but I suppose I can use COM & ATL to create GUI plugin for VC++ editor. Please suggest/help/direct/guide me for same?
- Manish
|
|
|
|
|
hello,
i use the ATl write a word2000 addin,and add a button into the word toolbars,and now i want to add a picture into the word document when i hit the button,this picture can be a bmp or jpeg.after i insert the picture i can drag it to a proper location.
i tried a long time,but in vain,who can help me?
|
|
|
|
|
Hello Friends,
What is the difference between ActiveX Component and COM Component?
Neelesh K J Jain.
|
|
|
|
|
They are one and the same thing! You probably wanted to ask this:
What is the difference between ActiveX Control and COM Component?
A Control is a COM object with a set of standard interfaces as defined by COM standard for a Control. If a COM object supports all the required interfaces as defined by Microsoft for a Control, then it is a Control.
|
|
|
|
|
I am trying to load this dll in my VC++/MFC class using COM. However, it generates error in the generated .tlh file. This is what i did. I import the dll in stdafx.h and insert the following on a button control.
HRESULT hresult;
CLSID clsid;
CoInitialize(NULL); //initialize COM library
hresult=CLSIDFromProgID(OLESTR("Techno.Servo"), &clsid); //retrieve CLSID of component
_Servo *t;
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(_Servo),(LPVOID *) &t);
if(FAILED(hresult))
{
AfxMessageBox("Creation Failed");
return;
}
t->MOVE(); //call method
t->Release(); //call method
CoUninitialize(); //Unintialize the COM library
Can anyone please tell me where the error is?
|
|
|
|
|
I am having a simple COM object (COM wrapper) in C#. I register the object for COM Interop by using regasm and gacutil /i (.Net Command Prompt).
I am able to call my COM object from classic COM capable applications.
My question is if I want to update my COM object, it seems to me that I have to reboot my machine before the updated COM object works. If I don't reboot the machine, the COM capable applications still reference my old COM object. Is there a way to update COM object (COM wrapper) without restart the machine?
Note: I can not use Cofiguration Properties->Register for COM Interop (VS.NET 2003) because I need to deploy my COM object to my production server.
Any suggestion will be appreciated.
|
|
|
|
|
Are you un-registering and removing the old com wrapper from the GAC first? (gacutil /u , regasm /u)? Note that if there are outstanding references gacutil /u will fail and echo the reference count.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
This is what I did for register my new version of COM wrapper.
1. gacutil /u xxx
2. delete the dll and tlb files on one location. (Note: most of the time, windows won't allow me to delete the tlb file, so tlb file couldn't updated. Therefore, I will create a new directory, and register in the new directory)
3. regasm xxx.dll /tlb:xxx.tlb
4. gacutil /i xxx.dll
I check the GAC, etc. Every things updated. But when I use SQL Server, TSQL to access my COM wrapper, the COM wrapper is not my new version.
One question is do I have to use regasm /u also??
Thank YOu for your reply.
|
|
|
|
|
hchiu wrote:
One question is do I have to use regasm /u also??
if you are changing the type library, yes.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
Actually I need to stop the SQL server in order to update my COM wrapper.
Therefore, everythings work now.
|
|
|
|
|
Hello
I am using an ActiveX component in my web page, it all works fine localy on my machine, but when I put my code on a server and access it from a client the ActiveX dosent load. All I get is an error saying "ActiveX Component Can't Creat Object".
What do I have to change to make my solution work on the server
Spaz
|
|
|
|
|
hi,
I have a set of avi files how I can I read one avi and write the video and audio assoiated with that avi to another new avi(to be created).
and also let me know how to join to avi,s in c++(vc++/borland c++)
regards
shaan
se
|
|
|
|
|
Hi ,
I need to show only selected activeX controls in a list box of a dialog.
Are there any API's to do so. I came across some demo applications which show all registered MFC activeX controls but not the one which shows only user-defined.
Is there any way out ?
|
|
|
|
|
Hi,
I am trying with a program that will create an ActiveDesktop using IActiveDesktop. I want to manipulate the buttons on ActiveDesktop which is intented to manipulate the state of the ActiveDesktop as IS_NORMAL, IS_FULLSCREEN, IS_SPLIT. Is there any option for doing it programically?
Waiting your responses
Vinod
|
|
|
|
|
I want to create a group of COM+ objects and put into system pool so that:
It can access objects by name(or index) from different processes in same server along with availability to access from another machine on network. The object state will be remembered during calls.
Hope there is a solution for this. Appreciate your help in advance!
|
|
|
|
|
Hi folks!
I need to create a DCOM Server to manage multiple objects (hardware driver wrappers).
I Created DCOM Server with object classes and methods declaration, but I wanted to envelope every object in a separate DLL, to be modular. (just to make things easier if I wanna change a board, i.e.)
Now, I created a Win32 DLL (I do not need COM support, while I'm just implementing functions) but I need to get by parameter the effective class of my COM object. I tried that by including the object H file with class declaration, but it tells me that ATL_NO_VTABLE cannot be understood.
What can I do? Did I reason well? Or I need a COM DLL anyway?
Thanks a lot for now,
Morenz
|
|
|
|
|
Hi,
I'm not sure what are you trying to achieve. I assume, that you have some DCOM object, exposing a set of functions, these being implemented in different .dlls, that can be dynamically loaded from your object. Problem is, that one of the parameters to these functions implemented in .dlls should be a pointer to the DCOM object that calls them. Is that right?
I think you need to include the ATL headers into your dlls as well, to have defined the ATL macro ATL_NO_VTABLE . This will not change your .dlls to COM dlls (they will not require the registration)
There's also another problem with the ALT objects. There's an interesting twist, because of IUnknown implementation. To keep it short, simply your ATL object is not really the object being constructed. If I assume your object name is CMyObject then the object constructed is in fact CComObject<CMyObject> . So to stay on the safe side, your parameter should not be only CMyClass& , but CComObject<CMyClass>& (or pointer if you prefer)
Anyway, safest way would be to export some sort of interface from the DCOM object, that these dlls will use to communicate. Then you can take the declaration of the interface from the header file generated by MIDL and use it in the .dlls. (filename is usually projectname.h )
Hope this helps
|
|
|
|
|
First of all thanx a lot,
then... it's right what you say (about project architecure) but if I try to only #import my MIDL result (thats .TLB, not .h, I think) in my DLL, I have the error on ATL_NO_VTABLE. Do I have to #import all .idl files in my DLL? Or creating my CComObject<cmyclass>& can work well?
Thanx a lot again, I'm neither a COM nor a DLL expert (my last COM written was about in 1998... my last DLL in 1997...)
Best regards,
Morenz
|
|
|
|
|
hm, as I could understand the ATL_NO_VTABLE problem, when you're including the object.h file, the code generated with #import never contain the ATL macros. You probably forgot to remove the object.h include.
I always used #import "blahblah.tlb" no_namespace named_guids for including COM objects to my projects. Problem is, that this doesn't import the object as-is from the C++ point of view. It defines all interfaces the object is derived from and all Guids required for the object - Guids of interfaces and of the object itself. If you look into your debug (or release) directory, you'll see object.tlh and object.tli (optional), that contains code generated by the #import .
Well, when you have the interfaces imported, you can use one of them as a controlling interface. General interface is IUnknown . From this you can QueryInterface to get any other interface exported by the object.
The CComObject thing is when you decide not to import interfaces, but the C++ object definition.
The method I would choose depends on what you want to achieve, but generally I'd prefer to
a) create a special interface for controlling the DCOM object, passed to the .dlls
b) create a third c++ object, that is included in the DCOM as well as in the .dlls. It's purpose is only for exchanging the information - the DCOM object creates one instance and passes it to all calls to the .dlls. Or even considering the implementation to be in the C++ object and only calls from outside will be proxied through the DCOM object.
Then the DCOM object will be only very thin wrapper - generally only thing it will does will be to create the third object (or derive from) and then simply proxy all calls from DCOM to the C++ object. I hope the explanation is clear, here's 7:00 morning
The a) and b) are more or less equal, the a) is more COMish, while the b) is more C++ish.
|
|
|
|
|
Yeah, I know what you meant, it was 7.00 here, too!
I read this only now, and tomorrow I will give it a shot.
I 'll make you know.
For now, many thanks.
|
|
|
|
|
Hi,
I have a COM object that exports a couple of interfaces and some enums. I need to access this from JScript, and everything works expect for the enums.
Here's the idl file:
in myCOM.dll
typedef [uuid(someIDHere.....)] enum tagEnum
{
a = 0xFFF,
b = 0,
c = 1,
}enumType;
[
object,
uuid(..................),
dual,
helpstring("IMyInterface"),
pointer_default(unique)
]
interface IMyInterface : IDispatch
{
[id(1), helpstring("test")] HRESULT Test();
};
[
uuid(E0691460-B804-11D5-ADF6-00C04F029739),
version(1.0),
helpstring("MyCOM 1.0 Type Library")
]
library MyCOMLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(....................),
helpstring("MyCOM Class")
]
coclass MyInterface
{
[default] interface IMyInterface;
};
};
The JScript code looks something like this:
var mycom = WScript.CreateObject("MyCom.MyInterface");
mycom.Test();
etc.
I tried to access the methods and the enum from VB and it works fine. So there's nothing wrong with myCOM.
How can I access the enum from JScript?
Thanks!
|
|
|
|
|
My DCOM program works in a local network,
but if connect to some computer via VPN,
DCOM is not working ,
what is the reason ?
If this is a security - which settings I must configure,
that VPN become true transparent for DCOM ?
thanks you.
|
|
|
|
|
Hi,
I developed application for handling incoming call using Tapi 3.0 (COM base)
now i want to convert that application in to DLL. but i don't know how to
create COM DLL. because in that application i used COM interface.
I will use that DLL in VB. but i don't how to create DLL .
Please help me.
if anyone knows, send me source code for that.
waithing for +ve reply
Regards,
Riya jain
|
|
|
|
|
Usually you can not convert exe to DLL,
but it is usually fast to create new COM DLL envelope
using (your language VB or C++) application wizard,
- create there new interface with same methods and transfer code to it.
It is suitable for all.
- or if your more experienced,
when created new DLL - transfer just COM to it, if you know how to it for VB.
- or - ugly solution -create new DLL that makes simple one COM method,
that return interface pointer IDispatch*
with it create your EXE COM and return interface - each time you call this method for DLL,
exe COM will be created and returned - and will use as if it is placed in DLL.
This method is good when you already created complexsolution and do not whant rewrite
COM interfaces and transfer code - but use tested EXE unit as fast as possible.
|
|
|
|
|
Hi,
I am also new to COM and I manage to create my 1st DLL from this article.
http://www.codeproject.com/atl/SimpleATLCom.asp
Hope it is useful to you.
Regards
w_logan
|
|
|
|
|