|
Amidst of development of toolbar, a requirment came to colour toolbar.
As we can colour explorerbar easily with OnPaint, we can colour the
toolbar also,but after colouring the Toolbar buttons Vanish. Code is totally
based on ATL\ COM and not MFC.
The reason I found is NM_CUSTOMDRAW not getting called . Even if I
post the message WM_ERASEBKGND.
Can anyone tell how to overcome this problem. Even if we call
TB_INSERTBUTTON at end of OnPaint it does not prove fruitful.
-- modified at 8:38 Monday 16th April, 2007
|| ART OF LIVING ||
|
|
|
|
|
Purpose is to prevent writing sensitive data to hard drive, so after shutting down the computer, sensitive data will be lost (in RAM) THANKS A LOT FOR YOUR REPLY
marcelse
|
|
|
|
|
Hi.
Let us say, we have a banner on some site, embedded as a flash object. In my BHO I need to catch some events from this banner. I do this way:
1. Wait until the document is completed.
2. Enumerate all OBJECT elements.
3. On the needed element perform this:
Code:
<br />
CComQIPtr<IHTMLObjectElement> pObj=pElem;<br />
CComPtr<IDispatch> pD;<br />
pObj->get_object(&pD);<br />
if (pD==NULL) return;<br />
CComObject<CFlashSunk> *sink;<br />
sink=new CComObject<CFlashSunk>();<br />
<br />
CComQIPtr<IConnectionPointContainer> pCont;<br />
HRESULT hr;<br />
pCont=pD;<br />
CComPtr<IConnectionPoint> pPoint; <br />
hr = pCont->FindConnectionPoint(ShockwaveFlashObjects::DIID__IShockwaveFlashEvents, &pPoint);<br />
if (FAILED(hr)) return;<br />
DWORD dwCookie;<br />
hr = pPoint->Advise((ShockwaveFlashObjects::_IShockwaveFlashEvents *)sink, &dwCookie);<br />
if (FAILED(hr))return;<br />
4. Here the class CFlashSink:
<br />
#import "C:\\WINDOWS\\system32\\Macromed\\Flash\\Flash.ocx" named_guids <br />
<br />
#include "Debug\Flash.tlh"<br />
<br />
class ATL_NO_VTABLE CFlashSunk :<br />
public CComObjectRootEx<CComSingleThreadModel>,<br />
public CComCoClass<CFlashSunk>,<br />
public IDispatchImpl<ShockwaveFlashObjects::_IShockwaveFlashEvents, &ShockwaveFlashObjects::DIID__IShockwaveFlashEvents,&ShockwaveFlashObjects::LIBID_ShockwaveFlashObjects> <br />
{<br />
<br />
public:<br />
<br />
<br />
BEGIN_COM_MAP(CFlashSunk)<br />
COM_INTERFACE_ENTRY(IDispatch)<br />
COM_INTERFACE_ENTRY(ShockwaveFlashObjects::_IShockwaveFlashEvents) <br />
END_COM_MAP()<br />
<br />
<br />
<br />
STDMETHOD(Invoke)(DISPID, REFIID, LCID, WORD, DISPPARAMS*,VARIANT*, EXCEPINFO*, UINT*); <br />
<br />
<br />
<br />
<br />
STDMETHOD(OnReadyStateChange) (long newState); <br />
STDMETHOD(OnProgress) (long percentDone);<br />
STDMETHOD(FSCommand) (BSTR command, BSTR args);<br />
STDMETHOD(FlashCall) ( BSTR request);<br />
};<br />
Problem: neither in Invoke nor in FSCommand nothing comes at all!
Where is the trouble ?
|
|
|
|
|
HOW TO SEND AND RECEIVE SMS BY PC
I WILL BE THE FIRST
|
|
|
|
|
hi,
Can any body tell to me, how i add a checkBox in MMC snapin(Throught ATL)in result Pane.Plz help me.
thanks in advance....
Monica
|
|
|
|
|
I am using the command line to pass values. The values are numbers or "ni" for negative infinity (& pi for positive).
This is my code:
if (argv[1] == "ni")
But it fails. It never evaluates to true . Why is this? "ni" is a char array and so is argv[], is it just me or is something going on.
I tried this on Windows and Unix and the same thing happened.
Download here[^] for the full source
|
|
|
|
|
That's not how you compare C-style strings. Use strcmp() instead.
|
|
|
|
|
yes, i fixed the problem. I just converted to string.
I forgot that C-strings are just pointers, so you are actually comparing the memory locations. However, i could have sworn i had seen it written before (unless it was to specifically compare memory locations)
Customer in computer shop: "Can you copy the Internet onto this disk for me?"
|
|
|
|
|
We have built a com based application in VC5, VC6 in debug mode & works fine.
when migrated to VC++ 8.0, com register class is failing.
VC6 binary is built which atl6.0.dll and works fine. but when the application is built with atl8.0 com register class is failing.
We are using CComModule class in atl6.0. But it looks like the same class is change to CAtlComModule in atl8.0
Is there any option which will enable backward comptible in atl8.0?
Thanks
|
|
|
|
|
You need to read the documented breaking changes that have been put in effect in ATL version 7. There were very few notable changes from 7 to 8! CComModule was replaced with several different module classes: CatlModule, CatlExeModuleT, CatlDllModuleT and CatlServiceModuleT. According to "ATL Internals", Second Edition, page 811:
<quote>..., there's not much to be gained in removing your ATL 3 modules and replacing them with the ATL 8 modules when you migrate your project. ... If you need (...) to rewrite the module-related code in your ATL 3 server to match and ATL 8 server, your best bet is to run the new VS05 wizard with the names and settings you need and then move over your ATL 3 classes.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I need to convert a UTF8 string (stored in a std::string) to a UTF16 string (and store the result in a std::wstring) and vice-versa, in a portable way (so ::MultiByteToWideChar, etc. are out of the question). Anyone have any tips, pointers to samples, etc.? I am currently porting a Windows app to Linux (!) which uses the STL/Boost, and this is one area where I would appreciate some advice.
|
|
|
|
|
I am not 100% certain..but it wouldn't surprise me if ICU[^] had UTF8 <-> UTF16 converters. In fact, with a little help from Google, we find this page[^] that says:
ICU provides UTF-8↔UTF-16 transformation functions. (u_strFromUTF8() and u_strToUTF8() in unicode/ustring.h )
HTH!
|
|
|
|
|
See my signature
|
|
|
|
|
Hi.
I'm writing a small Windows CE ActiveX app using an ActiveX container class "based on a Button" (generated by the Wizard). This "CMyButton" class has a CContainedWindow member, m_ctlButton, and I am overriding the OnDraw() method to hand-draw the button with rounded corners. CMyButton also handles WM_LBUTTONUP and WM_LBUTTONDOWN to do some other special stuff. This all works fine, however....
I'm accepting input from an alternate source (a controlwheel) and want to controlwheel press handler to force a button click down to my ATL button class. Problem is, I need the actual m_ctlButton (the contained ATL button control) to receive the button click message so it does it's normal button-ish stuff and then passes WM_LBUTTONUP/DOWN up to the container. Here's where I'm stuck.
One thing I tried was to create a COM interface in CMyButton that the controlwheel handler calls. This works. Then I thought in that interface method I could just force the contained CContainedWindow member to "click". So in the CMyButton::ButtonPress interface method I've tried things like:
::SendMessage(m_ctlButton, WM_LBUTTONDOWN);
SendDlgItemMessage(controlID, WM_LBUTTONDOWN);
PostMessage(WM_LBUTTONDOWN);
Problem is, all of these just post the message to the container. It's not like the contained ATL button actually gets presses. So my question is, how can I cause the actual contained button to click? If I can do that, the normal button-ish stuff will happen, the contained button will pass WM_LBUTTONDOWN up to the CMyButton container, and everyone will be happy (me included!). Can someone give me some advice here?
Thanks,
Mark.
Mark Malin
Software Developer
GE Healthcare
|
|
|
|
|
hi all,
I have a series of JPEG file coming from a source. I have to create a MPEG file from the series of JPEG file, which can be played in Media Player. How can I do this. What algorith i have to use or else i have to use COM and ActiveX control for the same. Can u give any idea regarding this.
Thanks and Regards
Yudhisthira Attry
|
|
|
|
|
hi. I create a web form with c# asp.net but I cant locate mouse position with c#. please help me.
|
|
|
|
|
Hi All,
I need to write some Composite control in my ATL project.
My question is how i control the GUI ?
What I mean is - in MFC i define some control variable that i can control the GUI control in easy why - can i do it also in Composite control ?
Until now i use "ListView_SetColumn" or those command to change/add/find something in my list Control - but this way is not the simple way - does there is some simple way to use the control ?
I also could not do casting from the control the list view type.
Thanks for any help.
|
|
|
|
|
ListView_SetColumn is how things were done in C. I thought ATL offered some wrapper classes for UI ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Can you please explain ?
How its can be done in ATL ?
I realy need help with that.
Thanks.
-- modified at 4:57 Wednesday 28th March, 2007
|
|
|
|
|
I am trying to display data from a list box and an entry field in list box. how do i do that?
|
|
|
|
|
Wow Use a vector
#include <vector>
std::vector<vbidiot> _vbidiots;
_vbidiots.push_back( denilda82);
My code assumes vbidiot has a copy constructor... it must
led mike
|
|
|
|
|
hi everyone,
i created a custom COM component (.exe) which is used by another .dll. i compiled the both components fine, including the code snippet below; but i get a runtime access violation error on line of exe->Dummy() after CoCreateInstance returns S_OK. it gives different addresses for each different method of the .exe component i try.
this code is inside a method of the .dll component
HRESULT hr = 0;<br />
ATLVERIFY(SUCCEEDED(CoInitialize(NULL)));<br />
ATL::CComPtr<ISomething> exe; <br />
hr = exe.CoCreateInstance(CLSID_Something,NULL,CLSCTX_LOCAL_SERVER);
ATLASSERT(SUCCEEDED(hr) && exe != NULL);<br />
ATLVERIFY(SUCCEEDED(exe->Dummy()));
exe.Release();
My .exe component is non-attributed just like the .dll (not sure if it makes any difference), i have built and registered the proxy-stub class fine, and also my .exe file is registered with "exe /RegServer".
i think there is one more thing to be done but just couldn't find out what. if it were the registry script or something, i shouldn't be getting an instance of the .exe component. any ideas ? please have some !!
-- modified at 14:18 Thursday 22nd March, 2007
edit: i converted the .exe interface to be non-dual (it was a dual interface before) and this time exe->Dummy() returns "A null reference pointer was passed to the stub."
|
|
|
|
|
CComPtr is a template and its argument is the interface it should contain, e.g. CComPtr<IDispatch> . It looks like you have omitted the interface UUID. It could be a posting error and that "<" and ">" were interpreted as HTML tags.
Have you tried using the DLL version as an inproc server?
If you haven't, please do so and tell us what happens.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
i created another project whose proxy-stub is merged and now the problem is resolved into another one:
i use HKEY in some of the functions as in and out parameters (they use registry keys), and my IDL file thinks HKEY is void *, contrary to the caller class, which sees HKEY as struct HKEY__* (as it should). i think this causing inconsistency between the client and the server, since i get "bad variable type" (or something similar) from CoCreateInstance only when there is a method with a parameter typed HKEY in the server.
i tried redeclaring HKEY in IDL file,including winnt.h but no luck. any hope here?
|
|
|
|
|
I'm confused about what you're doing. If you're doing what I think you are, in my opinion you've complicated things more than necessary.
In your first post you said that the interface was originally a dual interface. This means that it inherits from IDispatch, but a client would have the ability to call the interface methods through vtable calls. There are two major benefits from using an interface that inherits from IDispatch: (a) a wide variaty of clients can use it such as IE and (b) you can rely on typelib marshalling so you don't have to distribute your own proxy-stub DLL.
Both (a) and (b) requires that your interface is automation compatible, i.e. the oleautomation attribute is added to the interface declaration in the IDL file.
This also implies that you can only use data type that conforms to automation, i.e. data types that can be represented by a VARIANT . A HKEY cannot be represented in a VARIANT , thus you cannot use it; it won't even make it through the MIDL compiler.
Another thing that bothers me is more a design issue.
Originally you're creating a out-of-process server. Why would you open a registry key in one process and simply hand it over to another process? I have no idea what the server should do with the registry key, but I suggest that whatever it is it should be given a path where the modifications should be done and open the registry solely.
Suppose that the exe-server is distributed to another machine, then it wouldn't even be the same registry.
So I guess it's about two questions:
1. What is the server supposed to do with the registry?
2. What are the limitations of the server in the aspect of automation and distribution?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|