|
You are developing on Win64? Wow
Your problem sounds a bit strange. It should work as you described, I can't find anything conspicuous in your code. I would suppose a subtle side effect:
- Are you sure the value of WM_HYDRO_RXD_ARRIVAL is unique and you are not accidently catching the wrong message?
- Are you sure _W64 is always defined and really all data types are used as 64 bit types?
- Did you monitor any other side effects that look like memory corruption occuring somewhere in your app?
- Does the same problem appear in a small test app?
(Hm the above looks a bit like the generic "are you sure the power cable is plugged in" hotline answer )
Good luck!
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
the code is absolutely incorrect.
try to send an int
int i=5;
PostThreadMessage(tid,WM_HYDRO_RXD_ARRIVAL,(WPARAM)i,0);
it will be OK.
when u pass an object created by new, normally it can not be passed to another thread in the simple way.
i don't know how to do it, but i did similar thing in COM, if u know COM, try same idea that how COM passes object to another COM (they are in 2 threads).
good luck.
includeh10
|
|
|
|
|
What?
Sorry, includeh10, but you seem to completly misunderstood the concept of threads.
You can pass pointers between threads as long as you make sure they reside in the same process. All threads inside a process share the same address space, therefore any address reference is valid and accessable by every thread. Actually this easiness of inter-thread communication is the main reason we use threads instead of processes.
COM puts a lot of "magic stuff" (like apartments, free threaded marshaller, ...) around this, because it has to guarantee that it even works if both thread reside in different processes or even on different machines.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
i am pretty sure that an object can be past from one COM to another even 2 COM are in the same process (or create by same process).
as i said, i never use threads in this way, but i don't think the code would work.
anyway, do further test to get right answer.
good luck
includeh10
|
|
|
|
|
hi,
yeath, I really can pass int i through the gap,but can't pass a struct. I don't know why too. As far as COM is concerned, Inside COM and Essential COM is all what I have. I determined to check it out.
Thanks
Extreme programming. Do the No.1
|
|
|
|
|
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!
|
|
|
|
|