|
thanks for answer
but for me this metod propobly will be to slow because I must show more then 20.000 regions with brush and it must be quick
with "system brush" it works fine - very fast
with my custom brush without trasparent works fine - very fast too
but i will try your metod maybe it will be fast enough
one more time thx for answer
|
|
|
|
|
sorry for anonymous
I forgot login
previous message was from me
|
|
|
|
|
Given that a transparent brush does nothing, I assume you mean how to have a brush with an alpha value ( partly transparent throughout ), or masked ( fully transparent in part ).
The answer to both is that it's easy with GDI+, but needs to be done by hand, pixel by pixel using only GDI. If you can't use GDI+, you'll need access to the bits of the image, preferably by using a DIBSection, and then write code to do your alpha merging by hand. You can do the blitting with a mask without direct pixel access, but I tend to think the direct access method is faster, having done it myself both ways.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Hi,I want to monitor the actual downstream Bitrate, on Win 2k pro.
Thank you
|
|
|
|
|
I have a report view which I want to be able to sort.
I must have something wrong with the way I use
a pointer to a function. Here is the code:
- - - - - - - - - - - - -
This _should_ be in the global namespace, at least
when I start to enter "::" MSVC6++ offers me a list
of possible options and CompareFunc is listed there
and I can pick it
int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
if (lParam1 > lParam2) {
return -1; }
else {
return 0; }
}
- - - - - - - - - - - - -
This piece of code is inside a class derived from
ClistView
ListView_SortItems(
m_hWnd,
::CompareFunc,
0);
- - - - - - - - - - - - -
...and then I get error message:
error C2039: 'CompareFunc' : is not a member of '`global namespace''
|
|
|
|
|
MVH wrote:
at least
when I start to enter "::" MSVC6++ offers me a list
of possible options and CompareFunc is listed there
and I can pick it
Sometimes it gives you some stuff things.
Just guess:put your CompareFunc at the top of your CListView class,somewhere
before the place you use SortItems
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
That is exacly how I have done that.
I've even changed the CompareFunc to
int CALLBACK ::CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
and it still says the same. This ain't fun! *frown*
Any suggestions what to do or try?
|
|
|
|
|
This is sample code in MSDN:
static int CALLBACK
MyCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
CListCtrl* pListCtrl = (CListCtrl*) lParamSort;
CString strItem1 = pListCtrl->GetItemText(lParam1, 0);
CString strItem2 = pListCtrl->GetItemText(lParam2, 0);
return strcmp(strItem2, strItem1);
}
void snip_CListCtrl_SortItems()
{
extern CListCtrl* pmyListCtrl;
pmyListCtrl->SortItems(MyCompareProc, (LPARAM) pmyListCtrl);
}
I also check an example of CALLBACK,I put it after constructor of view class
and it work fine
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Are you by chance defining your CompareFunc function inside some namespace or class? I've tried to replicate your problem but everything works fine (i.e. CListCtrl::SortItems merrily accepts ::CompareFunc .) Could you post a little more code to see the thing in context?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I am getting a nagging feeling that I have misunderstood something totally wrong here...
This the file with the middle part snipped:
int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
// don't take this part seriously
if (lParam1 > lParam2) {
return -1; }
else {
return 0; }
}
// WsInfoView.cpp : implementation of the CWsInfoView class
//
#include "stdafx.h"
#include "WsInfo.h"
...yadda yadda yadda....
and then the ending of the file:
void CWsInfoView::DoFullList()
{
CListCtrl& ctlList = GetListCtrl();
ctlList.SetExtendedStyle(LVS_EX_GRIDLINES);
<snipped inserting="" items="" into="" the="" report="" view="">
ListView_SortItems(
m_hWnd,
::CompareFunc, 0);
}
CompareFunc is visible in MSVC6++ as "globals"
|
|
|
|
|
Ummm... You have defined CompareFunc at the very beginning of WsInfoView.cpp ? If so, please try moving it after the #include s.
I agree with you that the thing should work, but as it doesn't there's no option but to look for the unlikely.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thank you! It worked after I moved the CompareFunc
after #include "stdafx.h". I dunno why but it did!
I also had time to try that Microsoft example and I
(since I placed the functions the same way as earlier)
got the same error message.
Now I can go and eat in peace!
|
|
|
|
|
Well, the reason for this strange behavior is the manner in which VC++ manages precompiled headers (like "stdafx.h" ). For some reason, it seems to ignore everything that comes before the precompiled header inclusion. I think this is even a documented glitch.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I want to use #pragma warning().But where can I find the corresponding warning specifier?
Thx ahead.
|
|
|
|
|
Here's a complete list of VC++ compiler errors and warnings.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
I am designing and developing a voice and telephony related project with C programming and TAPI 2.0. I need a voice modem and use this modem to make a phone call. My question is as follows.
After I make a phone call, how, can I know somebody already "picks up" the phone call ? I need to know when or if somebody picks up the phone because my program needs to do audio playback on the phone.
Any response would be appreciated !
|
|
|
|
|
I guess you initiated the call with lineMakeCall . If so, after this function returns providing an HCALL for the call, the callback function the program registers with lineInitialize will start receiving notifications about the progress of the call. The connection establishment is signaled by the LINE_CALLSTATE message with call state param LINECALLSTATE_CONNECTED .
If you're new to TAPI programming you may want to have a look at Michael Dunn's TAPI site (this Michael Dunn is not the Michael Dunn from CP, I think.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks ! Your response really helps !!
|
|
|
|
|
A lot depends on the capabilities of your modem. Most modems send a Connected Call State as soon as they connect and the other end starts ringing, not when the person answers at the other end.
Michael
|
|
|
|
|
Hi.
I would like to create a custom class exception handler. I want to use it for arbitrary exceptions that are not part of the exception library.
I am having a problem with such a class. Here is the code for that exception class.
-----
#ifndef CEXCEPTIONHANDLE_H
#define CEXCEPTIONHANDLE_H
class ExceptionHandle
{
public:
ExceptionHandle(const char *error) : eMessage(error) {}
const char *what() const throw()
{
return eMessage;
}
private:
const char *eMessage;
};
#endif
-----
I basic want to *throw* a character string to the exception handle. Afterward, have a catch function to call what().
Here is an example of a try/catch.
----
try
{
function(x);
}
catch (ExceptionHandle *e)
{
cerr << e->what();
}
-----
function(int X)
{
if (X == 0)
throw ExceptionHandle("Error: X equals zero.");
}
-----
The program I am working on works, but it crashes whenever "throw ExceptionHandle("Error: X equals zero.");" occurs.
Does anyone know what is wrong with my design and/or implementation?
Thanks,
Kuphryn
|
|
|
|
|
I'm just guessing here, but a simple problem is the fact that you're storing a const char pointer in your exception class.
Regardless of the throw/catch stuff, when you call the exception constructor with the static text, all you're doing is setting your char * to point to the start of the "Error: X equals..." stuff. As soon as that goes out of scope, the memory allocated to the string is destroyed, and your const char * in the exception class will point at garbage.
Instead, either create a new char buffer and copy the string into it, or use a CString instead (it will keep a copy of the string for later use):
class ExceptionHandle
{
public:
ExceptionHandle(const char *error) : eMessage(error) {}
const char *what()
{
return (LPCTSTR)eMessage;
}
private:
CString eMessage;
};
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Okay. Thanks.
Oluseyi mentioned something about added "const throw()" to the constructor and derived it from exception.
I will try that and use a string instead of char * tomorrow.
I will post an update.
Kuphryn
|
|
|
|
|
Although the objection posed by Derek is IMHO a valid one, it is not what is causing the problem in your particular example. function throws an ExceptionHandle , whereas the catch block accepts a pointer to ExceptionHandle : thus it is not catching the exception thrown by function . Replace the exception handler with
catch (ExceptionHandle& e)
{
cerr << e.what();
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Okay. Thanks.
I believe the problem was due to these pointer related calls:
-----
const char *eMessage
-----
and/or
-----
catch (ExceptionHandle *e)
-----
I will do two things.
1) I will replace "const char *eMessage" with "const string eMessage."
2) I will replace "catch (ExceptionHandle *e)" with "catch (ExceptionHandle &e)."
First, is the problem caused by "*e" pointing to something that no longer exists? How can that be if I am throwing an exception each time?
I can also add "new" to "throw...new."
-----
throw new ExceptionHandle("test");
-----
Which ones of these changes should *fix* the problem most elegantly?
Thanks,
Kuphryn
P.S. A member at Gamedev mentioned about deriving exception classes from the *exception* library. How important is that?
|
|
|
|
|
In my MFC MDI App, I need to keep the pointer to the CFile object from CArchive in CMyDocument::Serialize (my override). This pointer must point to a valid object after the exit from Serialize, hence the use of a member variable to hold the CFile * returned from CArchive::GetFile()->Duplicate().
My question is: when my CMyDocument object is destroyed, what do I do with the CFile * I hold in my class.
Logically, I would flush the file and close it. closing it poses no problem, but the flush throws an exception. What do I do with the pointer? Do I call
delete on it?
Is there a more elegant way doing this?
Tx
Michel
|
|
|
|