|
Hi, I have a custom control who have child windows (CWnd) I Know it is possible because we can insert a CButton in a control, CButton is him-self a drived-class from CWnd,
For CButton we have to override the OnDraw function, because this fucntion will be called (instead of the OnPaint commonly used) but this function does'nt exist in a CWnd and DrawItem dosn't seem to work...
ActiveX are hard to do, lot of things to thing and to know, the exception is a rules and what you used to do don't work anymore.
thanks for you'r help
Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
|
|
|
|
|
Hi,
I want to create a setup for my DCOM-Client Application.
The setup will be created using InstallShield-6.
Now, I dont want the end user to go through DCOMCNFG after
running my SetUp program.
I want my Setup Application to do all that as part of the
SetUp process.
Is it possible using InstallShield ??
Also, My client is a VB Application (I cannot use COM library
functions from within my client)
I am sorry if this post is Off-Topic in a DCOM Forum.
But please somebody direct me to a proper solution..
Thanks
Firoz
|
|
|
|
|
All DCOMCNFG does is set registry settings.
If you just want to do the simple settings such as RunAs=InteractiveUser, then installshield should be able to do it. However, if you are talking about setting up default security options, then you might have to do them programatically in a DLL you created called by installshield.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Thanks Tim.
Firoz
|
|
|
|
|
I'm having trouble getting VB to pass in a String into a ATL Object created with VC++ 6.0 -- I dont use MFC. Please help if ya' can! all i really need to know is how to pass in/return... I found some MSDN articles, but they werent using an ATL object. Thanks in advance...
SHABBA!!
|
|
|
|
|
if the string is input only, use "BSTR". if you need to change the string (output), use "BSTR *".
there are non-MFC classes that can help with BSTR manipulation, such as "bstr_t" and "CComBSTR".
a BSTR is COM's preferred string pasing method.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Sirs,
this is my first COM adventure so I need your advise.
I have an in process server with lots of interfaces and even more methods in it.
The manufacturer of the dll provides a sample code snippet of how to get pointers to all the interfaces:
HRESULT hr = ::CoCreateInstance(...
if ( !FAILED( hr ) ) {
hr = pIUnknown->QueryInterface(...
if ( !FAILED( hr ) ) {
hr = pIUnknown->QueryInterface(...
if ( !FAILED( hr ) ) {
hr = pIUnknown->QueryInterface(...
if ( !FAILED( hr ) ) {
...
...
} else {
...
}
} else {
...
}
} else {
...
}
} else {
...
}
Why are the QI calls NESTED? I tried putting them after each other but the same code taken from the nested structure didn't work (Runtime library: abnormal program termination) although all interfaces were succesfully created.
I would like to create the appropriate interfaces in my dialogs' OnInitdialogs and release in the OnDestroyWindow. Is that possible? Any sugggestions?
Thanks for your help in advance.
Bunburry
A subject that is beautiful in itself gives no suggestion to the Artist. It lacks imperfection. (O.Wilde)
|
|
|
|
|
The nested QI() calls are probably because the ability to QI a second interface depends on the success or failure of QI() of the first interface.
As to the dialog, OnInitDialog() and OnDestroyWindow() are perfect for creating and releasing COM objects in dialogbased applications.
I'm an alien, I'm an alien
it's a beautiful life....
Bush
|
|
|
|
|
I can't tell from your code snippet, but the "Here comes the code that uses the interfaces" part probably uses all three interfaces. Thus all three QIs have to succeed before that code can work.
And BTW it'll be easier to understand if you replace "!FAILED" with "SUCCEEDED"
--Mike--
http://home.inreach.com/mdunn/
"The Earth is doomed." -- Rupert Giles
your with and
|
|
|
|
|
I couldn't call CoUnInitialize function in ExitInstance or in class destructor(there will be crash), since I have COM interfaces (member variables)in application main class,(They are smart pointers),so a calling to COM interfaces release function will make the problem.
|
|
|
|
|
Hi,
If you are using Document/View Architecture, you can put your smart pointers as member variavles in the Document class. At that time you can call CoUnitialize() either in the Main App Destructor or in App ExitInsnance .
ShadiK
Shadi Al-Kahwaji
|
|
|
|
|
You don't have to. You call AfxOleInit() in your app's InitInstance() and that's it. MFC handles uninitializing COM when you app closes.
--Mike--
http://home.inreach.com/mdunn/
"The Earth is doomed." -- Rupert Giles
your with and
|
|
|
|
|
It doesn't solve my problem. The same crash will happen when the application releases smart pointers members.
|
|
|
|
|
Then call their Release() methods in your ExitInstance().
--Mike--
http://home.inreach.com/mdunn/
"The Earth is doomed." -- Rupert Giles
your with and
|
|
|
|
|
Please help! I am getting desperate.
Hello, here is my situation:
I have a normal C++ program that has an instance of a COM object (my own), IMyObject
I have another out-of-process COM server, which exposes a COM object IMyOtherObject. IMyOtherObject is held by my C++ program.
So, I end up with this in my C++ program:
void main()
{
IMyObject
IMyOtherObject
}
Now, IMyOtherObject needs to use IMyObject.
How do I pass IMyObject to IMyOtherObject?
Is this possible?
where should I look?
HELP
Jeremy.
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
If you are using MFC, you can use LPDISPATCH as the type in your odl file.
Use this to pass your other COM Interface
|
|
|
|
|
Hi,
If you cannot send the Interface becuase you don't find a data type to send it, then there is no problem. If you want to send IMyObject interface to IMyOtherObject interface, you have to define method to do this in IMyOtherObject like this:
STDMETHOD(SetIMyObjectInterface)(IMyObject *pMyObject);
The problem here that you might compile this using the .h and .c of the IMyObject, but you will face a problem inside the .IDL file, which is IMyObject is undeclared.
To solve this problem, move IMyOtherObject section in the IDL to the type library body:
library MYLIBLib
{
....
//Don't forget to import IMyObject type library here to define the IMyObject Interface
interface IMyOtherObject : IDispatch
{
SetIMyObjectInterface(IMyObject *pMyObject);
}
....
}
I guess this would help you to pass an com interface to another com component.
If this does not answer your question, please, re-phrase your question.
Regards,
ShadiK.
Shadi Al-Kahwaji
|
|
|
|
|
pass it as an IUnknown* then queryinterface for IMyObject when you get it.
|
|
|
|
|
I tied this (I am trying everything!)
Its the best results I got so far.
I pass the IUnkown* , and on the other side I queryinterface.
before passing IMyObject, I do this:
myObj.QueryInterface(IID_IUnknown,&pUnk);
Then I pass pUnk to IMyOtherObject.
This is how I do the queryinterface in IMyOtherObject:
pUnk->QueryInterface(__uuidof(IMyObj),reinterpret_cast _void**> &pMyObj))
However, when I queryinterface I get the error "The interface is unknown."
Am I doing it right?
Jeremy.
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
OK. I did some more research: (I bought Inside Distributed COM - Guy Eddon, Henry Eddon, MS Press).
A Very good book.
I came across a section: Marshalling Interface Pointers.
It says that taking an IMyObject interface pointer and return it to a client in another process is not possible. He says: "What constitutes a valid interface pointer in one apartment is complete gibberish in another."
I think will have to re-create the V-table and do some other stuff.
Jeremy.
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
You can generate a proxy stub DLL which will allow the interface to be marshalled. It is indeed very possible to pass interface pointers across, and it is very easy. I do it all the time.
For the answers to this, and pretty much any other question about COM, I would HIGHLY recommend Essential COM by Don Box as THE book on COM.
|
|
|
|
|
While doing some testing to make a bit of code bullet proof, I decided to use IsBadReadPtr to check if a BSTR is invalid. While everything for null and uninitialised BSTRs is fine, after calling SysFreeString, IsBadReadPtr still says that the BSTR is fine. Also multiple calls to SYsFreeString with the same BSTR succeed without error. I thought the memory was supposed to be allocated on the SysFreeString call?
Cheers,
Steve
Even if you're not paranoid, they might still be watching you.
|
|
|
|
|
IsBadReadPtr only checks that the pointer points into a valid memory page. After freeing memory the page in which the memory was may still be valid. Hence the "false" positive.
|
|
|
|
|
Does anybody have any examples of DCOM security configurations for XP in a workgroup? (Yes, they are different from 2000. The same settings I use on 2000 do not work on XP.)
I finally got the bloody thing to at least return an interface. But when I do a QueryInterface on that interface, I get E_ACCESSDENIED.
I ... AM ... GOING ... INSANE ...
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Hi ,
I have a questtion on microsoft-word appliaction.
I need to add my own icon to the existing ms-word application and when i click on that some message box should pop up. I don't know how to manipulate the existing ms-word application. Please help me how to do this.
and one more thing when i install some application like wordweb in my system that icon automatically adding to ms-word.and i write some text into word and select that after that when i click on that icon it is trying to find the meaning of that text. It is just an .Exe application.
so plz guide me how to do this.....
If u have any examples plz send me.
waiting for your early response....
Regards,
|
|
|
|