|
There is a delay between the last reference to an in-process COM object being released and the DLL actually being unloaded. The DLL is unloaded when IE calls CoFreeUnusedLibraries(Ex) . You have no control over when IE will call this API.
|
|
|
|
|
I have created an Activex object and registered it. I can instantiate the object in VBScript -CreateObject works fine without any problem.
However, I have noticed that if the browser (IE in this case) is not closed the object OCX file cannot be deleted and unregistered. As far as VBScript it is sufficient to set the object to "nothing" to release it, so I think there's something I need to add in the Activex code.
In the Activex object I'm also using the IObjectSafety interface the AddRef() and Release() function are added as bellow
------------------------ CODE STARTS HERE
ULONG FAR EXPORT CMyCtrl::XObjSafe::AddRef()
{
METHOD_PROLOGUE(CMyCtrl, ObjSafe)
return pThis->ExternalAddRef();
}
ULONG FAR EXPORT CMyCtrl::XObjSafe::Release()
{
METHOD_PROLOGUE(CMyCtrl, ObjSafe)
return pThis->ExternalRelease();
}
------------------------ CODE ENDS
I have a naive question: do I need to add something in the Release() function to properly delete the object? and where can I find an example of how this is done? From what I've read so far I know there is a reference count I need to maintain and check at Release() but I'm confused on where do I add this.
Any suggestions is welcome!
|
|
|
|
|
There's a delay between when the last reference is released and when the DLL containing the objects is unloaded. Periodically, a component host will (or should) call CoFreeUnusedLibraries(Ex) . This API in turn calls your DllCanUnloadNow function. The MFC AppWizard should have implemented this function for you.
So you just have to wait for IE to call CoFreeUnusedLibrariesEx .
|
|
|
|
|
I'm designing Excel Sheet using my ASP.NET web Application. In that worksheet I want to on autofilter mode on any specific row from my C# Web application.I've written following code
Cellules=m_oSheet.get_Range("A3","E3");
Cellules.AutoFilter (5,m_oMissing ,m_oMissing ,m_oMissing,true);
using above two line of code dropdown arrows are available in the row whose range I'm giving but when we click on dropdown arrow then it not open popup.
But when from excel menu we make off-on to Autofilter property then it's work properly.
Any body can help me for this....?
Vaibhav Jain
Lecturer, MCA
Medi-Caps Institute of Techno Management, Indore
|
|
|
|
|
Hi all
Iam using WMI(windows management Instrumentation) to PING other Systems. I ahve developed a sample Application which is working fine on WINdows XP operating System . But when aim trying to run same application on WIndows 2000 it is giving me error.
I know the problem is with CoInitializeSecurity .
CAn u please suggest me how to proceed further to ping using windows 2000.
Thanks in Advance
abhi
|
|
|
|
|
|
I have some DLL files which I have cerated few yrs back but nwo fund that the source code of thos files I have lost but that source code i want so is their any way to open the DLL files and get the Source Code.
Can anybody give me the solusion of this or any code in DOTNET do open the DLL files OR any code to crack the DLL files, Coz I have lots of such files of which Source Code i have lost and some of the code i lost bcoz of the virus
Is anyone have such program to open the DLL files so please give me that or any solusion fo that it's very urgent.
Harshad
|
|
|
|
|
nope, you cant do that. its gone.
-Prakash
|
|
|
|
|
Hi,
Having a problem with sink and wondering if any one can help. The problem is i want revieve notifications back from a COM object (Netmeeting SDK INmCall and INmCallNotify). I assumed it would be a case of overriding INmCallNotify and replacing how it handles callbacks with how i want it to handle call backs, however this doesnt seem to be the case.
Can any one offer any light on the subject please, i have read a post about this but still am a little unsure.
Tbanks
|
|
|
|
|
Can you be more specific? Perhaps post some of your code.
Steve
|
|
|
|
|
Have you gone through NetMeeting SDK Documentation and samples.
KIRAN PINJARLA
|
|
|
|
|
I am tryng to create a C# application that will load a plugin that implements the following interface:
public interface IPlugin
{
bool OnMessage(IMessage Message);
}
I am trying to create a language independent plugin.
What do I have to do?
How do you create a type library for this interface?
I am not sure how to go about this.
|
|
|
|
|
|
Thanks I will have a look.
|
|
|
|
|
how to trap tab change event in IE7 or how to get active tab ?
|
|
|
|
|
i found the way to get tab change event and get the active tab.
|
|
|
|
|
I known app that use Com.
I want to spy it. How i do??
Because i don't know much about com. Dont laugh at me!!!
Another question: I always see examples about com like this
class obj{
class XI1: public interface1{
//code here
} m_x1;
..............
};
So, If my app want to use as many interface1 as i want.
How i write my com object.
Thanks
|
|
|
|
|
The only real way to see what's going on with an existing application that uses COM is to somehow implement a proxy object that can sit between the two existing objects. That's not at all straightforward, but I did do it once to try to understand what was going on with Pocket PC's Soft Input Panel input methods, so I could write one of my own.
The example you've illustrated is the 'nested classes' pattern of implementation. Here, every COM interface is implemented as its own function. The advantage of this style is that functions with the same name and parameters from different interfaces can be implemented differently, if required. MFC uses this pattern.
The other main pattern is the 'multiple inheritance' pattern, where your class derives from all of the interfaces. ATL uses this pattern. This style has a lot less 'glue' required. Personally I prefer it.
I'd recommend that if you're just beginning with COM, you should obtain the book "Inside COM" by Dale Rogerson (sadly, out of print).
|
|
|
|
|
Hey, Thank for your help. But i can't find myself "Inside com" or similar things. I'm very happy if you send me some of your book :->!!!
If possible my email: sea.loves.you@gmail.com
Thank very much.
|
|
|
|
|
I have a simple component. It receives and stores data. The data needs to be decoded before can be used. Then I set a CodecManager in the component. When I try to retrieve the data in a event processing, the codec manager should provide a codec for use. But at this point, CodecManager failed. I don't know why? Anybody help. Is it legal to call CoCreateInstance in event processing?
|
|
|
|
|
U can call CoCreateinstance in the event handler but it is better u create the component some where else say add an Init function and within this u create it and use in the thread.
Sudeesh
|
|
|
|
|
|
The information u given is too abstract. provide more clarity on ur problem or place some piece of code for reference. becaz we cant find out the root cause without code samples.
Kamaraj[in]
|
|
|
|
|
When you say 'event processing', do you mean in a COM sink interface, or normal message handling?
What HRESULT does CoCreateInstance return?
Can you write a minimal COM client that calls CoInitialize(), and successfully CoCreateInstance the codec, then release it and call CoUninitialize()?
Steve S
Developer for hire
|
|
|
|
|
i am working with Active-x test container in that i have add control through edit,now i am able to get connected with server with invoke function>My Q is :
1.if i want to save my userid and password in that for future use is that possible.
2. when i get connected to server it is giving me a "session id" and each time it will b new one
so if i want to use that session id for further procedure like "request Price" etc without
user interface how it can b done.
3.Is it possible to invoke more then 1 or 2 function from test container.
any suggestion will b helpful to me.
Thanks
|
|
|
|