|
I want to write a NT Services with ATL.Can anybody tell me a link or tutorial about NT Services with ATL?
Thanks
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
|
Hi,
how can I create a popup menu and it should *not* be repositioned by Windows? At the moment my popup menu is repositioned when it would be party invisible (across desktop border. I need to avoid this in my current dialog, partly visible is really wanted!
thx for help.
|
|
|
|
|
I don't think this is possible. TrackPopupMenu() always ensures that the whole menu is visible. If the menu is taller than the screen, scroll arrows are added so the contents can be scrolled.
--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
|
|
|
|
|
|
Hi there dear coders...
how do I create a bold font from an existing font?
//CDC* pDC
CFont fontBold, *pFontOld;
LOGFONT lf;
VERIFY(pDC->GetCurrentFont()->GetLogFont(&lf));
lf.lf?????=1; //what do I set here???
VERIFY(fontBold.CreateFontIndirect(&lf));
thanks for your help!
|
|
|
|
|
From MSDN:
lfWeight
Specifies the weight of the font in the range 0 through 1000. For example, 400 is normal and 700 is bold. If this value is zero, a default weight is used.
The following values are defined for convenience:
Value Weight
FW_DONTCARE 0
FW_THIN 100
FW_EXTRALIGHT 200
FW_ULTRALIGHT 200
FW_LIGHT 300
FW_NORMAL 400
FW_REGULAR 400
FW_MEDIUM 500
FW_SEMIBOLD 600
FW_DEMIBOLD 600
FW_BOLD 700
FW_EXTRABOLD 800
FW_ULTRABOLD 800
FW_HEAVY 900
FW_BLACK 900
_____________________
"So in the interests of survival, they trained themselves to be agreeing machines instead of thinking machines. All their minds had to do was to discover what other people were thinking, and then they thought that, too."
Breakfast of Champions, Kurt Vonnegut
|
|
|
|
|
thx, i was confused by those many posibilities... I didn't get them, e.g. no idea what a FW_SEMIBOLD is.
now it works!
|
|
|
|
|
I find the documentation confusing sometimes myself.
I have not used any values for lfWeight besides the standard (regular and bold) ones, but I assume the other values are are for degrees of bold (which probably does nothing at normal point sizes).
_____________________
"So in the interests of survival, they trained themselves to be agreeing machines instead of thinking machines. All their minds had to do was to discover what other people were thinking, and then they thought that, too."
Breakfast of Champions, Kurt Vonnegut
|
|
|
|
|
Hi.
I would like to know is it possible to apply polymorphism to overloaded operators? For examples, is it possible to rely on polymorphism via creating virtual overloaded operators and friend functions?
Consider the ostream and istream for instance. I would like to design a hierarchy such as this.
-----------------------------------------------------------------------
Base *pB;
Derived *pD = Derived();
pB = dynamic_cast<base *="" />(pD);
// I would like this line to call an ostream friend function in the *Derived* class.
cout << *pB;
----------------------------------------------------------------------
My code might be off. Nonetheless, the point I want to get at is applying polymorphism to overloaded functions and friend functions, especially iostream.
Thanks,
Kuphryn
|
|
|
|
|
You can create virtual operators.
If you need to have a friend function in order to properly create the stream operator, you may simply want to create a function for the Base class, then create a virtual function in the Base class that gets called to actually generate the output.
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!
|
|
|
|
|
Okay. Thanks.
PaulWendt of CodeGuru posted an interesting solution from Scott Meyer's More Effective C++. The solution includes the use of an inline function calling a virtual function in the base class. Here is the link.
http://www.codeguru.com/forum/showthread.php?s=&threadid=209653
PaulWendt has me interested in Scott Meyers' More Effective C++. Is it a good C++ book? I have read C++ How to Program by Deitel&Deitel, The C++ Standard Library by Nicolai Josuttis , and The C++ Programming Language by Bjarne Stroustrup. Nonetheless, I hear recommendations for More Effective C++, but I have not given much thought to it until now.
Kuphryn
|
|
|
|
|
Greetings. Perhaps this isn't the best forum for this request, since it's not necessarily *Visual* C++, but what the heck.
I see some articles on CodeProject with sample SMTP proxies, but what I need is a sample POP3 proxy for Windows, in C++. So far searching all the "usual places" has turned up nothing.
I've been working on a sample COM Add-In for Outlook (in C++ of course) to provide anti-spam capabilities, and that part is working great. The actual anti-spam "engine" is a COM Object called from within the COM Add-In. Now I'd like to see if I can retrofit a POP3 proxy approach to complement the Add-In for Outlook, thus showing two different ways to achieve the goal.
Anybody know of any such sample POP3 proxy projects that I can take a look at?
Brad.
|
|
|
|
|
Be patient... I think Colin is working on just such a proxy server. Keep a watch on the article submissions...
|
|
|
|
|
I'm nothing if not patient. :->
Thanks for the heads-up. I get the weekly "newsletter" promoting the new/updated articles, so I'll keep an eye out. This is more of a pet project for me, luckily.
|
|
|
|
|
Hello,
I have never tried to use a Active X object in a MDI or SDI before.. I am trying to take advantage of a active x object in my SDI and for some reason (which I don't know) It will not run.. This is the error I get in debug mode.
Inside of WINOCC.CPP
....
ASSERT(m_pCtrlSite != NULL); // not an OLE control (not yet, at least)
....
Is there some special way I am supposed to use Active X controls in a SDI??
I simply added the control through projects -> Add to Project -> comps and controls.. It added all the .cpp and .h files I needed.
Then in MainFrm.h I added a reference to the object..
...
CActiveXcontrol m_pControl;
...
now when I try to use it in MainFrm.cpp everything compiles fine but I get the ASSERT error upon launching..
I'm sure there is some dumb reason that this is erroring...
Any ideas?
Rob
|
|
|
|
|
Never mind I figured it out.
|
|
|
|
|
I just (for the heck of it) compiled a project I've been working on for some time on warning 4. I always leave the default of warning 3. My project does produce some warnings because of a few mixes of BOOL and bool types... anyway... so there I am, minding my own business, compiling at level 4, and I get something like 311 warnings. 308 of them were in Microsoft's standard built in header and source files- like fstream!
What's up with that?!?
Paul
|
|
|
|
|
Sounds like VC6. hehehe
That version of Dinkware's STL port is known to not want to build at warning level 4. Hopefully the version included in VC7 is better.
Tim Smith
"Programmers are always surrounded by complexity; we can not avoid it... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather that part of the solution."
Hoare - 1980 ACM Turing Award Lecture
|
|
|
|
|
You can use follow method to avoid some warning:
int a;
#pragma warning( disable : 4705 )//stop warn 4705
void func()
{
a;
}
#pragma warning( default : 4705 )//recover it
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
Paul Oss wrote:
308 of them were in Microsoft's standard built in header and source files- like fstream!
That's STL for you. You can ignore all that cruft safely.
--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
|
|
|
|
|
I wanted my indicator for the image to be positioned like this:
static UINT indicators[] =
{
ID_SEPARATOR,
ID_INDICATOR_RAINBOW,
ID_INDICATOR_TEST,
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
but this positioned it after the _TEST indicator, though I did:
inx=CommandToIndex(ID_INDICATOR_RAINBOW);
GetItemRect(inx,&rect);
m_WzdProgressCtrl.MoveWindow(rect);
So I had to position it before the seperator and then it showed up predictably as the first panel.
Why, any ideas, the bizarre positioning? It actually cut into the space occupied by _TEST indicator.
|
|
|
|
|
Hello,
I've created a simple doc/view application using a list view in report mode
with 2 columns with the extended styles LVS_EX_FULLROWSELECT and
LVS_EX_INFOTIP set via:
DWORD dwStyle = GetListCtrl().GetExtendedStyle();
GetListCtrl().SetExtendedStyle(dwStyle|LVS_EX_FULLROWSELECT|LVS_EX_INFOTIP);
in OnInitialUpdate().
The MSDN Documentation says:
"This notification is only sent by list-view controls that have the
LVS_EX_INFOTIP extended style. The LVN_GETINFOTIP notification is sent for
sub-items while in report mode only when the LVS_EX_FULLROWSELECT extended
style is in use."
I've added my message map:
ON_NOTIFY_REFLECT(LVN_GETINFOTIP, OnGetInfoTip)
and the function:
void CInfotipView::OnGetInfoTip(NMHDR* pnmhdr, LRESULT* pResult)
{
NMLVGETINFOTIP* pnmlvgit = (NMLVGETINFOTIP*) pnmhdr;
ASSERT(pnmlvgit);
}
When I run the application, I DO get an InfoTip notification when
positioning the mouse overtop of the 1st column in the list view BUT NOT
over the 2nd column. MY understanding (and correct me if I'm
misunderstanding the documentation) is that with LVS_EX_FULLROWSELECT set, I
should also receive a notification when positioning the mouse overtop of the
2nd column.
I have tried testing this both compiling with Visual Studio 6 & 7 and
running the test under both Windows 200 and Windows XP.
Any help is greatly appreciated.
Thanks,
Chris Holt
|
|
|
|
|
I'm following a sample project and they are creating a progressctrl in the staus bar: After defining a progressCtrl object in the mainframe, they have:
int CWzdStatusBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CStatusBar::OnCreate(lpCreateStruct) == -1)
return -1;
CRect rect(0,0,0,0);
m_WzdProgressCtrl.Create(WS_CHILD|WS_VISIBLE,rect,this,IDC_WZD_PROGRESS);
return 0;
}
What I'm puzzled by is where is IDC_WZD_PROGRESS generated. They didnt draw it on any dialog or anything. Yet there is an entry
C:\swanke\A31\RESOURCE.H(9):#define IDC_WZD_PROGRESS 104
The only ID_ s I have seen generated have been for a control drawn on some dialog form, and the resource.h gets the entry automatically.
I hope you can see my dilemma,
thanks,
ns
|
|
|
|
|
int CPaletteStatusBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CStatusBar::OnCreate(lpCreateStruct) == -1)
return -1;
CRect rect(0,0,0,0);
m_THBImageRainbow.Create("Rainbow", WS_CHILD, rect, this, IDC_THBIMAGERAINBOW);
return 0;
}
I havent drawn the image control anywhere, and the compiler says:
C:\PaletteStatusBar.cpp(43) : error C2065: 'IDC_THBIMAGERAINBOW' : undeclared identifier
So how do I generate this IDC ?
Very confused...
|
|
|
|