|
I develop application in VC++ I need to use com dll in another com dll,is it possible??
Thnks
|
|
|
|
|
Of course. If your module supports a dual interface add a header file created by MIDL compiler to the project and you can use the powerful of vtable. If your COM module implements only IDispatch you have to generate a class derived from COleDispatchDriver ( by ClassWizard).
|
|
|
|
|
Hello every1!
I am looking at some sample code that microsoft is giving out with MSDN and i can't understand what is going on...if some1 knows it...
Here's the problem - the project palmap(can be found in any MSDN library) is a dll file that is used as an extension of aviview(a prog for viewing avi files and also can be found in the MSDN). A part of the source of palmap.c says:
typedef struct {
IAVIStreamVtbl FAR * lpVtbl;
ULONG ulRefCount;
//
// instance data
//
PAVISTREAM pavi;
PGETFRAME pgf;
AVISTREAMINFO sinfo;
HPALETTE hpal;
LPBYTE lp16to8;
LONG lLastFrame;
LPBITMAPINFOHEADER lpdibLast;
} PALMAPSTREAM, FAR*PPALMAPSTREAM;
There is something sneaky in this struct since IAVIStreamVtbl is defined nowhere(i checked the headers and tried to see if any IDLs exist). I searched the whole project directory for that string and there is no match. It is obviously the vtable and also has an interface prefix but i don't find any interface definitions too. BTW: i tried to look for the definition by clicking with the right button on the "IAVIStreamVtbl" and choosing "Goto definition...." but there is no brosing files with that project. After building the project there are no errors or warnings. so - Where could this IAVIStreamVtbl be defined?
Thanks for any reply!
Vladimir Ralev
|
|
|
|
|
Look for a #import statement. Look for xxxx_i.h file after the compile.
|
|
|
|
|
Are there any good code samples available on this site (or elsewhere) that I can use to get idea of the workings of a COM+ application? I already have a pretty good textbook understanding of COM+.
Thanks for your help!
|
|
|
|
|
I have out parameter as IUnknown** on the server side method
Method(IUnknown** ptrIUnknown)
Now on the client side , how do i call the method
i declared
IUnknown* pIUnk;
Then I call some method
Method(&pIUnk);
but IUnknown pointer does not get filled up
what is the mistake in this ?
parag
|
|
|
|
|
hi
I want some good samples on aggregation ?Where can I find links for this?
please help
Pathi
bhikshapathi_g@semanticspace.com
|
|
|
|
|
I am using visual basic to develop an application using a VB ActiveX dll I have created a multithreading tech. using window API function CreateThread(...) like this :-
------------------------This laid in XClass in the ActiveX dll-------------
lRet = CreateThread(0, _
0, _
AddressOf TheThread, _
0, _
0, _
lThreadID)
----------------------------This thread Function is laid in some module-------
Public Function TheThread(ByRef p As PARAMETER) As Long
On Error GoTo TheThread_Error
XClass.SpecialFunction Exit Function
TheThread_Error:
MsgBox ("TheThread had an error : " + Err.Description)
End Function
But there is a run time error message comes up say "CoInitialize has not been called"
Can some body help me.
Thanks.
|
|
|
|
|
You must initialize the COM libraries in each thread to be able to use it. If you need to do multi-threading I would give up on VB and use C++.
|
|
|
|
|
If I use Microsoft Agent 2.0 com Interface for programming,
(Microsoft Visual C++6.0)
how can I add a button or CheckList on WordBalloon like Microsoft Office Assistants?
if you know,Can you tell me?
Thank you !
|
|
|
|
|
I have written a program using the MSComm Active X component.
Now I'm on the point that I want to make an install shield
for this program. What is the best way to do this when I want
to register the MSComm component to the OS automatically?
Any tips and tricks are welcome.
Regards,
J hn
|
|
|
|
|
What version of Installshield are you using?
|
|
|
|
|
install shield for Microsoft Visual C++ 6.0
|
|
|
|
|
Hi John,
I wrote program with MSCOMM, too.
But my program have problem in sending and recieving data !!!
Of course i use of SetOutput() and GetInput(),
But ...
Can you explain to me, why ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have sent you examples by e-mail.
John
|
|
|
|
|
Hello,
I wrote a COM DLL with an interface: IMyInterface.
I added to the project a dialog (inherits from CDialog): CMyDlg.h and CMyDlg.cpp.
In the class of the interface I added:
CMyDlg m_dlg;
and when I call: m_dlg.DoModal()
it fails in DestroyWindow() inside the DoModal
function.
What did I do wrong?
I only need to open and close a regular dialog
through an interface!
Thank you,
Penina.
|
|
|
|
|
Does anyone knows how to change the format of
a pin?
I can change it in the GraphEditor, but I don't know how
to change it in code.
(I need to change the size of the frame to 320*240).
Thank you.
|
|
|
|
|
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
|
|
|
|