|
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.
|
|
|
|
|
Hi,
Events are signaled by calling the Invoke method of an IDispatch interface supplied by container. The interface lives in the apartment of its own thread, which is also the one containing the control itself. To comply with the STA model, we can only safely call this interface's methods from the thread in which it was created. If the control wants to signal an event from a different thread it must Marshal the IDispatch interface into the IStream first and then UnMarshal it. And of course it must call CoInitialize() too.
To Marshal/UnMarshal interface pointers you can use my favorite functions: CoMarshalInterThreadInterfaceInStream(...) and CoGetInterfaceAndReleaseStream(...).
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Hi,
I want to get the handle of edit box in IE COM..
The edit box that is dynamically created in IE by
tags..
I am not sure that it is a window.
Cause I failed to hook the handle of it in Spy++..
Is that a window?
If it is, how can i get the handle of it?
Any suggestion will be appreciated...
Thanks in advance..
Regardz
-Ray
|
|
|
|
|
how can i call back the errors that i saved in the log file
i need some function to call up the errors and view in textbox or something.
can you help me.
regards
|
|
|
|
|
How can i open and view error.log file ??????
|
|
|
|
|
How to read from an existing excel File from C++/COM.
I am not able to use the existing article to alter it to reading from an existing excel File - reference Article;- MSDN Q192348 & Q216686. This uses automation.
or how to use ADO to read the excel file. Any example if possible would be a greater help.
|
|
|
|
|
How can i make an com object in vb6, that i can use to take text or number or
text and number an save them to file in my hard drive?????
|
|
|
|
|
Hi,
I don't get what exactly the problem is...
Creating a COM object in VB6...? Passing parameters to the method...? Saving data into the file...? Or all of the above?
Can you provide more information on the problem...
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|