|
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++
|
|
|
|
|
thanx
that's what I needed
|
|
|
|
|
I am working in a COM project where i need to communicate with Mainframes (CICS) for storing and retrieving data. So i want information about this problem like how to communicate or is there any interface useful for this situation?
|
|
|
|
|
I require a software component to be added to an existing .net application(web based). The coponent or the software should posses the following features:
1. It should provide PC to Phone integration either on VOIP technology or TAPI or both.
2. It should provide automated phone dialing from phone number lists.
3. Transfer calls to other users internally.
4. Record conversations and provide automated call reports and statistics.
5. Every phone number in the system should be automatically clickable and the call details must be logged to that user.
6. The phone call must be recorded and stored as a sound file.
Can anyone help me to find any freewares or commercial products available in the market which can provide me the above features.
Thanks in Advance
----------------------------------
where there is a will there is a way
|
|
|
|
|
Hi
I am writing two interfaces in two separate DLLs. The interfaces are named IID_Draw and IID_Draw, but I associate a unqiue GUID with each of the interfaces. Now when I create an interface pointer of the IID_Draw of the 1st DLL, how COM resolves this kind of calls.
|
|
|
|
|
- IID_DRAW is a constant you define in your code. The value of this constant is a unique GUID
- Now looking at your question, I believe you have got these constants defined either by wizard or #import or something similar.
If this is the case, then you have to resolve this ambiguity by explicitly specifiying the namespace (it has nothing to do with COM runtime, it's more about how you code the wrapper classes or constants).
For example if you have done #import <dll or="" tlb=""> in your code, then check the generated .TLH file. You will find namespace here.
I hope this helps.
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.
|
|
|
|