|
i use the ATL wizard create a COM service.When I execute the
command "myservice.exe /Service" on the computer ,not install VC(NT4 SP4),I can't register it.
but when i can execute the command succefully on the computer with vc6.
|
|
|
|
|
Sounds like your missing a file, or files, on the non-development machine. Use depends and make sure all files are present on the target system.
|
|
|
|
|
Hi, I need read text value from property which is in registry defined like VARIAT. So I use following code:
COleDIspatchDriver m_Driver;
...
VARIANT res;
VariantInit(&res);
m_Driver.GetProperty(Id_PropText, VT_VARIANT, (void*)&res);
...
And that returns res.vt=0x2008, res.bstrVal=0x0018f040. But no text even in the data source is correct text value of this property.
Have you any idea where can be problem?
Thanks Alex.
|
|
|
|
|
hi
I am getting confused as when to call the methods AddRef() and Release() methods.I am using aggregation hence please tell me in detail.I am new to com
Thanks
Pathi
bhikshapathi_g@semanticspace.com
|
|
|
|
|
Im not familiar with COM aggregation, but I think I can still shed some light on this subject... The purpose of AddRef() and Release(), and the whole reference counter thing, is to insure that a resource isn't unloaded/deallocated/deleted/otherwise removed from existance before everyone is done using it. For instance, when you create a COM object, the counter gets set to 1. When you are done with this object, you call Release(), which brings the counter to 0. There is code (or should be code, if you are implementing these functions yourself) inside Release() that resembles...
if (--m_nRef == 0)
delete this;
return m_nRef;
which says "When my reference counter goes to 0, I delete myself, because I am no longer needed." For these reasons, it is recommended you AddRef() every time you store another copy of a interface pointer, and Release when you are done with that pointer, however you do not need to be that crazy about it if you have absolute apriory knowledge that your pointer will not be pulled out from under you. Keep in mind that CoCreateInstance(Ex) sets the reference counter to 1, and QueryInterface makes an implicit AddRef() call, as does many other functions used in creating/connecting to a COM object.
Hope this helps.
-Jesse
|
|
|
|
|
In an MFC application i put the folowing code
in the OnDraw function of a CView class and it works !
I tried to use as less COM overhead as possible.
What the code do is to render an SVG file using the Adobe's SVG control.
When i try the same in an ISAPI filter (a DLL that is loaded by the IIS service) the queryinterface for IOleInPlaceObjectWindowless returns NULL. Is this because
the is no Window?
Note: Doing a Queryinterface for IOleInPlaceObject return an object for both the MFC and the ISAPI-Filter, but calling SetObjectRects return an error and has no effect.
void CSvgtestView::OnDraw(CDC* pDC)
{
CSvgtestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
HRESULT hr=0;
ISVGCtl SVGCtl;
if(SVGCtl.CreateDispatch("Adobe.SVGCtl")==0)
return;
SVGCtl.SetSrc("C:\\Inetpub\\wwwroot\\test.svg");
CComQIPtr<IOleInPlaceObjectWindowless> ptrOleInPlaceObjectWindowless(SVGCtl.m_lpDispatch);
RECT rcPosRect={0,0,300,200};
RECT rcClipRect={0,0,300,200};
hr=ptrOleInPlaceObjectWindowless->SetObjectRects(&rcPosRect,&rcClipRect);
CComQIPtr<IViewObject> ptrViewObject(SVGCtl.m_lpDispatch);
RECTL rcBounds={0,0,200,200};
HDC hdcDraw=pDC->GetSafeHdc();
hr=ptrViewObject->Draw(
DVASPECT_CONTENT,
-1,
NULL,
NULL,
0,
hdcDraw,
&rcBounds,
&rcBounds,
NULL,
0
);
}
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
Well, i place a CoInitialize(NULL); before creating the SVG object and now i get the IOleInPlaceObjectWindowless.
The problem is that i still cant get anything, still check it out...
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
hello all,
I'm writing an IE plugin that's an Explorer bar and consists of a simple treeview that displays the HTML structure of the current IE webpage. I need to grab the text from the browser that is selected by the user through mouse & keyboard action, and display this dynamically in the plugin's treeview. how do I do this? My idea is to hook up to DHTML events, but I'm not sure. how do I get the selected text from IE + determine what part of HTML/DHTML element it is?
TIA,
I'm an alien, I'm an alien
it's a beautiful life....
Bush
|
|
|
|
|
Amit,
I and another person (can't remember who) have already created explorer bars that are treeview explorers of the current html page being displayed. Mine sits on the left and the other guy's sits on the bottom of the IE window. I haven't released it but I can send you a copy of the plugin if you're interested.
Cheers,
-Erik
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My thoughts are my own and reflect on no other.
|
|
|
|
|
Sorry, first time for this and I'm not sure which direction I need to take...
I have an ATL COM DLL that wrappers parts of another COM component written in Java provided by another vendor. It works great running on the same server as the Java component. However, the intent is to have the ATL component connect remotely to the Java component. I don't really care how the problem is solved... instantiating the ATL object on the server (Web server) from the client (how?) or having the ATL component which is currently downloaded to the client remotely instantiate the Java component (how?).
The only direction I know to look is DCOM but that's not the direction I wanted to go. For one thing, with DCOM I'd have to setup (from a web browser) the Java component on the client so I can select it using dcomcnf to go to the server to run instead (that's the only way I could select the option that I saw).
Could anyone point me in the right direction? I'm a little lost...
Thanks,
Matt
|
|
|
|
|
Actually, I think DCOM is the way you want to go. You can programmatically set everything DCOMCNFG does (look into CoCreateInstanceEx for specifying server, and the AppId registry keys and LSA functions for security settings if they apply). Might I suggest, if you are going to use multiple clients off this server, that you turn your COM dll into an exe. COM dlls require a surrogate (very thin wrapper that does nothing really but provide an executable layer) to run on a remote machine, because frankly they themselves arnt enough to sustain an independant process. DCOM provides a default surrogate, DllHost.exe, which isnt bad, but if your goal is to service multiple clients off that remote server, my suggestion would be to turn your DLL into an EXE. One thing I dont understand is who is the client? If its a web browser, all your objects will be "running" on the server, so you dont need to make your client aware of the objects. If its an application, then there isnt really any issue in just registering the needed classes on that client computer, is there?
Hope this helps.
-Jesse
|
|
|
|
|
How to start several Excel books at the same time with IDIspatch?
I know how to start only one Excel book using C.
And it is very easy to start several Excel books by VBA.
Thanks very much! :
|
|
|
|
|
Hi,
Does anyone knows how to set the Shutdown Privilege to WMI on Remote Computers in Visual C++ ?
Microsoft did not documented this very well as usual.
Any reply is welcome.
Thanks in Advance.
Best Regards,
Mario M.
|
|
|
|
|
I'm having some trouble with screen flickering when the browser window (or active X test control container) is scrolled.
It is really quiet bad, Is ther any way to get better redrawing? with less flickering? I've tried some double buffering but it doesn't seem to work. Especially with the CDC that the OnDraw function gives me.
It is an MFC base Active X control.
Any ideas, would be great
thanks,
JAred.
|
|
|
|
|
It is probably EraseBackground that causing this excessive flicker. Try to intercept WM_ERASEBKGND and return 1. Worked for me.
|
|
|
|
|
If you BitBlt a bitmap to the background through the WM_ERASEBKGND and the bitmap is bigger than the dialog it will
flicker. Make sure the bitmap is exactly the size of your rect
or smaller.
|
|
|
|
|
Environment: Windows 2000, VC++ 6.0
Hello,
I wrote an ActiveX control: MyCtrl.
I wrote a composite control that uses MyCtrl.
How do I call functions of MyCtrl?
I can get the CWindow of that control but
I need the CMyCtrl object !!!
For regular controls I found the "atlcontrols.h" file
in the MSDN, but I don't know how to call functions
of a new control I wrote like:
m_myCtrl.SetBitmaps(IDB_HELLO);
Any help will be appreciated.
|
|
|
|
|
Hi,
I want to write ActiveX about Editbox,
I mean, i want to add some tools to EditBox.
But in first i want to know:
I wanna show usual editbox in my ActiveX,
How can i do that ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Environment: Windows 2000, VC++ 6.0
Hello,
I wrote an ActiveX control: MyCtrl.
I wrote a composite control that uses MyCtrl.
How do I call functions of MyCtrl?
I can get the CWindow of that control but
I need the CMyCtrl object !!!
For regular controls I found the "atlcontrols.h" file
in the MSDN, but I don't know how to call functions
of a new control I wrote like:
m_myCtrl.SetBitmaps(IDB_HELLO);
Any help will be appreciated.
|
|
|
|
|
Environment: Windows 2000, VC++ 6.0
Hello,
I wrote an ActiveX control: MyCtrl.
I wrote a composite control that uses MyCtrl.
How do I call functions of MyCtrl?
I can get the CWindow of that control but
I need the CMyCtrl object !!!
For regular controls I found the "atlcontrols.h" file
in the MSDN, but I don't know how to call functions
of a new control I wrote like:
m_myCtrl.SetBitmaps(IDB_HELLO);
Any help will be appreciated.
|
|
|
|
|
Your control is CONTAINED by the composite control. You need to expose the interfaces on your controls through the composite control, or have a method on the composite control that returns an interface to your control.
|
|
|
|
|
Hello,
I don't need a client to use the inner control. Only the composite control uses the ActiveX control.
I've dragged the control on to the composite dialog and now I want in the code of the composite dialog to call functions of
the control. How do I do that?
Thank you,
Penina.
|
|
|
|
|
Try GetDlgControl to get IUnknown for control your are interested in. It should be easy once you have IUnknown. As an alernative you can use custom windows messages to comunicate with hosted control.
HRESULT GetDlgControl( int nID, IUnknown** ppUnkCtrl );
|
|
|
|
|
Hello,
How would it be possible to "extend" any SIP of any appplication ? I mean I would like to insert a processing that would modify/verify each user input from any kind of SIP, of any application, before the input string is sent to the application currently owning the SIP.
Do I have to write a DLL, how could it work ? I plan this of course under Windows CE. Do one need something related to hooking (I know that is very restricted under Windows CE) ?
Thank's in advance.
--Francois
|
|
|
|
|
Hi,
Can I call COM object from device driver (from kernel mode)?
I would like to do is to load up COM, so I can hook it up later.
Thanks
BD
|
|
|
|