|
that's EXACTLY what I'm trying to do...
I've tried calling parent's OnMeasureItem and then leaving itemHeight alone, but that doesn't help
nous sommes les maitres
nous sommes les esclaves
nous sommes partout
nous sommes nul part
nous maitrisons les lettres noires
|
|
|
|
|
Hi,
I'm kinda new to ATL and as such I'm after a little guidance
Say i want to be able to get Cheeseburger objects from Maccas. ie. A client would have to create a Maccas and then ask it for a Cheeseburger.
I can create the Maccas class using the ATL create object wizard, but i am unsure how i should create the stub code for the Cheeseburger object. Do i use the object wizard again? Would this not unnecessarily create a CoClass for the object and make it seperately instantiable (you don't have to get Cheeseburgers from Maccas anymore). How else do i do it?
In case it is important its desireable to support c++ and VB automation clients (scripted from office macros).
Thanks a bunch!
Alex
|
|
|
|
|
What I usually do is let ATL create it through the class wizard, then remove the stuff that I do not need.
So as you said, you do not want to create it using the CoClass object. Therefore remove the derivation from CComCoClass in your Cheesburger class. You will also need to go to the main cpp file of your project where the DLL entry point is located and remove the Cheeseburger entry from the
BEGIN_OBJECT_MAP map. This map tells the DLL which objects can be instantiated through CoCreateInstance.
That is all that you will need to do in order to prevent the object from being instantiated outside of your DLL. Then when you want to instantiate your class from the Maccas object, you will not be able to use new Cheeseburger because your class is still an abstract base class. You will actually need to do something like this:
<br />
CCheeseburger *pCheeseBurger = CComObject<CCheeseburger><br />
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thank you, thank you, thank you!
|
|
|
|
|
I have posted a question associated with the article announcing the 2.24 release of the grid. I thought I would include this link for any ATL wizards who may wish to consider the problem.
thanks
|
|
|
|
|
How can I implement a single MSMQEvent object to handle multiple queues??
|
|
|
|
|
Hi all,
I am using a program which generates values in hex and in order to plot I want to convert these values to decimals.
I wonder if there is any free editor which coverts hex values to decimals.
thanks for help
regards
/rsasalm
|
|
|
|
|
Hi again,
I forgot to mention that the program I am using, generates
the hex values in a file and it is a big file.
What I want is to paste all the hex values generated from the program and convert them to their corresponding decimal values.
Any help
regards
/rsasalm
|
|
|
|
|
I have a COM component DLL created in ATL and used on an ASP page. When I make changes and recompile I get a link error saying that it can't open the DLL for writing. The web server still has access to it. How do I stop and restart the web server?
This is on Windows NT4 Worstation + Option Pack.
I vaguely remember that I must do
net stop xxx
net start xxx
Kevin
|
|
|
|
|
You must do:
net stop w3svc
net start w3svc.
Best regards,
Alexandru Savescu
|
|
|
|
|
|
Download the kill.exe command (I guess from MSDN it should be ok),
then kill.exe w3svc will stop then restart IIS.
To avoid killing IIS all the time, I would suggest to make your COM component an out-proc, at least temporarily.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site. Support for development will ship at the same time as the Windows XP Service Pack 1 (SP1) release.
|
|
|
|
|
I use Process Explorer from www.sysinternals.com. It allows me to kill inetinfo when net stop w3svc says that the service cannot be stopped. However, in my activity of developing ISAPI extension I can crash inetinfo so badly that only a reboot will help.
Best regards,
Alexandru Savescu
|
|
|
|
|
|
If you store them using the following:
vector<A> myVec;
then the A1 and A2 instances will indeed be downcast to an A as you put them in. Storing pointers is the only way to get polymorphism. you'll also need to write a functor to use with for_each or similar to call delete on them when you're finished with the vector.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
is the method declared as virtual at all levels in the class hierarchy?
Can you consider making the declaration of the method in A a pure virtual method?
Just trying to keep the forces of entropy at bay
|
|
|
|
|
Hi,
I am looking for the simpliest way to make the status bar show help messages for toolbar buttons (just like in MFC apps). Is there (in WTL) some hidden feature that can be just enabled, or do I have to make it all myself?
Thanks for any suggestions,
Vlasta
|
|
|
|
|
Hello,
I am trying to create a "Windowed Only" ActiveX control in .Net Studio using ATL. I set the appropriate flag in ATL control wizard when adding a new class to my project. But it looks like it does not have any affect. My control still does not get any window messages and Spy++ indicates it has no window.
I tried to create two similar classes using wizard -- in one case I set "Windowed Only" flag, in another case I don't. Then I compared the generated code -- no difference.
What am I doing wrong? Please, help!
--Daniel
|
|
|
|
|
I have encountered this problem too.
Add this to your constructor:
m_bWindowOnly = TRUE;
It is a public member of one of the inherited classes which seems to do the trick. I do not know if this is how MS meant it to be, but it worked for me.
Vlasta
|
|
|
|
|
Where can I find a good tutorial to learn how to program Windows apps with ATL (WTL) and some basics about this 2 libs? I want use it to make apps for a pocket pc.
--
Nice greets, Daniel.
|
|
|
|
|
AFAIK there is no easy way to write WTL-apps for the pocket PC. I read 6 months ago or so about someone having ported WTL for Windows CE. Check out groups.yahoo.com/wtl[^]
--
Please state the nature of your medical emergency.
|
|
|
|
|
I've created an activex control using ATL, were my method calls the findwindow api. The container is passing the title of the window and I want to pass back the handle of the window to the container.
my idl contruct is setup like this
[id(1), helpstring("method FindWin")] HRESULT FindWin([in]BSTR lpWinName, [out, retval]long* retval);
Originally the return value was [out, retval]HWND* hWnd); but I had problems.
Can someone tell me if I'm in the right neighborhood on this?
That to return this value I do:
USES_CONVERSION;
LPSTR WinName = W2A(lpWinName);
HWND pHandle;
pHandle = FindWindow(NULL, WinName);
retval = (long)pHandle;
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
|
I just made a fresh install of Visual Studio 6 and I installed service pack 5. Then I added the WTL70 include files to the include directory of visual c and I tried to compile an example program.
I had exactly the same problem with windows 98, now I run Win2000 professional and I get the same problem again.
What more do I need to compile WTL with
#define _WIN32_IE 0x0500 ?
I did a MSDN search on 'LPNMREBARCHEVRON' but that didn't bring a solution...
--------Configuration: WTLExplorer - Win32 Debug---
Compiling...
stdafx.cpp
..\include\atlframe.h(273) : error C2146: syntax error : missing ';' before identifier 'lpnm'
..\include\atlframe.h(904) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<TBase,TWinTraits>' being compiled
..\include\atlframe.h(273) : error C2501: 'LPNMREBARCHEVRON' : missing storage-class or type specifiers
..\include\atlframe.h(904) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<TBase,TWinTraits>' being compiled
..\include\atlframe.h(273) : error C2501: 'lpnm' : missing storage-class or type specifiers
..\include\atlframe.h(904) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<TBase,TWinTraits>' being compiled
Error executing cl.exe.
WTLExplorer.exe - 3 error(s), 0 warning(s)
Thanks a lot in advance, this problem has been bugging me for ages now.
Kind regards, Griffith Sutherns
Everything you say will be misquoted, ripped out of context and used against you.
|
|
|
|
|
You need the Platform SDK installed. If you have it, check your VC Directories settings and make the PSDK install dir higher in the list than the vc98\include dir.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|