|
Sounds like an uninitialized variable somewhere. That is almost always the cause for the symptom you describe. You can also try turning off optimizations, changing thread libraries and stuff like that. But I reiterate, uninitialized variables are nearly always the cause of bugs that only show up in release builds.
|
|
|
|
|
The error seems to happen in function _com_issue_errorex():
if (FAILED(_hr))
_com_issue_errorex(_hr, this, __uuidof(this));
but I still don't know why? In debug mode everything is fine!
If you have any idea please help me!
|
|
|
|
|
I have written two applications one of which is wizard style dialog based app and the other is an SDI. It turns out that what was needed was the wizard to be started from within the SDI as well as a stand alone app. I thought that Automation was the way to go and so far I have solved half the problem. The Wizard can now be started from within the SDI app and I can set some initial values. What I now need is for the wizzard to tell the SDI that it has completed, and that either the Wizzard tells the SDI the file name of the newly created file or that the SDI shiould now query the Wizard for said file name.
Any help would be great
Cheers
AndyC
|
|
|
|
|
You need to have your Automation server fire an event back to the client. This is done through a connection point. Lookup IConnectionPoint on MSDN for specifics. There are some good articles there. The wizards can help set it up.
Its not really very hard to set up, if you know have the COM object when you are writing the code. I trid to use them in my own project, but I never made it work. I had to set mine up dynamically since the client accesses an unknown number of COM servers.
Hope this is helpful,
Bill
|
|
|
|
|
I have tried to Impliment connection points within my automated server exe. I did this by using the wizard to create an ATL "Simple Object" with the "Support Connection Points" options enabled. I added the fuctions that I required to fire and Implimented Connection Points with the revalent class. When I try to make a instance of this object it failes because the object is not registered. How do I get to register this new object, seeing my app is not a com dll or com exe the regsvr32 function also fails.
Best Regards
AndyC
|
|
|
|
|
i'm doing my college assignment call plug-in application,
my main application is using VC++ with Automation support then i need my plug-in application(in VB (.EXE also)) to call VC++ method, therefore in VB i just write the code:
dim a as object
set a = CreateObject("MyCOMApplication.Application")
this work fine, but what if i open my "MyCOMApplication" already, then in VB i create it once again, then it became 2 same application with different address,how can i create the object in VB but just get the reference on that COM? but not re-create it? i really hope someone can help me, because the assignment due date is pending .. thanks for helpness, i will appreciate
|
|
|
|
|
I'm not that up on VB, but I think GetObject does what you want. If it fails, then use CreateObject.
Thanks for the help,
Bill
|
|
|
|
|
To make all clients talk to the same instance
of your COM Server, you can use the Macro
DECLARE_CLASSFACTORY_SINGLETON(...)
in your COM class.
Firoz
|
|
|
|
|
thankz Firoz , but can you tell me what's the different between this function from CCOMCOClass and RegisterActiveObject ?
|
|
|
|
|
Hi, i've got this com object created with Atl Wizard, then I implement a connection point, and fire the event with Fire_Alarm(). Register my client to that event with AtlAdvise, but when firing the event, my client doesn't notice.
The same client with an old atl com objects version (the proxy header created with Atl Proxy Generator) works fine, so I guess it might be a server problem.
I've debugged the server, and the connection between the client and the event is made (the number of connections is 1). Someone told me is a bug in the code generated by the wizard, anyone has any idea?
kike
|
|
|
|
|
I have fired events using the CProx_XXX classes generated by the wizard without problems. Have you stepped into the Fire_XXX method? You should verify that the number of connections is correct for the number of clients attached to the event source (the proxy class), that the proxy gets an IDispatch pointer to your client OK, and that the return value of IDispInvoke is OK.
What is the result of the call to IDispatch::Invoke in the Fire_XXX method? It's possible that the server is connected to the event sink OK, but the implementation of IDispatch::Invoke is failing to call the event handler you defined in your client class. Which mechanism are you using to sink the events, IDispEventImpl or IDispEventSimpleImpl? If you don't declare your handler function with the correct signature, it won't get called, and if there is a mismatch in the DISPPARMS for the event that's fired and the handler that sinks it, it may not work too well either.
Check the HRESULT returned from IDispatch::Invoke in the debugger. It may point you in the right direction.
|
|
|
|
|
The bug generated by the Wizard is probably not the problem. It causes a compile error and you can't proceed without fixing it. It uses IID... where it needs to use DIID..., you merely need to add the D to fix it.
The Wizard is probably not the source of the problem. I think Aaron's suggestions are on the right track.
|
|
|
|
|
Hello all,
I'm new here and newbie in COM. I have to create a COM server. In this COM server, I exposed many interfaces to manage a specific database. I want my COM server to be used from a C++ client, VB client and ASP client. My interfaces do only search, comparison and file reading. Do I need to use the ATL?
What are the benefit of using the ATL in this case?
Thanks in advance,
Regards,
Bruno
|
|
|
|
|
If you want to write a COM object in C++, then ATL makes life a lot easier. What other options have you considered?
If you are a new to COM, I suggest you get a copy of Don Box's Essential COM which will help you understand how it works. ATL provides a lot of the boilerplate code which saves a lot of time.
Michael
|
|
|
|
|
Michael P Butler wrote:
If you want to write a COM object in C++, then ATL makes life a lot easier. What other options have you considered?
I have considered to do all the stuff my self because I hate to use the MFC and think that ATL is kind of MFC related and it's only for graphical COM.
As I don't know if I'm right or not, I ask you if it is.
From what I understand from your post, I'm thinking that I was totally wrong.
Bruno
|
|
|
|
|
Sorry but you are wrong. ATL is not like MFC, in fact, in my opinion, MFC 7 has taken a lot of tricks from ATL. ATL is very helpful in putting together COM components, graphical or otherwise.
After reading Essentila COM you may also want to look at Essential ATL.
|
|
|
|
|
You can make a lot of things with ATL, from common controls to simple com dll. I use all day ATL, for make com components....
Best Regards...
Carlos Antollini.
|
|
|
|
|
I hate the messy ATL code and like MFC a lot. By the way, you don't have to do anything GUISH to use MFC (no need to get into flame mode, it's just my opinion).
|
|
|
|
|
ATL is nothing like MFC. ATL was written to make life easier for COM programmers. The only gui stuff in ATL was added to make writing ActiveX controls easier. With ATL you can pretty much create a simple COM object like you seem to need just by running the wizard.
As somebody who learnt COM the hard way, I really do suggest that you use ATL rather than having to write everything from scratch.
Michael
|
|
|
|
|
How can I detect the creation of COM "Random RPC threads" ??
This is something I would really like to know, since I would like to be able to notify some other threads in my app when this happens.
Cheers
Espen
|
|
|
|
|
Hi,
We are trying to use a DCOM server on Windows 95, but we are having some troubles. Ever literature says that the server need to be already launched on the remote machine (Windows 95). "DCOM95 does not perform remote activation. Therefore, the server needs to be running before a remote client can connect to it". The problem is that we have no idea how to run the server before the client connection. May someone help us?
Thanks in advance,
Guaty.
|
|
|
|
|
hey man,
there are s many possibilities to do that
autostart
autoexec.bat
Load in system.ini
etc
There are more than 12 options to start an app on boot time with Windows 9x.
Be aware, if you dismiss the connection to your EXE server, and its
the last connection it will terminate. From that on you have no way to
autostart it again. Therefore I would tweak reference counting of the server if running on Windows 95, if I where you.
|
|
|
|
|
Hi,
Sorry, I forgot to say... I´m not using an EXE server, I´m using a DLL server. When I use it on a Windows 2000 server, I need to create a subkey "DllSurrogate" in the AppID register key. When the client connects, the surrogate "dllhost.exe" starts the DLL server. The problem is that in the Windows 95, the server needs to be already running. If the server is a DLL, what can I do?
Thanks,
Guaty.
|
|
|
|
|
Hi,
I think the answer should be pretty obvious, just make a small executable that creates an instance of your server object and run it on your Windows 95 machine.
Cheers
Espen
|
|
|
|
|
Is it possible to change full ActiveX control's size (extents) from inside control at run-time, sort of notifying the container about the change in size, so then the container would call GetExtent and the control would let him know of its prefferd size.
BeAlex
|
|
|
|