|
I have create a atl propertypage, and use OleCreatePropertyFrame to create a framework for it. When I open this propertypage, press F1 on it, no help message is appears, why? And how can I let this function work, who can help me?
I have use Spy to monitor the message, the framework has received this WM_HELP message. If I add one EDIT in the propertypage and set the focus to it when open this propertypage, press F1 can get the help message, why this occurs?
Thanks very much.
I had written n bugs today.
|
|
|
|
|
I know HOOK can resolves this issue, but is there any other way to resolves this?
|
|
|
|
|
I added CAxDialogImpl to an ATL project using (insert -> new ATL object -> misc ... -> dialog).
I also added Web Browser ActiveX control to this dialog. I tried to catch Web Browser's events by simply going to the dialog box resource and right-clicking 'events' but I didn't work. For some reason I was not able to catch any of the Web Browser events.
Then, I tried to convert the dialog into a COM object by adding CComObjectRootEx, CComCoClass, IDispEventSimpleImpl ... but it didn't even compile!
How do I implement CAxDialogImpl derived control that hosts a web browser and sinks its events?
THANK YOU VERY MUCH, any help will be appreciated
andreytab@hotmail.com
|
|
|
|
|
|
Hi,
I'm new to COM and ATL so I think this is a simple question!
How can I add my structs and enums to my type library?
I'm using the export attribute like this:
<br />
[export]<br />
typedef enum<br />
{<br />
MyEnumValue = 1,<br />
}MyEnum;<br />
this creates the enum in the auto generated idl file, but doesn't show up in the type library.
What am I missing?
Thanks!
|
|
|
|
|
I had this problem about a month ago as well.
I found a way around it by actually creating a method that has the enumeration variable as a parameter (but actually does nothing). The presence of a method that uses the enumerator seem to export it to the final library.
This is definitly not a solution, just a workaround, and I have no idea why this works; so If anyone wants to enlighten me..feel free.
I Dream of Absolute Zero
|
|
|
|
|
Do you need to put your struct and enums under "library " section of you IDL as well ???
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|
|
When I run my WTL program I get a resource leak in atlframe.h line 1225:
HWND CreateEx(HWND hWndParent = NULL, ATL::_U_RECT rect = NULL, DWORD dwStyle = 0, DWORD dwExStyle = 0, LPVOID lpCreateParam = NULL)
{
const int cchName = 256;
TCHAR szWindowName[cchName];
szWindowName[0] = 0;
#ifndef _WIN32_WCE
#if (_ATL_VER >= 0x0700)
::LoadString(ATL::_AtlBaseModule.GetResourceInstance(), T::GetWndClassInfo().m_uCommonResourceID, szWindowName, cchName);
HMENU hMenu = ::LoadMenu(ATL::_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));
#else //!(_ATL_VER >= 0x0700)
::LoadString(_Module.GetResourceInstance(), T::GetWndClassInfo().m_uCommonResourceID, szWindowName, cchName);
HMENU hMenu = ::LoadMenu(_Module.GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));
#endif //!(_ATL_VER >= 0x0700)
I'm using WTL 7.5 and ATL 3.0. Is the leak because the two are incompatible? If so, how do I update ATL? I only found ATL 2.0 on the MS web site.
-thanks.
|
|
|
|
|
What is RPC? How we implement that?
|
|
|
|
|
RPC = Remote Procedure Call.
How you implement it is up to you. You can use DCOM or CORBA a google search will give you tons of information on both of these RPC implementations
Forever Developing
|
|
|
|
|
Will anybody explain me the difference between COM and ATL
|
|
|
|
|
ATL is merely a template class library designed to make COM development easier or at least quicker - does most of the boilerplate code for you.
Kevin
|
|
|
|
|
Kevin McFarlane wrote:
ATL is merely a template class library designed to make COM development easier or at least quicker - does most of the boilerplate code for you.
Please Don't Mind,from whatever I know, Com is mere Specification and Win32api are Application program interfaces.
you can't treat Com and Win32 to MFc and ATL
|
|
|
|
|
hmm...
The same difference that is between programming in Platform SDK and MFC
ATL is a set of classes used to make COM Programming *easier* (some purists might disagree and call ATL Spaghetti programming)
hope this sheds some light on the subject, get a good book or read some articles
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
COM is a specification for creating binary reusable components.
To develop these components, You implement COM specification in a programming language like C,C++,JAVA,VB, etc
ATL is template library that helps you code/develop COM components faster. It uses Templates extensively.
I hope this helps
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi,
I have an instance of a CTreeViewCtrl. I initialise it like so:
CTreeViewCtrl tree = GetDlgItem(IDC_TREE1);
I have set show "Check Boxes" to true for my tree in the resource editor and they are displayed. However when I add an item and then set the check state like so:
HTREEITEM item = tree.InsertItem(name, TVI_ROOT, TVI_LAST);
tree.SetCheckState(item, TRUE);
The change isn't shown in the GUI. Is there something else I have to do?
I am using VC7 and WTL 7.5 build 4291.
Thanks in advance.
|
|
|
|
|
This is a problem I remember having a while back, so I checked out some of my old code. I found this in one of my classes:
<br />
<br />
m_myTreeCtrl.ModifyStyle(TVS_CHECKBOXES,0);<br />
m_myTreeCtrl.ModifyStyle(0,TVS_CHECKBOXES);<br />
<br />
... later on in code ...<br />
<br />
m_myTreeCtrl.SetCheck(hTreeItem);<br />
<br />
Try using the ModifyStyle fix and see if it works for you.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
That worked perfectly. Thanks a lot for that, it was giving me a real headache!
|
|
|
|
|
HI All,
My problem is related to the COM out-proc exe.
I have a COM server(EXE) which has 2 interfaces:-
ISingletonTest - This inteface acts like an entry point for the server.The component class is made singleteon by using the DECLARE_CLASSFACTORY_SINGLETON().This will be created only once.There is function getTest() in this interface which returns the pointer to second interface(ITest). Now as cllient only passes the uninitialized pointer of ITest , i make a call to CoCreateInstance() for intiliaizing the CTest component class.
The problem is when i call the function getTest(ITest *pVal) and i do some work and set this pointer to null it calls its destructor but it doesn't fress the main interface i.e ISingletonTest pointer.
As a result my out-proc exe never gets unloaded.
Ina nutshell could you explan why the module gets locked when i create a COM object in the process of my COM server.Is there any specific care to be taken care of while doing such programming.
Please provide your suggestions as soon as possible.I have strucked badly on this problem.
Thanks in advance.
Deepak
|
|
|
|
|
Having recently discovered the joys of STL, I have set about using it in my projects with gusto. I particularly like auto_ptr, but I have a newbie query. When I try and assign a new value to an auto_ptr, I am getting the following VC7 warning (I am using level 4):
warning C4239: nonstandard extension used : 'argument' : conversion from 'std::auto_ptr<_Ty>' to 'std::auto_ptr<_Ty> &'
For example:
std::auto_ptr<CMyClass> ap;
...
ap = std::auto_ptr<CMyClass>(new CMyClass);
However, the following code doesn't generate the warning:
std::auto_ptr<CMyClass> ap;
...
std::auto_ptr<CMyClass> new_ap(new CMyClass);
ap = new_ap;
Any clues how I can avoid this warning? Note that CMyClass might look something like:
class CMyClass
{
public:
...
CMyClass(void) { ... }
CMyClass(const CMyClass& o) { ... }
};
The Rob Blog
|
|
|
|
|
Welcome to the wonderful world of STL
As for std::auto_ptr , be sure to read this article[^] before using it - its copy semantic is "unusual" and it can cause problems. In fact, I prefer Boost smart pointers in my code - they are safer.
To try to answer your question, I believe you get the warning because the way assigment operator is declared in auto_ptr :
auto_ptr<_Ty>& operator=(auto_ptr<_Ty>& _Right) _THROW0()
{
reset(_Right.release());
return (*this);
}
As you can see, it takes a reference as the argument, not a const reference.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
I keep hearing about Boost - and I must admit, not being able to use auto_ptrs in STL containers is a real shame.
So now's your chance to sell me Boost - what else am I missing out on apart from a better auto_ptr?
Any suggested hacks for my auto_ptr assignment issue?
The Rob Blog
|
|
|
|
|
Just found a solution thanks to your link - 'reset' does the trick - reset(new CMyClass).
The Rob Blog
|
|
|
|
|
|
Hi All,
I have been trying to create a toolbar for Windows Explorer, I used the Wizard provided by Eric and the basic thing was there. I have got a button on the toolbar I need to know which file or files were selected int the explorer view when the button was clicked.
for more calrification it is just like the standard buttons of copy and paste, when we select some file and press copy it gets the name of the file, same is the thing I want to perform.
I have tried using IWebBrowser2 and the use the get_Document method of it but I dont know what I would be doing further
regards
Muhammad Aftab Alam.
|
|
|
|