|
type "MSN messenger service protocol" into google. You will get a ton of references.
|
|
|
|
|
Ive implemented last year for fun only an MSN client that connects to the server and then gets u the list of connected user in ur list without them noticing you, meaning that ure appearing offline.
This year i used a different way of doing stuff, i used the MSN object COM model, so i passed by the client itself in order to add some functionnality to my application
If ure interested email me at johnny_mkhael@hotmail.com and tell me what u need in details.
Papa
Murex Co.
|
|
|
|
|
I am trying to make a core API app. It seems to pay off, but when I use a *.exe.manifest file, the MessageBox function does not work (IE: I hear a sound, but there is no visual . Is there someone who knows the problem?
thanks in advance,
Sjoerd van Leent
LPCSTR Dutch = "Double Dutch "
|
|
|
|
|
How to write burning program for CDR!
|
|
|
|
|
There are commercial SDK's available. I've seen this question asked often and that is the only answer I have ever seen.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
|
Hello,
My program seems to be getting different device contexts in different functions (results of GetTextExtent differs sometimes for same window). I would like to ensure that the DCs are the same. Here are the two code fragments. Any suggestions on making sure that OnBeginlabeledit has the same DC as OnCustomdrawMyList? Thanks!
void CGoalsListView::OnCustomdrawMyList (NMHDR* pNMHDR, LRESULT* pResult)
{
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<nmlvcustomdraw*>( pNMHDR );
CDC* pDC = CDC::FromHandle ( pLVCD->nmcd.hdc );
...
void CGoalsListView::OnBeginlabeledit(NMHDR* pNMHDR, LRESULT* pResult)
{
NMLVDISPINFO* pDispInfo=(NMLVDISPINFO*)pNMHDR;
*pResult=1;
CDC* pDC = GetDC();
Jon Paul
|
|
|
|
|
The difference is probably due to a pre setup DC being passed in in custom draw. It will have the correct font setup for it, while in the GetDC() version you will need to get the font from the control and apply it to your DC before measuring the text.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Hi Roger,
Thanks for the reply.
I found that the custom draw DC is the 'correct' one that gives proper proportions, while the other is the 'bad' one.
How do I get the DC from the control? I thought I was already doing it by its position in the code? I have tried
CDC* pDC = CGoalsListView::GetDC(); // with resolution operator
but that didn't work. I've tried to extract it from the
void CGoalsListView::OnBeginlabeledit(NMHDR* pNMHDR, LRESULT* pResult)
header, but I was unable to find it.
Any suggestions? Thanks! JP
Jon Paul
|
|
|
|
|
What you had was almost correct I think.
void CGoalsListView::OnBeginlabeledit(NMHDR* pNMHDR, LRESULT* pResult)
{
NMLVDISPINFO* pDispInfo=(NMLVDISPINFO*)pNMHDR;
*pResult=1;
CDC* pDC = GetDC();
pDC->SaveDC() ;
CFont *pFont = GetFont() ;
if (pFont != NULL)
pDC->SelectObject(pFont) ;
...
pDC->RestoreDC(-1) ;
pDC->ReleaseDC() ;
}
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Wow! It seems to work!--Thanks! ... However, I'm not sure why. Here's the full function (to position an CEdit box on top of the List Column--except for col==0 where it positions it on top of the tabbed text).
Perhaps something between GetDC() and pDC->GetTextExtent sets up the new DC? Or perhaps the GetFont() is necessary, but I thought that GetDC() gets the font of the current DC also. Hmm... Thanks again! JP
void CGoalsListView::OnBeginlabeledit(NMHDR* pNMHDR, LRESULT* pResult)
{
NMLVDISPINFO* pDispInfo=(NMLVDISPINFO*)pNMHDR;
*pResult=1;
CDC* pDC = CGoalsListView::GetDC();
pDC->SaveDC();
CFont *pFont = GetFont();
if (pFont != NULL)// you can get NULL if no font has been set for the control
pDC->SelectObject(pFont) ;
CPoint posMouse;
GetCursorPos(&posMouse);
ScreenToClient(&posMouse);
LV_COLUMN lvc;
lvc.mask=LVCF_WIDTH;
CRect rcItem;
GetListCtrl().GetItemRect(pDispInfo->item.iItem,rcItem,LVIR_LABEL);
if(rcItem.PtInRect(posMouse)) {
CString tIndent = GetDocument()->GetGoalArray()->GetIndentText(pDispInfo->item.iItem);
int npixIndent = pDC->GetTextExtent(tIndent + GLV_OFFSET).cx;
TRACE2("BegLabelEdit: string='%s', npixIndent=%d\n", tIndent, npixIndent);
m_LVEdit.m_x=rcItem.left + npixIndent;
lvc.cx = rcItem.Width() - npixIndent;
m_nEdit=0;
}
int nCol=1;
while(m_nEdit==-1 && GetListCtrl().GetColumn(nCol,&lvc)) {
rcItem.left=rcItem.right;
rcItem.right+=lvc.cx;
if(rcItem.PtInRect(posMouse)) {
m_nEdit=nCol;
m_LVEdit.m_x=rcItem.left;
TRACE1("BegLabelEdit: rcItem.left=%d\n", rcItem.left);
}
nCol++;
}
if(m_nEdit==-1)
return;
HWND hWnd=(HWND)SendMessage(LVM_GETEDITCONTROL);
ASSERT(hWnd!=NULL);
VERIFY(m_LVEdit.SubclassWindow(hWnd));
m_LVEdit.m_y=rcItem.top-1;
m_LVEdit.LimitText(50);
m_LVEdit.SetWindowText(GetDocument()->GetGoalArray()->GetItemColText(pDispInfo->item.iItem , m_nEdit));
m_LVEdit.m_cx = lvc.cx;
m_LVEdit.m_cy = rcItem.Height();
ReleaseDC(pDC);
*pResult=0;
}
Jon Paul
|
|
|
|
|
Im doing a simple non-MFC application.. I need to convert an ASCII string into an OLECHAR array. I want to pass my string into a SysAllocString(); function call like this:
<br />
char string[] = "ASCII STRING";<br />
(t+f)->str = SysAllocString(string);<br />
Of course this doesnt work because, SysAllocString is expecting an OLECHAR FAR*. The function works fine when I do:
<br />
(t+f)->str = SysAllocString(OLESTR("Test String"));<br />
Im actually passing in an array of UDTypes with variable length strings from VB and populating each element of the array / structure.
Im not very familiar with this whole ATL/COM string stuff.. =) Ill be honest, Im a C programmer, so Im out of my element. What can I do.. Please Help.
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
USES_CONVERSION;
char string[] = "ASCII STRING";
(t+f)->str = SysAllocString(A2CW(string));
This should do the trick. Make sure to include atlbase.h
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Thank you so much..
(i had tried to use the a2ole macro before, but could noit find information on which library it was in, or how to implement it..
THANK YOU ....
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
You're welcomed. Btw, where do u live in Canada? Me, I live and work in Hull, near Ottawa.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Any XP theme gurus please help me to know how to find the task bar color in the current theme? I don't even know where to look at
I have never wasted time worrying about such insignificant things. Keep your eye upon the donut and NOT upon the hole. - Bill Sergio about posting in the right forum. The Lounge - June 23, 2002
|
|
|
|
|
Checkout the SystemParametersInfo and the GetSysColor
functions. They control how windows ui stuff works and looks.
|
|
|
|
|
Is there a way to self terminate an application after a period of time.
Thanks
|
|
|
|
|
Do a PostMessage with WM_CLOSE - PostMessage(WM_CLOSE, 0 , 0)
|
|
|
|
|
use a CTimer for the "period of time" and then ... exit(0);
~RaGE();
|
|
|
|
|
main()
{
Sleep(TIME);
exit(0);
}
/Magnus
|
|
|
|
|
Now that is what I call a usefull program!
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Sure. Zillions.
Here's a frighteningly unfriendly way; it hangs a sword of Damocles over
the process:
~~~~~
// the basic killer thread
DWORD WINAPI _MySleeper(LPVOID msWaitPeriod)
{
Sleep((DWORD)msWaitPeriod);
TerminateProcess(GetCurrentProcess(),0);
return 0;
}
// hang the sword
DWORD ThreadId;
DWORD ms=10*1000; // 10 seconds
CloseHandle(CreateThread(0,0,_MySleeper,(LPVOID)ms,0,&ThreadId));
~~~~~
Now that process has 10 seconds to live.
It'll suffer a brutal death, probably leaving leaving lots of
open resources improperly closed.
Better to just set a flag, and post a quit message during idle
or something.
|
|
|
|
|
I am having a problem getting intellisense to work with the header files for my libraries. I thought that all you needed to do was add an include path for the location of my header files and away you go but that doesn't seem to be the case. All intellisense will recognise are macros to the standard functions such as fxd_mem_copy() which macros to memcpy(). Nothing at all is offered for my own functions eg fxd_mem_format(). I use makefile solutions to build my programs with the source files attached to the project so they are easily editable in VS.NET. Can anybody provide suggestions as to what the problem is?
Thanks for any help you can provide
Steve.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
Steve Thresher wrote:
I am having a problem getting intellisense to work with the header files for my libraries.
Many have. Head over to nntp://microsoft.public.dotnet.languages.vc. Maybe even better, check that NG from a Google Groups search.
++luck;
|
|
|
|