|
I have a Local Server created in MFC. It displays a modal dialog with a "logout" button. It also contains a COM coclass "A" to which clients are connected. Everything works fine till all clients follow proper reference count rules.
But if a client terminates abnormally, then this coclass "A" has an outstanding reference count on Local server. When user clicks "logout" button, the application dialog closes but the server continues running in background because of this outstanding reference count.
I understand that when the proxy no longer exists in this case, the stub will do a cleanup automatically but after few minutes.
But the requirement is to force the application to shutdown completely when "logout" button is clicked. I have thought of few ways to do it, but I would like to know your thoughts on this so I can choose the best possible solution.
Thank you for your time.
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
i have a query that i have made a plugin(toolbar) that actually works in Outlook but the problem is that the Toolbar(plugin)also appear in the Microsoft Word and also in MS Excel i want that this toolbar plugin should only be seen and acceble in the Outlook so if anyone know the solution kindly help me in this matter
thanks in advance
|
|
|
|
|
if you implement _IDTExtensibility2, you could check application name at OnConnection().
|
|
|
|
|
Hello
I have created com dll in vb 6.0. I used it to generate the WSDL file using
Microsoft SOAP tool kit version 3 but i am not able to use the WSDL file. I am able to use the dll which i have created in vb 6.0. follwing Error is generated.
---------------------------<br />
SOAPPermitCodeTest<br />
---------------------------<br />
There is error <br />
<br />
Client:An unanticipated error occurred during the processing of this request. HRESULT=0x800A13BE - Client:Sending the Soap message failed or no recognizable response was received HRESULT=0x800A13BE - Client:Unspecified client error. HRESULT=0x800A13BE<br />
---------------------------<br />
OK
is there is any method to know that generated WSDL file is correct, I do not know how to verify this as i am new to these technologies(SOAP and WSDL).
Any help would be highly appreciated.
Saurabh Gupta
Software Engineer
|
|
|
|
|
Hi
Created a small VB 6.0 ActiveX control Which has an event CallMe. This event is triggered when a button the control is clicked.
Public Event CallMe()
Public Property Let Text(value As String)
txtString.Text = value
End Property
Public Property Get Text() As String
Text = txtString.Text
End Property
Private Sub cmdFireEvent_Click()
RaiseEvent CallMe
End Sub
I have tested it with a VB 6 project and it worked.When i tried to use the control in a web page, events are not getting fired.
Sub myCtrl_CallMe()
MsgBox "yes"
End Sub
<object id="myCtrl"
="" classid="clsid:55F1D62E-0C61-4637-BA76-594B493A0341">
What should be the problem?
|
|
|
|
|
Actually i want to modify my registry entry to someother but some where i read that it is the sensitive area if a small problem occurs then the entire system wont work. So please suggest what are the things i need to change i want to modify the registry entry of my component.
Thanx,
Kalaveer.
|
|
|
|
|
export all register. if os boots fail, you could boot from safe mode by F8 and restore it. ok
|
|
|
|
|
Hi
i am trying to change a component code a little bit to display some statusbar messages etc. By the way the component is devoloped in VB so i did a small change initially to the code like changed the cursor style and code to display some status message after that i did "make DLL" then that worked well on registering the newly created dll. But after that i included a single statement to setfocus to someother control and again i did the makedll this time on registering the dll the component is not at all activating so i removed the statement which i included (i.e to setfocus of some control)again i created the new dll using make dll but unfortunately the new dll(which is like the previous worked one ) not activating the component.
What could be the problem why its happening so. Please help me.
Thanks in advance.
|
|
|
|
|
In VB project properties, there are some settings for Version compatibility. The GUID must be changing on each compile probably. Please check these settings. Since I haven't worked with VB so this is just a guess. See if this is your problem.
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hihi, I am the newbies in Visual Studio, I have programming background . but not in visual studio.
Now i need to write a IE toolbar by VS 2005 . As i known , i need to understand the COM.
But i am really don't know how to go on . even in the interface of the visual studio 2005.
Can anyone have some advice for me ? or sample code ? or recommend book ?
Thanks
Sam
|
|
|
|
|
You need to study BHO[^].
|
|
|
|
|
I don't understand ?
pop up blocker ??
can you explain more ? thanks
|
|
|
|
|
Link I provided was of search result of BHO on CP. You need to browse through those articles, to find appropriate one.
Read BHO from MSDN,too.
|
|
|
|
|
|
you could have a look http://www.codeproject.com/atl/#IE+%2F+Explorer+plug%2Dins
|
|
|
|
|
Hello,
I've just tried to handle an OPC-interface with VC++ 6.0
Therefor I create an Instance of the interface to get the a pointer of this interface.
This should be ok,
but...
when I want to get access to the methods of the interface, I always get unknown failure codes back:
Interface Instance:
IOPCBrowseServerAddressSpace* InstantiateOPCBrowseServerAddressSpace(wchar_t ServerName[])
{
HRESULT hr;
CLSID CLSID_OPCServer;
CLSID CLSID_OPCServer2;
void** ppIntfObj = NULL;
// Get GUID and UUID from regsitry for COM-Server
hr = CLSIDFromProgID(ServerName, &CLSID_OPCServer2);
ShowError(hr);
// Queue of Class-Instances to create
LONG cmq = 1; // number of class instances to create
MULTI_QI queue[1] = {{&IID_IOPCBrowseServerAddressSpace,
NULL,
0}};
//Create an instance of the IOPCBrowse
hr = CoCreateInstanceEx(CLSID_OPCServer, NULL, CLSCTX_SERVER, /*&CoServerInfo */ NULL,
cmq, queue);
ShowError(hr);
// Return Pointer to the IOPCBrowse Interface
return(IOPCBrowseServerAddressSpace*) queue[0].pItf;
}
In my main-method, I try to work with the interface,
but I only get two different failures as HRESULT:
0x000006F4 in the first attempt.
and 0xC0000005 in the second and third attempt. (this means here Access Violation?)
Implementation in main-method:
CoInitialize(NULL); //Using MS Com library
//Instanciate Browse-Interface
IOPCBrowseServerAddressSpace *pOPCBrowse2 = InstantiateOPCBrowseServerAddressSpace(L"SOFTING.OPCToolboxDemo_ServerDA");
//Declarations for OPCBrowse
HRESULT hr;
OPCBROWSEDIRECTION dwBrowseDir = OPC_BROWSE_TO;
hr = pOPCBrowse2->ChangeBrowsePosition(dwBrowseDir, NULL);
ShowError(hr);
OPCNAMESPACETYPE *pNameSpaceType;
hr = pOPCBrowse2->QueryOrganization(pNameSpaceType);
ShowError(hr);
OPCBROWSETYPE dwBrowseType = OPC_FLAT;
LPENUMSTRING *pIEnumString;
hr = pOPCBrowse2->BrowseOPCItemIDs(dwBrowseType, NULL /*Filter*/, 0, 0, pIEnumString);
ShowError(hr);
...
Where could be my problem.
The interface is defined in an IDL-Sheet from the OPC-Foundation.
Perhaps you've got an intension, if there is anything wrong with my interface handling or coding?
Thanks for your work at this time
Biasto
|
|
|
|
|
Please check the reference count.
Biasto wrote: // Queue of Class-Instances to create
LONG cmq = 1; // number of class instances to create
MULTI_QI queue[1] = {{&IID_IOPCBrowseServerAddressSpace,
NULL,
0}};
//Create an instance of the IOPCBrowse
hr = CoCreateInstanceEx(CLSID_OPCServer, NULL, CLSCTX_SERVER, /*&CoServerInfo */ NULL,
cmq, queue);
ShowError(hr);
// Return Pointer to the IOPCBrowse Interface
return(IOPCBrowseServerAddressSpace*) queue[0].pItf;
}
Just curios, If you retrieve only one instance then why are you using CoCreateInstanceEx?
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I get failure when I'm using only CoCreateInstance!
And it doesn't something with COM-related problems.
I've found the solution, just to declare all arguments for the OPC-interface function, in a logical way, otherwith the access to the interfaces fails with an null pointer receive-failure.
Therefore the specification of the opc foundation is very unusual to understand!
|
|
|
|
|
I have a COM/ATL out-of-proc server whose main object is a singleton. I will call this Object A. Object A is called by other out-of-proc servers, but they are on the same machine so I am not worried about DCOM, etc. Object A uses a third party library (another set of COM objects) which generally works well but has a couple of known problems which can crash the Object A server (the problem can be reproduced). I have isolated this library into its own out-of-proc server to protect the Object A server. The library of the new server contains an object (I will call it Object B) which gets a reference to Object A. Object A releases its reference to Object B, but Object B maintains its own reference until its work is done. When the work by Object B is done, it notifies Object A, releases Object A and then releases itself. When all other servers are done and release Object A, then Object A is released and goes away normally.
If in the middle of its work, Object B crashes, it takes down its own server but the server which owns Object A is unharmed... except, that it still thinks there is another server out there which has a reference to it, so it won't shut down when all other out-of-proc servers have released their references.
Object A also maintains a watch on the Object B process so it knows if the Object B process has crashed.
Efforts to decrement the interface count on Object A when Object B crashes were not helpful and could have caused other problems (the reference count in Object A does not appear to be affected by Object B... I am assuming an internal reference count and an external referece count... but if so, where is the external reference count stored and can it be decremented???).
Ultimately, I need to get Object A back to the state it had before it created Object B.
I am also posting this in the ATL forum.
Thanks.
m.bergman
-- For Bruce Schneier, quanta only have one state : afraid.
|
|
|
|
|
Hi,
I have a problem with the Internet Explorer. I added it to my view-class and set it up using the IWebBrowser2-interface.
It all works fine, the browser shows the HTML-content that it is supposed to. But when I click into the browser-area and
then try to set the focus to another control (for example a list ctrl) the browser "steals" the focus. It isn't possible
to type something in another control which is very annoying, of course...do you have an idea what is going on here and
how I can avoid this problem?
mfg Steven
|
|
|
|
|
Hi
I am getting Access violation whenever I Query for IWMSBufferAllocator in my custom plugin.
Here is code
<br />
<br />
IWMSBufferAllocator *pBufAllocator = NULL;<br />
<br />
if(m_spClassFactory)<br />
{<br />
hr = m_spClassFactory->QueryInterface(IID_IWMSBufferAllocator,(void**)&pBufAllocator);<br />
if(FAILED(hr))<br />
return hr;<br />
}<br />
Debug output gives these lines
Access violation reading location 0xfffffffffffffff.
The thread 'Win64 Thread' (0x338) has exited with code 0 (0x0).
First-chance exception at 0x78d67d0d in WMServer.exe: 0x80010105: The server threw an exception.
m_spClassFactory seems good. Its not a null or invlaid pointer. I have also tried with code like MSDN where
hr = m_spClassFactory->QueryInterface(IID_IWMSBufferAllocator,(void**)&pBufAllocator);
is used as
hr = m_spClassFactory->QueryInterface(&pBufAllocator);<br />
Can someone help? There is no other doc available.
-----------------------------
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
I am developing a COM server (.exe or .dll) to add functionality to vbScript. For one, I am wanting to develop a modal dialog window that can be opened from vbscript.
So far I have the dialog able to be opened but wierd things happen. When running in an .exe I get "Server Busy" messages when the dialog is opened modal. When running in a .dll then it seems my dialog goes stale... the controls are there and functional, but the event engine in the dll doesn't appear to be active (this is based on Qt from TrollTech).
I'm hoping there's something simple to get beyond these wierd COM hurdles.
|
|
|
|
|
Hi, I would like knows how I list all net interfaces, so much the ones that are online as offline.
I accept code in any language, preferentially C, C++, C#, VB.NET and VB.
Thanks for any help!
|
|
|
|
|
Hi All ,
I would like to query for an interface in a COM DLL .I don't
know the CLSID of the COM DLL. I tried to use tlbinf32.dll to do this by importing it into my VC++ project using #import, but when I compile , I get errors in the .tlh file that is generated. Anyone who has used this please help .
Thanks in advance!
|
|
|
|
|
Please mention error details!
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|