|
Have you tried passing pSendParam through the LPARAM parameter?
PostThreadMessage(tid,WM_HYDRO_RXD_ARRIVAL,0,(LPARAM)pSendParam);
and changing your thread to this:
pRecParam=(MsgParam*)msg.lParam;
Kelly Herald
Software Developer
Micronpc, LLC
|
|
|
|
|
Hi
I'm working on drawing a custom button (its quiet complex as its not really a button)..
is there anyway to remove the flicker as the button is redrawn.. I guess you create a new bitmap or something draw to that and copy it over all when its drawn..
can anybody give me an idea about what function to call to make a chunk of memory (or bitmap) that I can get the DC off and then draw to it..
I'm not using MFC
Many thanks..
Chris
|
|
|
|
|
The best thing is to handle WM_ERASEBKGND and there draw a bitmap that you store internally onto the HDC. Do all your drawing to the bitmap, and only do one BitBlt to the button, on that message handler.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
There are samples in the MFC MSDN. You can there evaluate the principles.
I would do all drawing in a memory dc and if ready draw all to the screen.
|
|
|
|
|
Does anybody know, how to use IE WebBrowser component in my application which would not use default IE http proxy server settings, byt will have it's own ?
Thanks
rrrado
|
|
|
|
|
Yes, if it's MSIE 5.0+. Search for INTERNET_PER_CONN_OPTION in MSDN.
Back to real work : D-23.
|
|
|
|
|
That seems to be only for querying/settiong options for different connections - like modem/lan. Not for different instances of IE. It operates with HINTERNET handle, it is lowest layer in web browser model. How to get/set HINTERNET handle for downloading on my IWebBrowser2 instance ???
rrrado
|
|
|
|
|
I'm doing a project using DirectDraw in 16 bit mode, and I stored a certain bitmap in a DD surface. Now I'd like to read the colors off the surface, process them accordingly and then assign the new values.
The problem is that the color is stored as an unsigned integer (for example "65503" for a shade of white). In order to process it I would like to break it back into 16-Bit RGB values (such as RGB16BIT(31,31,31), again for a shade of white).
How could I do so? anybody?
Isaac Sasson,
Small time programmer - complainer at large!
Sonork ID 100.13704
|
|
|
|
|
Surfaces use bit masking to express how the color components are stored. When you lock a surface in order to access it, you can pass a DDSURFACEDESC structure along and ask it be filled with the color masks, which is done with code like this :
DDSURFACEDESC ddsd;
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags= DDSD_LPSURFACE | DDSD_PIXELFORMAT;
HRESULT hr = pDDSurface->Lock(NULL,&ddsd,DDLOCK_SURFACEMEMORYPTR|DDLOCK_WAIT,NULL);
if (SUCCEEDED(hr))
{
DWORD redmask = ddsd.ddpfPixelFormat.dwRBitMask;
...
...
}
Now that you've got the bit masking, you can use logical shifts to break the actual bits into what you want. The point here is to know you can't hardcode the shifts, you must execute code according to the bit masking.
All of this should be obvious to anyone reading the DirectDraw reference doc.
Back to real work : D-23.
|
|
|
|
|
A 16 bit number ignores the three least significant bits of an 8 bit char, and is stored as 5, 5, 5, 1 with an unused bit at the end. It shouldn't be too hard to build a macro that takes 3 chars and builds them, assuming one does not already exist.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Already tried something making such a macro, but I'm having a problem with 16 bit cards that hold an extra bit for green. Seems like the green bit is misrepresented when I re-assign it.
Isaac Sasson,
Small time programmer - complainer at large!
Sonork ID 100.13704
|
|
|
|
|
Oh - I think sometimes red gets 6, so it's 6, 5, 5. The green would be off because it lost it's most significant bit.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Excuse me Sir,
Does anybody have seen the movie Snatch? I would like to find the site for the fanclub! Thanks, and I also write program, but not very well yet (JUST STARETED!)
Heralo
|
|
|
|
|
SUPER_PROG wrote:
ForumVisual C++
Subject:Re: PLZ Help me
Sender:SUPER_PROG
Date:1:02 7 Nov '02
Excuse me Sir,
Does anybody have seen the movie Snatch? I would like to find the site for the fanclub! Thanks, and I also write program, but not very well yet (JUST STARETED!)
This is great - very funny indeed.
I suppose I should tell you this is not the place to ask, but I must admit I love that movie too. I doubt it has a fan club.
If you're learning to program, you'll find CP a very useful resource. Just don't annoy everyone by asking questions that are off-topic, OK ?
Is this the first time someone posted to the programming forum when it should have been the lounge, instead of vice-versa ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian, the usual traffic cop[^].
Back to real work : D-23.
|
|
|
|
|
Hey - I don't look like that !!!
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Yes, but you get the idea.
Back to real work : D-23.
|
|
|
|
|
Hmm, that's the first time I've seen a non-programming question here instead of the lounge.
I wonder if a big red "Please don't ask non-programming questions here, go to the lounge!" message would confuse people too much
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
I suspect that anyone who reads the forums a bit before posting anything learns that there is a greater risk of being flamed if you ask ANYTHING in the lounge.....
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
*looks about innocently*
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Why is it that off-topic threads always get more replys than valid threads?
Is it just the vultures replying?
*flap* *flap* *flap*
*Scwalk*
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
Hi.
I am working under an MFC environment. I would like to know, What is the performance difference, if any, resulting from the use of _beginthreadex and MFC's AfxBeginThread for an IOCP Winsock model client and server? I understand that for an MFC project, we should use MFC's AfxBeginThread to generate the threads. Nonetheless, does an IOCP client or server require or performs better via _beginthreadex?
The reason I am wondering about this is that I saw some really good examples IOCP servers where the developers used _beginthreadex with MFC instead of AfxBeginThread(). Here is one example.
http://www.codeproject.com/internet/winsockiocp.asp
-----
A second question related to IOCP, _beginthreadex, and MFC's AfxBeginThread is the callback function.
Under MFC's AfxBeginThread, you basically send/post messages from the worker thread the IOCP GetQueuedCompletionStatus() function returns. One the other hand, with _beginthreadex, you have the option of passing in a pointer to the class object itself (this). Thus, you can call a function to process incoming data directly without relying on send/post message.
I would like to know, Is the analysis above true. In other words, does the use of send/post message via IOCP worker threads negatively affect performance?
Thanks,
Kuphryn
|
|
|
|
|
Look into MFC sources, Afx... internally uses _begin.... i'd say, so performance will be the same
rrrado
|
|
|
|
|
AfxBeginThread() is just a small wrapper around _beginthreadex and does some extra MFC structure initialisations on thread creation and some cleanup on thread termination. If you are using the DLL version of MFC you don't have to care that much about it, because the same job is done in MFC42.dll's DllMain().
From the performance point of view both should be pretty the same. I usually prefer _beginthreadex() - just because you may decide one day to throw MFC away from your server app (which is not that unlikely, believe me )
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Okay. Thanks.
Excellent point on portability.
Kuphryn
|
|
|
|
|