|
As the subject states, I have a COM object (dll) and I need to convert this to an ActiveX control. Is this a simple task, that is, do I just need to make a few changes to "adapt" it, or will this require a lot of menial work creating all of the methods and classes using the Class Wizard.
Thanks in advance for any advice
|
|
|
|
|
Usually it depends to how many functionalities (i.e. interfaces) your control will expose (loosely speaking, during last years, Microsoft relaxed a lot the minimal requirements of an ActiveX ). IMHO the simplest way is the following:
(1) use the wizard (either the MFC or the ATL one) to build up the ActiveX control skeleton.
(2) add your object code to such skeleton.
Hope that helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks, I'll play around with this and see what happens.
To date - all attempts at "moving" things into my new ActiveX control, seem to confuse the Class wizard. As far as I can tell, the Class Wizard prefers doing things on its own and doesn't like anyone else mucking around with the project. Maybe I'm wrong.
|
|
|
|
|
Maybe you have to 'interfere' as little as possible with the Wizard (i.e. define the interface using the Wizard and then add your object code to the methods skeleton).
BTW are you using MFC or ATL (The latter gives you more flexibility...)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I started out creating an ActiveX control with MFC. After a few hours and several broken pieces of office furniture that happened to be nearby, I tried with ATL. ATL seems to give me results that are closer to what I want, but I still can't seem to convince the Wizards to recognize the classes that I copied and added to my new project.
So far I must have created/deleted projects at least 20 time (I'm sure it's more). Although I seem to be learning in the process - why do I feel even stupider than when I started?
Thanks for your help.
|
|
|
|
|
Hello everyone:
i write a win32 c++ program,then i add ATL OLE DB consumer in my project.now i need the function that when the SQL database's data change,my main program's window can refresh view.so i refer to msnd:
==========================================================================
Visual C++
Receiving Notifications
OLE DB provides interfaces for receiving notifications when events occur. These are described in OLE DB Object Notifications in the OLE DB Programmer's Reference. Setup of these events uses the standard COM connection-point mechanism. For example, an ATL object that wants to retrieve events through IRowsetNotify implements the IRowsetNotify interface by adding IRowsetNotify to the class-derived list and exposing it through a COM_INTERFACE_ENTRY macro.
IRowsetNotify has three methods, which can be called at various times. If you want to respond to only one of these methods, you can use the IRowsetNotifyImpl class, which returns E_NOTIMPL for the methods you are not interested in.
When you create the rowset, you must tell the provider that you want the returned rowset object to support IConnectionPointContainer, which is needed to set up the notification.
The following code shows how to open the rowset from an ATL object and use the AtlAdvise function to set up the notification sink. AtlAdvise returns a cookie that is used when you call AtlUnadvise.
---------------------------------------------------
CDBPropSet propset(DBPROPSET_ROWSET);
propset.AddProperty(DBPROP_IConnectionPointContainer, true);
product.Open(session, _T("Products"), &propset);
AtlAdvise(product.m_spRowset, GetUnknown(), IID_IRowsetNotify, &m_dwCookie);
============================================================================
the code is so little that i don't know how to implement in my code,did anyone can help me?
thanks a lot!
|
|
|
|
|
Hi,
I want to implement to get DOM object directly from c# to c++. I have wrapped a com object in c#. In the interface, I want to return XMLDocument object and get it in c++. Which way can I use to implement it?
Thanks,
Dave
|
|
|
|
|
Hi all,
I want to learn how to write COM component in VC++ 6.0
Anybody please send the links to the material from where a beginner
can start reading the concept and the related examples.
I also want to know the books available on this subject with Title and author's name.
Thanks in Advance to all.
Viral Joshi
|
|
|
|
|
viral_umang@hotmail.com wrote: please send the links to the material from where a beginner
can start reading the concept and the related examples.
CodeProject[^]
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hello,
COM+ Programming: A Practical Guide Using Visual C++ and ATL (With CD-ROM) by Pradeep Tapadiya
is much better.
Regrads
|
|
|
|
|
Code project has good articles - basic and advanced.
Also, I have few links on my blog. See if this helps -
http://blogs.wdevs.com/sohail/archive/2004/11/16/1149.aspx
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
|
This link will be very helpfull to understand basics of COM , ie COM from scratch.
http://www.codeproject.com/com/com_in_c1.asp
http://www.codeproject.com/com/com_in_c2.asp
Thanks
George
|
|
|
|
|
Hi all,
I need to transfer all data in RTF format from native MS Word format. The best thing that i did is to open DOC in MS Word and save it RTF format. But the problem that it's taking so long. I tried to make call Copy to selection and then paste it somewhere, it's working very fast, but the problem that it's messing up a clipboard. Can someone help me with such problem?
Maybe there is a way to transfer data directly from Word to my app. like DDE or something?
Please post your comments. It's very urgent.
Thanx.
|
|
|
|
|
Can i know what is meant by 'its messing the clipboard' so that if
can clearly loook into your issue.
|
|
|
|
|
hi guys,
this is very important please help me i'm doing win32 application on .net 2003 but i'm getting the following error
Message error LNK2001: unresolved external symbol "public: static unsigned char * Funcs::calc_func::mac" (?mac@calc_func@Funcs@@2PAEA)
for many variables i found threads on this subject on net but nothing solve my problem
please i'll appreciate any suggestions
emma
|
|
|
|
|
Thanks a lot ur right but i didn't know how should i declare it.
But it works now when i declare them in thye cpp file as
unsigned char Funcs::calc_func::X[3];
thanks a lot and i appreciate ur help.
U know what i'm new working with dlls and i would like to know how can i use it by another program coz i don't want to include my code that's why i transfered my application into dll.
Thanks in advance
-- modified at 7:24 Wednesday 25th April, 2007
emma
|
|
|
|
|
Hi
I understand that using IDispatch a COM object exposes the functionality. But is it necesary for all the COM objects to use IDispatch?
Thanks in advance
|
|
|
|
|
IDispatch using only for automation. It is necesary for all the COM objects to use IUnknown
Best regards,
Baron
|
|
|
|
|
The IDispatch supports that the script and binnary can access,but Iunknown only supports binnary.
if your com object is only accessed by binnary,you use IUnknown.
fsa
|
|
|
|
|
You need to derive your interfaces from IDispatch if you want to access the COMponents from scripting clients like VBScript..
Cheers,
Suresh
|
|
|
|
|
HI,
I'm building COM obejct in C++ and using it in C# and I can't figure out which type in C++ coresponds to bool type in C#. If I use bool in C++ , I allways get "expecting a type specification near "bool" " error. I tried boolean or BOOL , but any of them corresponds to bool in C# (after COM object is wrapped in .NET VS)
Do you have anty idea how what to use?
|
|
|
|
|
Zilo(svk) wrote: I can't figure out which type in C++ coresponds to bool type in C#.
It is BOOL .
Prasad
MS MVP - VC++
|
|
|
|
|
BOOL(C++) corresponds to int(C#)
|
|
|
|
|
Zilo(svk) wrote: BOOL(C++) corresponds to int(C#)
Use VARIANT_BOOL instead.
Prasad
MS MVP - VC++
|
|
|
|