|
dudic wrote:
I create ATL component with a number of methods. Some of them run perform long operations, and I need send to client application status of this. How do I have to add event to my ATL and listen it in a client application ?
yeah Buddy,
you have to implement IConnectionPoint Interface in you class to raise event.
Follow these step->
1.add a simpleATL object using Insert|newATlobject
chose Simple Object and press NEXT
you find the Property Sheet there
#1 property sheet for name
Give the name to you object say ObjectEvent.
#2 Attribute
Check the boc for IConnectionPoint interface.
then press ok.
you will see two interface for your class
interface ObjectEvent
dispinterface _IObjectEvent
add method in _IObjectEvent thorough class wizard.
like
void MyEvent();
and implement this Connection point in the iObjectEvnt Interface.
you can get option by right clicking on class of interface.
and for notifying other user about event
you got the Event in you Interface class like this
FIRE_MyEvent()
and by calling this function you can fire event that can be handle by clientapplication.
dudic wrote:
listen it in a client application
sorry i don't have any knowledge about how to handle event in VC++ based application ,because i used to test application with VB.
i hope any good programmer will help you in this matter
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Is it better to write controls in ATL of MFC ActiveX? What are the pros and cons of each?
|
|
|
|
|
As I understand it, ATL was originally designed as a more efficient way of producing these, so I'd go with ATL.
Kevin
|
|
|
|
|
Hi,
Here is the part of the EXE code:
if (FAILED (CoInitialize (NULL)))
{
return FALSE;
}
...
...
HRESULT hr;
IWebBrowser2* pWebBrowser = NULL;
hr = CoCreateInstance (CLSID_InternetExplorer, NULL,
CLSCTX_LOCAL_SERVER, IID_IWebBrowser2,
(LPVOID*)&pWebBrowser);
====> hr is 0x80070005 - Access is denied.
This is happening only with Windows XP/SP2. On the same PC with SP1, it works fine also it works fine on W2K.
Can someone PLEASE help me to solve this issue?
Thanks
SenPy
|
|
|
|
|
|
Hi,
I am trying to navigate to a particular web site and populate the web form fields from my MFC application.
BTW, this code works fine on W2K and XP/SP1.
Regards
SenPy
|
|
|
|
|
I have a problem, I am developing a ATL server/DLL of SQLite Database engine. I have created two COM class, (Connection and Recordset) to I can used how ADO tecnologies, but I haven't install MDAC ...
The problem is in class Recordset. I have MEthod STDMETHODIMP CRecordset::Open(BSTR SelectSQL, IConnection *Connection), because I have not access to public method class C++ CConnection, getHandleDatabase() that return handle to database opened. I have try CComObject<cconnection>* Conexion;
CComObject<cconnection>::CreateInstance(&Conexion);
Conexion->getHandleDatabase();
but handle = NULL ,,,
How I can access object C++ method of interface that pass how parameter 'IConnection *Connection'.
Sorry for my bad english
|
|
|
|
|
How can i check if a CLSID is valid or not without actually creating an object i.e without calling CoCreateInstance
and if CLSIDFromAppID function fails is it necessary that the AppID is wrong
thanks
|
|
|
|
|
You would need to replicate the steps that COM takes when looking for a COM server:- Convert the CLSID to a string
- look for a key with that name under HKCR\CLSID
- look for an InprocServer32 key (or LocalServe32 depending on the server type) key under there
- Read the default value of that key, which holds the full path to the server
- See if that file exists
- For in-proc servers, see if that is a DLL that exports DllGetClassObject().
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Estamos identificando um profissional para atuar em nossa empresa com o seguinte perfil :
Programação em Visual C++ utilizando WTL;
Bons conhecimentos em programação Internet.
Disponibilidade para início imediato.
Os interessados deverão enviar currículo para rh@techway.com.br
Solange Gomes
Solange Gomes
|
|
|
|
|
inglês somente, por favor
--
Suche gut gebauten Achtzehn bis Dreißigjährigen zum Schlachten.
Der Metzgermeister
|
|
|
|
|
I need to wrap a native class for using it in C#
the class contain CString objects.
in old MC++ ver 2003 i write somthing like :
__property String * get_ImageName ()
{
return mBillPopJobParameters-> m_ImageName ;
}
__property void set_ImageName (String * pValue )
{
mBillPopJobParameters-> m_ImageName = pValue;
}
(m_ImageName is a CString.)
and it work ok.
when i try to use it in C++/CLI
property String^ ImageName
{
String^ get()
{
return mPrintSetParameters->m_ImageName ;
}
void set(String^ pValue)
{
mPrintSetParameters-> m_ImageName = pValue;
}
}
i get error that it can not convert from CString to String
any one know how to it right ?
Thanks.
Avraham Cohen.
|
|
|
|
|
Guys,
Newbie question, so bear with me, this is my first Windoze app ..
Part of a caf billing application, I need to lock the PC screen untill a signal is sent by the console/user name-password entered/time code entered ...etc.
I would ideally like to achive this without writing the client as a shell replacement. I had a look at HtmlLayout, and that sounds plausable.
Any ideas/views/directions ..etc ?
Thanks in advance.
Ahmad Ibrahim.
|
|
|
|
|
you can use the someting like a desktop switching like the one made by Nnamdi Onyeyiri [^] but with some minor modifications like remove 2 of the "shells", change the swicthing event to work with remote control... etc ...
I think is the simple way ...
and is .net ...
.NET is the next step to the end of programmer
|
|
|
|
|
Hello everybody,
I want to learn atl. I don't
know anything about atl please
tell me a good link or page about
it.
Best wishes.
thanks.
|
|
|
|
|
I am currently using
Begining ATL 3 COM Programming - by Richard Grimes -- Wrox Publication
I found this book to be good enough for beginning ATL
Hope this helps
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Estamos identificando um profissional para atuar em nossa empresa com o seguinte perfil :
Programação em Visual C++ utilizando WTL;
Bons conhecimentos em programação Internet.
Disponibilidade para início imediato.
Os interessados deverão enviar currículo para rh@techway.com.br
Solange Gomes
|
|
|
|
|
Hi all,
I am trying to convert an existing DCOM component into a web service. I personally find DCOM is great but is of poor interest in a firewall-dominated world. My good old objects have EVENTS, and I exploited them in order to prevent clients from polling the remote application status. Is there anything similar in web service?
Did anyone meet the problem?
Any help will be appreciated.
Thanks a lot in advance.
Best regards,
Andrea
|
|
|
|
|
Hi Andrea,
I was wondering about same thing (What if my objects support events?) when going thro web service Why's and How's
What I found is "Web Service Notification Design Pattern" that sounds something on same track as Events. Check the following search I did on Google -
web service notification[^]
I haven't done any implementation for it because I was just curios to know why and where one should use Web services and not DCOM.
I hope the above link will help you to some extent.
Please let me know if you find anything substantial on this Topic.
Thanks
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|
|
What is the way to give flat look to DateTime control.
Thanks
|
|
|
|
|
Hi All,
I have to implement the collection classes in ATL. I have very little idea about the collection classes.
Could anybody provide me some code snippets which just explains the following thing:
1 - I have an exposed interface IRecord which reperesents a record from a database table.I want to return a collection to myclients(specially VB) which will conatin mutilple Records.Iknow for this I need to define a interface "IRecords" with one property defined as _NewEnum. Als I have to define a iterator class derived from the IEnumVARIANT which will iterate through the class.
2- Implementation of class IRecords with 2 or more functions like AddItem(which will add a Record to the collection).
3 - I want to use the vector as the container for the IRecord.
Please provide the information as soon as possible.
Thanks and Regards
Deepak
|
|
|
|
|
|
Hi Igor,
Thank a lot for your help.It really helped me a lot to understand the basics of the problem.
But if you dont mind I will keep pinging you for any clarification in the program.
I have gone through the code and now I am trying to implement it in my project.As i wil come across the problems I will mail you.
Thanks a ton agin for the help.
Regards
Deepak
|
|
|
|
|
Thanks Igor,
i am also in need for collection type of like this
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello
Please help me with this nasty problem,its appear so easy to solve but i can't.
I try to create an Add-In use standard wizard of VC7(Use C++\ATL property).
One of generated rows from code is:
hr = pCommands->AddNamedCommand(m_pAddInInstance, CComBSTR("MyAddin6"), CComBSTR("MyAddin6"), CComBSTR("Executes the command for MyAddin6"), VARIANT_TRUE, 59, NULL, EnvDTE::vsCommandStatusSupported+EnvDTE::vsCommandStatusEnabled, &pCreatedCommand);
This row add to Tools menu my AddIn when it necessary.Then i simple want to change icon of this AddIn on generic (had IDC_BITMAP1 id).And alter the row on following:
hr = pCommands->AddNamedCommand(m_pAddInInstance, CComBSTR("MyAddin6"), CComBSTR("MyAddin6"), CComBSTR("Executes the command for MyAddin6"), VARIANT_FALSE, IDC_BITMAP1, NULL, EnvDTE::vsCommandStatusSupported+EnvDTE::vsCommandStatusEnabled, &pCreatedCommand);
change VARIANT_TRUE on VARIANT_FALSE and 59 on IDC_BITMAP.
I think it must work bu it didn't.
The menu instead of my picture had nothing.Icon just disappeared.
Please help.
THANK.
|
|
|
|