|
A wireless bitmap is, like the small brother of a normal bitmap, small, primitive, monochrom, and on top of all it is of different structure than *.bmp because no MS tool (including IE or Paint) is able to show it.
It is used on wireless devices (handy). WAP pages are written in so called WML (Wireless Markup Laguage) and they can only have references to *.wbmp pictures.
I would want to show these pics on IE if I knew how to convert them to human readable format.
R.
|
|
|
|
|
this will do it: http://www.smalleranimals.com/thumb.htm
there's code on the codeproject site, too (i think), if you need that.
-c
bit, n:
A unit of measure applied to color. Twenty-four-bit color refers to expensive $3 color as opposed to the cheaper 25 cent, or two-bit, color that use to be available a few years ago.
|
|
|
|
|
The question came up today in our shop "can I call one constructor from another just like I can in java" and 'out of curiousity' tried to figure out if it can be done...After a few attempts (at what I thought were direct 'and sensible' approaches that only made the compiler whine) I came up with the following....Now, don't get me wrong, I'm not advocating that anyone *should* do this....only that it appears that you can and that it looks like it 'works'....
#include "stdafx.h"
#include "stdlib.h"
int flag;
class CtorTest
{
public:
CtorTest( void )
{
int x = 1;
}
CtorTest( int iFoo )
{
new( this ) CtorTest;
int x = 2;;
}
~CtorTest( void )
{
int x = 1;
}
void operator delete(void* p, CtorTest* poOuter)
{
free( poOuter );
}
void* operator new(size_t s, CtorTest* poOuter )
{
return poOuter;
}
};
int main(int argc, char* argv[])
{
printf("Hello World!\n");
int aNum = 5;
CtorTest x( aNum );
return 0;
}
Just trying to keep the forces of entropy at bay
|
|
|
|
|
okay, thought a little explanation is due here as well.....in main() we get a CtorTest object and the CtorTest::CtorTest(int) constructor gets called. Then we jump into the placement new function that effectively returns 'this'....Then from that point, we jump into the CtorTest::CtorTest(void) function ( invoked right after the return from the local placement new function. After that, control returns to the 'first constructor' call and we return to main. To support the assertion that there is only one CtorTest object created (?), the destructor is only called once......strange...very strange...
Just trying to keep the forces of entropy at bay
|
|
|
|
|
Sure, why not? It's perfectly legal to do replacement new like that. However, I'm sure it would be frowned upon in a programming team.
One way to do it with a more java-like syntax would be:
template <typename T>
class java_lookalike_helper {
protected:
typedef T this_t;
};
#define this_ new (this) this_t
class Class : java_lookalike_helper<Class> {
int x, int y;
public:
Class(int x_) : x(x_) {
}
Class(int x_, int y_) : y(_y) {
this_(x_);
}
};
--
Please state the nature of your medical emergency.
|
|
|
|
|
thanx for that variant of this idea. I'll add that to the 'tool kit' and play around with that as well.....this arcane-chicanery must be what causes some advocates to lean toward the 'managed code' camp...where we likely can't have this kind of 'fun' with the language ;)
Just trying to keep the forces of entropy at bay
|
|
|
|
|
Hey, exploring seamingly nutty ideas may indeed evolve into something really cool. Just look at ATL and WTL - now there are some wild and crazy ideas that have evolved into something cool and useful
And the advocates can bite me and my gotos.
--
Please state the nature of your medical emergency.
|
|
|
|
|
Jörgen Sigvardsson wrote:
And the advocates can bite me and my gotos
I'm with you buddy! I've been known to sprinkle a goto on an as-needed basis (much to the chagrin of some 'religious types')....but only when it does not violate the idea of 'good taste'
Just trying to keep the forces of entropy at bay
|
|
|
|
|
Hi
I have a Dialogbased MFC Application,
on the Dialog there is a "textfield" (CEdit) called m_thing.
m_thing.SetWindowText("something");
changes the "textfield"'s content to "something"
my problem: i need to change the "textfield" when there comes data
on a tcp/ip network socket
now i have a class CMySock derived from CAsyncSocket.
the OnReceive method is overlayed / overwritten by my own method.
in the dialog class i create a CMySocket and connect it
then there comes data
in my Onreceive method there is code to receive this data
(i can give it out with an AfxMessageBox this works fine)
but i need to change the "textfield" on the dialog
but the m_thing is not known in my CMySocket class
my question:
how do i get the data from the Onreceive method to my textfield /
to the dialog class...
i read stuff about messages and ON_COMMAND's and alot more i do not
understand
do i need to create an new class to use the OnReceive??
please help
and please excuse the bad expressions like "textfield"
thanks mb
|
|
|
|
|
Fist override the Onreceive event of ur CMySock class
like as follows
void CClientSocket::OnReceive(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
AfxGetMainWnd()->PostMessage(WM_APP + 24, 0,0);
CSocket::OnReceive(nErrorCode);
}
Then post a MEssage to the main window from here "AfxGetMainWnd()->PostMessage(WM_APP + 24, 0,0);"
I then dialog catch this message
ON_MESSAGE(SOCK_RCV_MSG, OnReceive)
void CClientDlg::OnReceive()
{
char buff[SEND_BUF_SIZE];
int nBytes;
CString strLog;
nBytes = m_Sock1->Receive(buff, SEND_BUF_SIZE);
if(nBytes == 0)
{
// got disconnected
}
}
Now u can do anything witht he data in the buff
Hope this will help u
|
|
|
|
|
|
Thought some of you might be interested in the following page:
http://msdn.microsoft.com/library/en-us/dnapiover/html/api-overview.asp
It documents some of the APIs that Microsoft has hidden from us to make their programs unique or a step-ahead.
"November 2001, Microsoft, the U.S. Department of Justice, and nine State Attorneys General agreed to a proposed settlement of the government's antitrust case (proposed consent decree). For more information (including a comprehensive archive of documents and transcripts of proceedings) about the proposed consent decree, see the Microsoft Press Pass Settlement Proceedings Web page. For more information about how Microsoft has fulfilled its obligations under the decree, please see the Microsoft Settlement Program Web page.
As part of that settlement, Microsoft agreed to document the interfaces used by "Microsoft Middleware" (as defined in the proposed consent decree) to obtain services from the Microsoft® Windows® 2000 and Windows XP desktop client operating systems. The vast majority of these interfaces were already documented among the thousands of Application Programming Interfaces (APIs) in the Microsoft Platform Software Development Kit (SDK).
Microsoft teams identified a few hundred undocumented Windows interfaces or parameters that were used by one or more of the Microsoft Middleware components. Microsoft's technical writers have documented these interfaces and made them available as APIs in the MSDN Online Library."
Cheers,
uniken
|
|
|
|
|
No big news. Most of this functions are not even correctly documented and few of them are helpful. Calling this an "advantage" is a joke.
The really useful interfaces are still undocumented.
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
This is puzzling. Execution never goes into either function when either action is done:
void CSortListCtrlTestDlg::OnColumnclickList(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
for (int i = 0; i < 10; i++)
AfxMessageBox (m_ctlList.m_shuffledIndex[i]);
*pResult = 0;
}
void CSortListCtrlTestDlg::OnItemclickList(NMHDR* pNMHDR, LRESULT* pResult)
{
HD_NOTIFY *phdn = (HD_NOTIFY *) pNMHDR;
AfxMessageBox("ll");
*pResult = 0;
}
Am I trapping the wrong messages from class wizard? if so, what function can I have that will respond to the column click? (Right now the columnclick fires an OnColumnClick thats a member of the Clistctrl derived class. But not the col click in the dialog where the control is...
Appreciate your help,
ns
|
|
|
|
|
Probably your CSortListCtrl handles these notifications using so-called message reflection. If this is the case, you'll have to change ON_NOTIFY to ON_NOTIFY_EX in CSortListCtrl's message map and return FALSE from handler, which means that dialog will get its chance to respond to the event.
[edit]
Of course, the CSortListCtrl would use ON_NOTIFY_REFLECT, not ON_NOTIFY.
[/edit]
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
I dont have ON_NOTIFY:Instead its ON_NOTIFY_REFLECT Will ON_NOTIFY_REFLECT_EX be what I want?
BEGIN_MESSAGE_MAP(CSortListCtrl, CListCtrl)
ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnClick)
ON_WM_DESTROY()
END_MESSAGE_MAP()
Also, theres no return value for the CListCtrl function, its a void: I presume this is the handler you speak of?
void CSortListCtrl::OnColumnClick( NMHDR* pNMHDR, LRESULT* pResult )
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
const int iColumn = pNMListView->iSubItem;
Sort( iColumn, iColumn == m_iSortColumn ? !m_bSortAscending : TRUE );
RetrieveIndex();
*pResult = 0;
}
Appreciate your help,
ns
|
|
|
|
|
Yes - change macro to ON_NOTIFY_REFLECT, void to BOOL and add 'return TRUE;' as last line on CSortListCtrl::OnColumnClick handler.
If the class was downloaded from CP, don't forget to ask the author to change it in the article sources as well
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Changed to _EX - no luck. But still havent figured out who is supposed to return false...
Appreciate your help,
ns
|
|
|
|
|
Sorry - it's 'return TRUE;' in CSortListCtrl handler connected to msg map with ON_NOTIFY_REFLECT_EX macro.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Did both things that you said --BOOL and _EX. Still no response!
Appreciate your help,
ns
rebuilt it too!
|
|
|
|
|
I've checked MSDN again - I've found two contradictory articles; one advertised 'return TRUE' while other suggested FALSE. Anyway, this simple example worked for me - I've got two TRACES.
BEGIN_MESSAGE_MAP(CListCtrl2, CListCtrl)
ON_NOTIFY_REFLECT_EX(LVN_COLUMNCLICK, OnColumnclick)
END_MESSAGE_MAP()
BEGIN_MESSAGE_MAP(CTest2Dlg, CDialog)
ON_NOTIFY(LVN_COLUMNCLICK, IDC_LIST1, OnColumnclickList1)
END_MESSAGE_MAP()
BOOL CListCtrl2::OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult)
{
TRACE("in the listctrl-derived class\n");
*pResult = 0;
return FALSE;
}
void CTest2Dlg::OnColumnclickList1(NMHDR* pNMHDR, LRESULT* pResult)
{
TRACE("in dialog class\n");
*pResult = 0;
}
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
The columclick is working with the false. A biiig thank you! I thought I'd have to abandon this slick control.
The item click event in the dialog doesnt respond, but the plain old click does.....wonder why?
void CSortListCtrlTestDlg::OnClickList(NMHDR* pNMHDR, LRESULT* pResult) works
void CSortListCtrlTestDlg::OnItemclickList(NMHDR* pNMHDR, LRESULT* pResult) doesnt!
THe click however always seems to be on an item (in the row the columns all get selected at once), so this will do. I just dont know if click means anywhere in the control, not just on the item.
Appreciate your help,
ns
|
|
|
|
|
I'd try your ideas on it, but there is no itemclick oe even click event in the class itself.
Appreciate your help,
ns
|
|
|
|
|
I guess you're after NM_CLICK; it should be available in CSortListCtrl and CYourDlg as well.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Will use nm_click. What I meant by there being no click event in the class was that there was no handler implemented for it. The message is of course available.
I think I'm going to take off now for the day (unless I just cant resist getting on again later!). ONce again you have proven to be a very valuable resource and I cant thank you enough for all the help you've given me.
Appreciate your help,
ns
|
|
|
|