Well a struct is a just bunch of (adjacent) bytes, hence you can pass the address of the struct (and the proper size) to the sending function.
Of course if endianess is a issue then you have to handle it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
I'm developing an MFC application that I'd like to provide context sensitive help for. Does MFC provide such a facility? I think that .chm files are deprecated in Windows vista - something called MAML is used instead.
My questions is, what is the modern, preferred way to create context sensitive help within MFC?
I spelled your code character by character and it seems that i do essentially the same. So this leaves me to ask you some stupid questions:
1. Is bf.BlendOp = AC_SRC_OVER; the same as: bf.BlendOp = 0; ??
2. To my opinion you do nothing to add an alpha channel to your bitmap. Thus your bitmap has no alpha channel - do you agree on that?
3. Because i use another language then you: what does int s = DC.SaveDC() ; do? Is this one essential to Alphablend?
hmmm... im out of questions but it still doesn't run. This my code: (warning: this is not C-code, but i'll explain when needed)
hMemDC:=CreateCompatibleDC(hdc) // ':=' is used as '=' in Cif hMemDC!=NULL_PTR
blendfunc.BlendOp:=0// blendfunc is a structure BlendOp a member of this structure
AlphaBlend(hdc,x,y,w,h,hMemDC,0,0,w,h,@blendfunc) // Here's the troublemaker//StretchBlt(hdc,x,x,w,h,hMemDC,0,0,w,h,SRCCOPY)//BitBlt(hdc,x,x,w,h,hMemDC,0,0,SRCCOPY)
When i use StretchBlt() or BitBlt() instead it works (altough not transparent). I checked if x,y,w and h are possitive - they are. Think you may ask whats '@blendfunc'. It means 'pointer to structure'. Use this construct for years so must be correct (for example in GetClientRect()). Tried a demo-exe from the code project to find out if problem is system related - it worked ok. Checked the prototype and the structure. I must do something really stupid...
Guess what, you're right!! That was the thing i was overlooking. You're a genius!!!
Did a quick try, made 0x00800000 as the last parameter to Alphablend() and it does the job. And it is lightyears faster then the workaround i made with getpixel(). Problem solved!
The reason i never questioned it, is because a struct is a chunk of memory so i expected this would always be a pointer when used as a parameter. I mean: when a have a struct of let's say 200 bytes and use it as a parameter to a function would this mean these 200 bytes are allocated on the stack?
Saw you're living in Canada, although you have a dutch name. So whenever you are in holland, call me, i have a present for you. Thanks for taking your time.
Not really, I just read the documentation , I am just glad to be able to help.
Saw you're living in Canada, although you have a dutch name.So whenever you are in holland, call me, i have a present for you
My grandparents emigrated from Holland to Canada in the fifties. I would love to go there some day and see where my heritage comes from. Maybe when I do finally manage the trip I will try to look you up and take you up on your offer.
i have a resource file in which i have changed the font property of the dialog to "Arial" regular
then the font inside the dialog got increased...along with the text of the controls inside dialog..
and now i tried changing from the code in initDialog function like...
and now when i build and see the output the look of the dialog with new font is not same and even the font looks smaller than the font of the dialog which i have tried to change manually the font property of the Dialog....
Please suggest me how can i make changes to my code so that both look similar....