|
I just re-ordered what you had already - If it compiled before why not now?
Steve
|
|
|
|
|
Sorry, I have make a mistake,so it can't compile success, and now it's ok.
But I am sorry to ask you again,it is still unable to respond to the event of OnLButtonDblClk.
|
|
|
|
|
I need to develop a COM component, which fire events.
In COM there is a method named M1 and an event named F1, M1 fires the event F1.
M1()
{
Fire_F1();
}
There will be two applications app1 and app2.
App2 will advise to the event F1 in the COM.
Now when app1 gets the interface of COM and calls M1, app2 should catch the event.
i.e app1->COM->app2.
I mean to establish communication between app1 and app2 thru COM.
I tried with atl dll, but I am not able to succeed.
Some one please help me.
|
|
|
|
|
Hello kk_mfc,
If I understood your specifications correctly, it's quite straightforward actually. Your COM Server must meet the following criteria :
1. It must be an EXE Server.
2. The COM component must be a SINGLETON.
3. The Class Factory of your COM Component must be registered with the REGCLS_MULTIPLEUSE flag (this is already the case by default).
I wrote an experimental COM EXE Server based on your specs. It works well. If you need it, email me directly :
bio_lim_2004@yahoo.com
and I'll send a copy to you.
Best Regards,
Bio.
|
|
|
|
|
Hi,
I randomly get a first chance exception when my application call CoUninitialize(). I dont get it all of the time and the code isnt always the same. I have seen codes 0x800706B5 and 0x80010108. It doesnt appear to cause any problems but it worries me that there may be some underlying issue.
My app is built with MSVC6.0 and I call CoInitializeEx(NULL,COINIT_MULTITHREADED) to intitialise COM
Any suggestions?
TIA
Tony
|
|
|
|
|
These error codes are RPC_S_UNKNOWN_IF and RPC_E_DISCONNECTED respectively. If you're just seeing them in the debugger's output window, and they're being handled - you don't get an unhandled exception message box - I wouldn't worry about them. IIRC the RPC layer which underlies COM does use exceptions to report problems, rather than returning error codes.
It probably just means that you're using DCOM and the target machine either isn't responding, isn't running the same OS as the client, or disappears while you have a reference to an object. I think you might also get RPC_E_DISCONNECTED if the process hosting an out-of-process object crashes or otherwise terminates while you've still got a reference open.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanks Mike,
As you say, the message is only output to the debug window, I just wondered why I got the error. I have used this code for years now and it hasnt fallen over, it was just morbid curiosity.
Thanks for the explanation.
Cheers,
Tony
|
|
|
|
|
Are you using normail pointers for Interfaces or Smart Pointers ?
S o h a i l K a d i w a l a
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I am using normal pointers. The error is output to the debug window - I do not get an unhandled exception dialog.
Tony
|
|
|
|
|
I encounter errors while trying to compile com project with idl file attached. i assume the file is ok, because someone used it before, but perhaps i could fix that by changing compilator configuration...
error MIDL2311 : statements outside library block are illegal in mktyplib compatability mode : [ ] <br />
error MIDL2311 : statements outside library block are illegal in mktyplib compatability mode : [ Interface 'IPsipentaUISupport' ]<br />
error MIDL2096 : duplicated attribute : [uuid] [ Interface 'IPsipentaUISupport' ]<br />
thank you in advance for any ideas .
|
|
|
|
|
if not problem can you show .idl file ?
|
|
|
|
|
Quoting from MSDN -
MIDL2311: statements outside library block are illegal in mktyplib compatibility mode <br />
You may need to specify the /mktyplib203 command-line switch when you compile your IDL file.<br />
Note The Mktyplib.exe tool is obsolete. Use the MIDL compiler instead.
S o h a i l K a d i w a l a
-- modified at 5:57 Friday 21st April, 2006
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I built a control using the MFC ActiveX control wizard in VC6 and I am able to add methods, properties, and events just fine. When the control is created, I start a new thread (CWinThread-based) in the constructor. The control is not visible during runtime; rather this worker thread runs in the background (reading the serial port and doing parsing operations) and sends back information to the host application via events. The way I did this was to make the thread class a friend of the control class so that the thread class could directly call the FireEvent___ functions. Is this the right way to do this? I've Googled this and also searched cp here but came up short on specific examples.
I ask this because when I test the control on VB6, sometimes the entire VB IDE shuts down (crash). When I test the control on VB.NET 2005, the event callback functions can't access any of the form controls (because the event function is called under the context of the control's worker thread). In LabView, the events fire back but all the arguments are zero; not the values that were passed to the FireEvent___ function (they are all signed long).
Thanks in advance!
|
|
|
|
|
Hello prcarp,
>> The way I did this was to make the thread class a friend of the control class so that the thread class could directly call the FireEvent___ functions. Is this the right way to do this?
This is not good enough. You basically need to marshal the event sinks of your control's client to the thread managed by your CWinThread-based class.
I have written a sample applcation that demonstrates this. Please email me :
bio_lim_2004@yahoo.com
and I'll send you the sample codes.
Best Regards,
Bio.
|
|
|
|
|
What is the difference between ActiveX and COM?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
ActiveX is a technology built on top of COM. It is mainly concerned with the creation of reusable controls.
Steve
|
|
|
|
|
LazyKancha wrote: What is the difference between ActiveX and COM?
Com is concept and Activex Follow it
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I have "inherited" an application that has the ability to start a COM service to communicate through VB to an Access database. It also can run in a standalone mode, where the service is not started and there is no network connection.
My problem comes in with regional settings. In the system where the service is running, if I do not format dates in US format in my sql statements, the access database does not process them. However, if I run the application on the standalone system without formatting the dates in the sql from VB it works fine (access accepts the sql statements and processes them). Naturally, if the regional setting is US all is fine, but when any other regional setting is chosen, the system with the service running does not update, while the standalone system does.
Does anyone know if Access has a way of knowing whether it is associated with a "networked" application or not? Or is this some how related to the COM service?
JeanneD
|
|
|
|
|
This is probably that the system default locale on the computer is set to English (US). The COM service will run under whichever user it's configured to, but often this will be the default of SYSTEM or LocalSystem. I'm not sure if the COM service infrastructure loads the user's profile, so you may find that the system default locale is being used even if you've configured the service to run as a normal user and that user has a different locale selected.
You should consider using parameterised SQL statements rather than using string concatenation to build a SQL statement. See the documentation for CreateParameter on the Command object. For Access/Jet, you'll want to use a ? as a parameter placeholder.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
how to show a button which will create in seprate dll ,
in detail:
i am calling a DLL in which a button is created but i want to show this button on my main dialog please tell me what i have to do for this.
Bankey Khandelwal
Software Engineer
Bankey Khandelwal
Software Engineer
|
|
|
|
|
STOP CROSS POST[^]
you are definitely not a Software Engineer as you say in your sig
|
|
|
|
|
v2.0 wrote: you are definitely not a Software Engineer as you say in your sig
Wow!.... Clever Decision
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
i don't like abusive guys, and engineers have generaly good common knowledge and good speaking, which is obviously not the case here...
-- TTD --
|
|
|
|
|
I have written a COM add-in for MS.Word in MFC. I can get the content of a document, and control ms.word's document successfully. However, I can't do functions as ms.Equation 3.0 does, such as adding a mathematical symbol. I don't know how to do that, how the ms.equation does as well as what ms.equation solves in detail. I'm in dark. Would you like to give me some advice, or point me some webpages. Thanks...
|
|
|
|
|
Hi,
I would replace the moniker that load data from internet when a HTML page (and its images) is browsed.
I'm not able to provide a moniker to MSHTML nor IE (thru the IBindHost).
How can I achieve to replace the moniker ?
|
|
|
|