|
The dialog is created as a popup for my application which is already registered. I'm not sure how registering the dialog would help as it already has a message pump? Or maybe I don't understand what you mean? How can I use the dialog's message pump to custom draw the dialog? If I use WM_PAINT I can only draw in the client area of the dialog, right? If I set the dialog's border to "None" then I can basically draw the entire thing as long as I use a square bitmap... but I don't want it to be square, and if I draw the bitmap transparently I see the gray crap beneath it... isn't there a way I can just override the default drawing behavior of the dialog in the same way that I catch the WM_DRAWITEM message for my other custom controls? Thanks!
KR
|
|
|
|
|
What I'm saying is that if you want a dialog-like window that's totally user drawn then just make one: don't use the CreateDialog function and friends. If the dialog is to be modal all you have to do is disable it's parent and you may want to run a your own message pump.
Steve
|
|
|
|
|
Oh ok, I get it. Thanks!
KR
|
|
|
|
|
I need an Efficient Object Management Class to add, remove, get and set (Manage Actually) objects of my own class.
I read somewhere that std::list will do this job but i did not find the function for removing objects or get or set properties of existing objects.
Any suggestions?
|
|
|
|
|
Your question is not really clear but it sesems that you simply need some kind of container (std::list is a container class). Why do you call the an "Object Management Class" ?
Anyway, the way to access elements in a std::list is by using an iterator. The iterator overload * and -> operators that give you access to the object pointed by the iterator. To remove objects, simply erase the iterator (it has an erase member function).
But I suggest that you first read some tutorial about how to use those classes from the STL because it could be quite difficult to start with that without a good tutorial. Just google for it and I am sure you'll find plenty.
|
|
|
|
|
thanks for your help
|
|
|
|
|
Hi all in my application i have to do serial communication via port.
I want to populate my comboboxes of "databits' "parity" "stopbits' "bits per second" values as how the values are populated in the hyper termainal
can anybody please suggest me the possible values for those comboboxes population.
Thanks in advance...
|
|
|
|
|
|
Aren't the HyperTerminal comboboxes telling you?
modified on Monday, July 28, 2008 4:46 PM
|
|
|
|
|
In my applicationi would like to give the comboboxes and its values as how they will be available for the hyperterminal.
more or less like a hypertermianl values for baudrate,parity,databits,stopbits etc
|
|
|
|
|
So what is your exact question ? Because ass far as I read you only wanted to know which options you can provide to the user, and for that Luc's answer was correct. But apparently it wasn't because you (I guess) voted him down. So what are you looking for exactly ? What is your problem ?
|
|
|
|
|
Is there a way to get/enumerate the available sizes for a particular font ? heck, I don't even know if it does make
sense.
I only found example where the sizes are added manually (6, 8, 10, ...), but not automatically.
Not urgent.
Thanks.
Max.
This signature was proudly tested on animals.
|
|
|
|
|
MSDN:The EnumFontFamiliesEx function enumerates all fonts in the system that match the font characteristics specified by the LOGFONT structure. EnumFontFamiliesEx enumerates fonts based on typeface name, character set, or both.
Maximilien wrote: Not urgent.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks.
according to this[^] it can work for NON true type fonts.
For true-type fonts, it does not matter.
|
|
|
|
|
Hi i want to use the shortcuts for handling the menu operations in my application.
can anybody suggest me how to do that??????
For ex:if i click "ctrl+ space" window shud exit etc...
Thnaks in advance
|
|
|
|
|
Hi all i am new to vc++.
i want to have tooltips for the controls in my application but i am not able to generate the tool tips for the controls inside the group box using
ON_NOTIFY_EX(TTN_NEEDTEXT,0,OnToolTipNotify)
Can anybody suggest me the apt way for doing it..
Thanks in advance
|
|
|
|
|
I'm a newbie to MFC or even WIN32 GDI programming too.
I've tried your test.(Eg, deal with TTN_NEEDTEXT notification)
Yes, in the group box it doesn't work at all.
But indeed, we can figure out this problem by using ::CreateWindowEx, passing the TOOLTIPS_CLASS as the window class name,
This link would help you.http://www.codeproject.com/KB/cpp/Tool_Tip.aspx[^]
If you're using VC6.0, you'll encounter this compile error:
<br />
error C2065: 'TTS_BALLOON' : undeclared identifier
I haven't found an excellent resolution. And I googled, someone fixed this by adding this line(in the stdafx.h or somewhere):
<br />
#define TTS_BALLOON 0x40
If you found why 'TTS_BALLOON' showed undeclared, please reply my thread, I'd like to know too.
|
|
|
|
|
Excute me, I wanna to show multi-lines in the tooltips. I add '\n' in the text, it doesn't work.
Can somebody help me?
DWORD dwToolStyle = WS_EX_TOOLWINDOW | WS_EX_TOPMOST |WS_EX_WINDOWEDGE;
m_hwndTooltip = ::CreateWindowEx(dwToolStyle, TOOLTIPS_CLASS, NULL,
WS_POPUP | TTS_ALWAYSTIP | TTS_NOPREFIX | TTS_BALLOON,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
this->GetSafeHwnd(), NULL, ::AfxGetResourceHandle(), NULL);
ASSERT(m_hwndTooltip);
::SendMessage(m_hwndTooltip, TTM_ACTIVATE, (WPARAM)TRUE, NULL);
::SendMessage(m_hwndTooltip, TTM_SETDELAYTIME, TTDT_INITIAL, MAKELONG(1000, 0));
::SendMessage(m_hwndTooltip, TTM_SETDELAYTIME, TTDT_AUTOPOP, MAKELONG(1000, 0));
::SendMessage(m_hwndTooltip, TTM_SETDELAYTIME, TTDT_RESHOW, MAKELONG(1000, 0));
TOOLINFO info = {0};
info.cbSize = sizeof(TOOLINFO);
info.uFlags = TTF_CENTERTIP | TTF_IDISHWND | TTF_SUBCLASS;
info.hwnd = this->GetSafeHwnd();
info.uId = (UINT)::GetDlgItem(this->GetSafeHwnd(), IDC_APPLE);
info.rect = CRect(0, 0, 0, 0);
info.hinst = ::AfxGetResourceHandle();
info.lpszText = _T("You can check this to see\n\n\nwhat is this");
if ( !::SendMessage(m_hwndTooltip, TTM_ADDTOOL, NULL, (LPARAM)&info) )
{
::AfxMessageBox("Add tool fail");
}
|
|
|
|
|
Hi,
We have create a C++ DLL. While creating this DLL we have included "string.h" "vector.h" etc and so on...
We are able to compile and able to use exported functions in sample program with out any error.
We have distributed our DLL with .lib and .h files. He reports that when he includes our .h file in his program, it is not compiling (compile or link errors). He is tell this is boz because it has multiply defines. Is there any way to avoide this?
-Nandu
|
|
|
|
|
Nandu_77b wrote: We have distributed our DLL with .lib and .h files. He reports that when he includes our .h file in his program, it is not compiling (compile or link errors). He is tell this is boz because it has multiply defines. Is there any way to avoide this?
Yes. Before distributing your DLL,lib and H files to "him", test them in your own project before you distribute them.
led mike
|
|
|
|
|
first debugging, now testing.
What will you ask for next, documentation?
|
|
|
|
|
Luc Pattyn wrote: What will you ask for next, documentation?
Yes that was my plan. Then I was planning on asking for thinking next. I am trying to ease people into the concept.
led mike
|
|
|
|
|
probably because he is including your header several times, and because your header is not robust.
have you set an exclusive inclusion system in it (like the following) ?
#pragma once //depending on the compiler. not all support this
#ifndef __HEADER_H_INCLUDED__
#define __HEADER_H_INCLUDED__
#endif
|
|
|
|
|
Hi,
Thanks Toxcct,
Do i Need to add the below in my header file
//header.h
#ifndef __HEADER_H_INCLUDED__
#define __HEADER_H_INCLUDED__
//your header body here...
#endif
OR
Who is going to use the DLL should include my header as below?
#ifndef __HEADER_H_INCLUDED__
#define __HEADER_H_INCLUDED__
header.h
#endif
Which is the correct and best approach?
-Nandu
|
|
|
|
|
yes, you put the #ifndef construction in your own header.
now, each time the file is included, this stuff prevents the header content to be actually included more than once.
check this:
yourheader.h
<hr width="95%" />
src1.h:
#include "yourheader.h"
<hr width="95%" />
src1.cpp:
<code>#include "src1.h"</code>
#include "yourheader.h"
do you see what happens in src1.cpp ?
the user is including his own header (src1.h ), and your header (yourheader.h ).
but the problem is that in src1.cpp, when including yourheader.h , it is already included (by src1.h ), thus the "already defined identifier" error.
so by putting such a code in your own header, you prevent such an error to occur; if the header is #included several times in the same compilation unit, only the first inclusion will be taken in account...
|
|
|
|