|
Hi,
I created a atl com dll (full control) that consists of a simple object "a". I tried to fire events from the simple object "a" to the full control but I noticed that the full control did not receive the events. However, when I tried to created a new simple object with a sink interface within the ful control, it manage to receive the events fired from the simple object "a".
Why. What should I did in order for the full control to receive the events.
I call
HRESULT hr = AtlAdvise(mp_Mixer, this->GetUnknown(),DIID__IMixerCtrlEvents, &m_dwCookieMixerCtrl);
and hr return "0".
|
|
|
|
|
Hi,
You have to implement the sink in the client to be able to advise for the events. Check the arctile from MSDN ID:Q181277 "SAMPLE: AtlSink Uses ATL to Create a Dispinterface Sink" for more details...
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Hi,
I am developing a COM component in VC++. I am deploying the component in MTS. I am using SQl Server 7.0 as my database.Also using ADO recordset and stored procedures.After deploying the component in MTS and run my client, I am getting the following error.Anybody can pls help me in this regard.
Error:
07-29-2000--19:46:56-Component CContactDB::GetAllContacts:-2146824584 :Unknown error 0x800A0E78! ADODB.Recordset! The operation requested by the application is not allowed if the object is closed.ÍýýýýÝ
GetAllContacts is my own function which will retrieve some info based on a query.
Kindly get back to me ASAP.
Thanks in advance.
Regds
guru
|
|
|
|
|
Hi
Your problem is quite a common one in MTS. the problem may be because you are using a transactional component and the recordset is getting closed before you can access it. You must remember that MTS normally deactivates a component after every method call(thus the expression stateless objects)in which you Complete a transaction. What you must do is to ensure that your state is maintained for as long as you want. Thus the best way would be to use the DisableCommit of the IObjectContext interface at an appropriate place like for example in your IObjectControl::Activate method. This ensures that no transactions are completed until you specify a SetComplete on your IObjectContext method. I would advise making a method which does this SetComplete. Putting cleanup code in FinalRelease of your component is tricky because you cannot know how many times MTS will activate and deactivate your object. rather it is better to either make a cleanup function of your own or use the Deactivate method of IObjectControl.
I hope this helps to solve your problem. If not then email me and I can give you some sample code. I am even mailing you a copy of this suggestion.
|
|
|
|
|
I'm writing a VB program that interfaces with another application. As long as a use GetObject("","ormec.mdesk.app") all works as expected and a new app is started. The problem is that I do not wish for a new app to be started. GetObject(,"ormec.mdesk.app") should work and return the current instance, but instead it returns error 429 even when the other program is running.
Most likely this is a problem somewhere in the server code, but I was hoping that maybe someone has had a similar problem and could give me some advice.
|
|
|
|
|
How do I develop a solution to enable spell checking on a text box using Win 32 SDK.
Looking for a ideal solution.
Thanks
Siva
|
|
|
|
|
How do I develop a solution to enable spell checking on a text box using Win 32 SDK.
Looking for a ideal solution.
Thanks
Siva
|
|
|
|
|
Hello:
I'm developing a Server ATL component wich supports conneccion points. The client side is an MFC dialog based application. I sometimes need for the server advise to client. I've used the 'AfxConnectionAdvise' MFC global function to do it.
If I start the server (an executable server type) before the client the AfxConnectionAdvise function returns 'true' and there is no problem, but if the server is started by DCOM system (when I start the client) then the AfxConnectionAdvise function returns 'false'. ¿What can I do to solve this problem?
Thanks in advance,
Jose.
|
|
|
|
|
Hi,
You can't fire events through the DCOM!
This feature is avalable in COM+ only...
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Yes. I can fire events through the DCOM when the server is launched before the client. But if the server is launched remotely by the client, I cannot establish the connection between them.
|
|
|
|
|
"If the server is launched remotely by the client, I cannot establish the connection between them."
Jose,
Look soon for a tutorial I wrote, implementing a DCOM server and client with the full support for everything, including making the server a Service, which in your case would solve your problems.
However, you don't have a service, you have an EXE. Here's what to do:
1. Click the Start button, and then click Run.
2. Type 'dcomcnfg' in the box.
3. Search in the list for the name you gave your server project (say 'EventSvr'). Double-click it.
4. Go to Identity. Click 'This user,' and type in the Administrator username and the Administrator password, if you know it. If you don't then ask your sysadmin.
Voila! Hope it works
Cheers,
Brian
|
|
|
|
|
"You can't fire events through the DCOM"
Wrong wrong wrong. I have written working code on this, and I have almost completed posting a full tutorial on The Code Project (at http://www.codeproject.com/useritems/HelloTutorial1.asp) on this very thing!
Beware; the tutorial is un-edited yet and is still incomplete, but hang with me and you shall see the light
It's amazing what one thinks is impossible until one tries...
Brian Hart
|
|
|
|
|
I've created a Edit Control as a child window of a IE Band Object.
But some keys are not functioning ( Like Backspace etc.,) when executed.
Any solutions please
Siva
|
|
|
|
|
I'm using Delphi to create an ISAPI Extension. I I'm creating a COM object and the ISAPI freezes is there anything special that needs to be done?
|
|
|
|
|
Hi,
It's important to Initialize COM library for each ISAPI thread. You should initialize COM libray in GetExtensionVersion entry-function and uninitialize it in TerminateExtension enty-function.
Erik
|
|
|
|
|
Hi,
I want to put a CDialog Derived Class in a ATL COM DLL Server without MFC Support(ie. MFC Support Unchecked).I am getting a crash in DoModal().When i debugged the code, AfxGetInstanceHandle was returning NULL and there was an assertion at this point.I verified whether the Resource Handle is loaded properly and it is!
Cant i put a normal CDialog derived class in such a COM DLL?
Should i go for an ATL Dialog? or should i have a COM DLL with MFC Support checked?
Regards,
Rajendra R
|
|
|
|
|
Well if you are going to use CDialog... you need MFC support... as CDialog is part of MFC. If you don't want to include MFC then use an ATL dialog.
|
|
|
|
|
I built an ATL COM DLL server. When I tried to register it after its build, some error happened to the registration process. The error says,
Performing registration
RegSvr32: DllRegisterServer in MyServer.dll failed.
Return code was: 0x80070716
I've looked up the error code. It says,
"The specified resource name can not be found in the image file."
Does anyone know what happened to the registration?
Thanks,
Tony
|
|
|
|
|
Hi,
In the header file of your COM object you must have a DECLARE_REGISTRY_RESOURCEID(IDR_MYREG) macro. In the resources you must have a REGISTRY folder with IDR_MYREG defined inside. If you have a look at your *.rc file you will find out, that it just match the registry ID with your *.rgs file, which also must be a part of the project:
IDR_MYREG REGISTRY DISCARDABLE "MyReg.rgs"
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Thanks!
I'm just curious how you find the root of the problem.
Tony
|
|
|
|
|
I know how to return an array of variants, such as if I wanted to return an array of integers.
What I would like to do is along the lines of returning an array of C++ objects.
Here is what I'd like to do:
ASP Pseudo Code:
<%
'First, get a connection to my catalog component.
Set objCatalog = Server.CreateObject("my.Catalog.1")
'Now ask my catalog to find me all itmes that match
'the text I send and return them to me.
Set objItems = objCatalog.Find("Books about ASP")
'For each item display its name, price, and then all
'of its pictures.
For i = 0 to objItems.Count
response.write objItems(i).name
response.write objItems(i).price
' Now each book will have 0-20 picutres
' I'll need to have an array of strings
' with the URL to each picture
SomeFunctionToGetAndOutHTMLtoShowPictures(objItems(i).pictures)
Next
%>
So my question is how do I get my C++ component to return
an array of catalog item "objects." This data is not coming from a database else, I'd just use ADO. My COM component goes
out and grabs it dynamically and stores it in a linked list of
Catalog objects. Now I just need to know how to get these
darn things back to my ASP pages! I've searched high and low on Microsofts site and bought 3 books, but none of them cover
anything like this.
I'd appreciate any help, hints, scraps, anything at all to even
point me in the right direction. I'm going bonkers trying to figure this out.
Thanks
NJ
|
|
|
|
|
Hi,
Returning an object to VBScript means returning an Interface of the object. It can be IDispatch or any other IDispatch derived interface. You can create and return a safearray of variants, where each variant holds an IDispatch to your object... but I think the best thing to do is to implement a collection of objects.
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Thank you. We are a Dundas customer BTW.
NotJeff
|
|
|
|
|
IE is documented as supporting IPersistStreamInit, so that given a document (an IHTMLDocument), you can get an IPersistStreamInit for it (by calling QueryInterface), and with that you can read the entire original HTML of the page.
In IE 5.5, it works for the top-level frameset of a page; however, if, using the DOM, I navigate down to a lower-level frame's IHTMLDocument, QueryInterface(IPersistStreamInit) FAILS! It worked fine in IE 5.0.
Suggestions? How can I get an IPersistStreamInit for the frames?
|
|
|
|
|
I have a COM object that implements a connection point to fire events. I also have a worker thread that does some task. I pass the thread the pointer of the class that creates the thread, so that it can do calls back into the object. Some of the calls should fire events, but they don't. I'm not sure why....or how to get it to work...ANY ideas?
D.
|
|
|
|