|
You know what? No!
Wierd. I know now that the lib is correct. At least as unicode goes.
|
|
|
|
|
Anyone knows a reason why this would not paint my items/sub items ?
case WM_NOTIFY:
{
switch(LOWORD(wParam))
{
case IDC_LIST:
{
if(((LPNMHDR)lParam)->code == NM_CUSTOMDRAW)
{
NMLVCUSTOMDRAW *cdraw = (NMLVCUSTOMDRAW*)lParam;
if (cdraw->nmcd.dwDrawStage == CDDS_PREPAINT)
return CDRF_NOTIFYITEMDRAW;
if (cdraw->nmcd.dwDrawStage == CDDS_ITEMPREPAINT || cdraw->nmcd.dwDrawStage == CDDS_SUBITEM)
{
COLORREF crText;
if ( cdraw->iSubItem==2 )
crText = RGB(255,0,0);
else if ( cdraw->iSubItem==1 )
crText = RGB(0,255,0);
else
crText = RGB(128,128,255);
cdraw->clrText = crText;
return CDRF_DODEFAULT;
}
}
}
}
}
the message never arrives at if (cdraw->nmcd.dwDrawStage == CDDS_ITEMPREPAINT || cdraw->nmcd.dwDrawStage == CDDS_SUBITEM)
i have seen other src codes and it all works well there (MFC examples but not API)
any brief idea?
/- Bengi - \
|
|
|
|
|
any idea? i kinda need this one fixed badly!
/- Bengi - \
|
|
|
|
|
Have you seen Michael Dunn's article on Custom-Draw in List boxes? It's on this site (can't find link - it's entitled "Neat Things to do with CListCtrl using Custom Draw") - I have successfully followed that example to colour my List Box
-Alex
|
|
|
|
|
Hi!
I have a CDialogBar derived class, and I want to enable/disable some button in it.
Inside of my class, I catch the click button events for my buttons.
ON_BN_CLICKED(IDOKUNDCERVCREAT, OnBnClickedOk)
ON_BN_CLICKED(IDC_COMPUTEUNDCERVCREAT, OnBnClickedCompute)
ON_BN_CLICKED(IDC_DESTROYUNDCERVCREAT, OnBnClickedDestroy)
I have connected my buttons with my variables:
DDX_Control(pDX, IDOKUNDCERVCREAT, m_wndOk);
DDX_Control(pDX, IDC_COMPUTEUNDCERVCREAT, m_wndCompute);
DDX_Control(pDX, IDC_DESTROYUNDCERVCREAT, m_wndDestroy);
in my *.h I have:
CButton m_wndOk;
CButton m_wndCompute;
CButton m_wndDestroy;
So, in my OnButtonClickFunct.. I want to do things like:
m_wndOk.EnableWindow(false);
m_wndCompute.EnableWindow(false);
Right now, if I do that, my button dont enable/disable.
thanks for the help
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Because, you haven't made the connection between the m_wndOk variable and the IDOKUNDCERVCREAT control, enabling m_wndOk won't do anything. The easiest way to achieve what you want is to lose the variables and just do:
GetDlgItem (IDOKUNDCERVCREAT)->EnableWindow (false); /ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I tryed it, but It don't seems to work. Maybee the fact that it is a dialogBar unstead of a dialog prevent this from working.
any other ideas?
Everything's beautiful if you look at it long enough...
|
|
|
|
|
MemLeak wrote:
Maybee the fact that it is a dialogBar unstead of a dialog prevent this from working.
I don't think so. It's likely that there may be other problems in your code.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello,
I have an application which is using AviCap to occasionally grab a frame from a camera using a frame callback. I would like to convert this frame data into a bitmap or DIB (in memory). For testing purposes I have a static control (m_Pic) declared globally (for ease in testing) in which to display the bitmap to. I know the callback is working correctly because the static control turns black and resizes to the size of the captured imaged.
I've read through the samples here and at a few other places and I'm looking for a very simple method to get the image data without using any sort of custom class. Any help would be appreciated.
Thanks,
Aaron Stubbendieck
LRESULT FAR PASCAL FrameCallbackProc(HWND hWnd, LPVIDEOHDR lpVHdr)<br />
{<br />
VOID* data=NULL;<br />
data=malloc(lpVHdr->dwBytesUsed);<br />
ZeroMemory(data,lpVHdr->dwBytesUsed);<br />
memcpy(data,lpVHdr->lpData,lpVHdr->dwBytesUsed);<br />
<br />
BITMAPINFO BitmapInfo;<br />
capGetVideoFormat(hWnd,&BitmapInfo,sizeof(BitmapInfo));<br />
<br />
HBITMAP hBitmap=::CreateDIBSection(0,&BitmapInfo,DIB_RGB_COLORS,&data,NULL,0); <br />
<br />
CBitmap bmp;<br />
bmp.Attach(hBitmap);<br />
m_Pic.SetBitmap(hBitmap);<br />
<br />
delete data;
<br />
return (LRESULT)TRUE;<br />
}
modified 12-Jul-20 21:01pm.
|
|
|
|
|
seems like I need some help trouble shooting again.
My app uses MS Speech API 5.1[^] and need to include the API for Win98 users. Problem is I am not sure which files to include? I have tried the Redistributable .msm[^]
Speech SDK merge modules (MSM)
The following merge modules can be redistributed:
sp5.msm
sp5intl.msm
sp5sr.msm
sp5ccint.msm
sp5itn.msm
sp5ttint.msm
spcommon.msm
sp5ttintxp.msm
The ones in bold are the ones I did not try installing.
Any ideas would be great thanks.
I think they installed properly but but app crashes when a speech function is called.
<edit added>
maybe I didn't create the installation correctly?
www.savemall.net/mshelp.htm[^]
</edit added>
Later, JoeSox www.joeswammi.com It's not easy facin' up when your whole world is black Rolling Stones
|
|
|
|
|
(rant, no help here...)
I have part of an application that is SAPI enabled. It worked ok. I really didn't like that the end user would still need to get a speech engine. I could have sworn the ones that came with SAPI were only part of the SDK and not intended for end-user distribution. (??)
We finally ended up not enabling this part of the software over concern about support issues. It really did seem like a huge support quagmire. I would love to hear from people who actually ship this stuff and the resulting support costs.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Tim Smith wrote:
We finally ended up not enabling this part of the software over concern about support issues.
Well I only am using it to speak generated text strings and display the Speech Control panel applet for the user to change voices and options. After that any problems, if any I will refer to MS or blame MS, in their documentation they suggest there are problems in some conditions.
Later, JoeSox www.joeswammi.com It's not easy facin' up when your whole world is black Rolling Stones
|
|
|
|
|
.... Well I though it was interesting. I'll start off with some background...
I am making this really cool app - it's really a super flexible imaging enviroment. One of its distinctive features is it's XML plugins. Each XML plugin contains a payload of C++ code plus a few other bits and pieces. So the app slots the pieces of C++ code from various XML plugins together and then runs them through a 3rd party compiler to make a "Processor" DLL, which the main app then loads and runs. This is useful because it allows the program to be fast and completly flexible even to the level of allowing users to edit the way image are created right down to the code!
Ok so really I have a couple of questions...
When you compile you get obj file which are subsequently passed through the linker. So what does the obj file contain? - I was under the impression that there was machine code in there. So if this is the case is it possible to load this machine code into memory manually, then use the beginning of the buffer as a function pointer, and then run the code that way?
This would be advantagous because I could cache machine code much more efficiently than keeeping loads of DLLs around. And instead of slotting together C++ I could cut and paste machine code together, so an XML plugin would only need recompiling every time the code was edited; and all the host would have to do is put the relevant machine code together then run it - all in memory - instead of clumsy compiling and temporaries and modules and stuff. Also cutting out the Linker would give obvious speed improvments, even I didn't do any machine code cut and pasting!!! On the other hand I was a bit worried because cutting out the linker might mess things up... Like the Implicit linking of the "Processor" DLL to the module... Can this worked around?
I realise this is a leviathon of topic, so I would be more than happy if somone could point me in the direction of a good source of information... Dynamic processing engines in general...
Anyway thanks for your time!!!
With time we live, with money we spend!
Joel Holdsworth.
|
|
|
|
|
Joel Holdsworth wrote:
So if this is the case is it possible to load this machine code into memory manually, then use the beginning of the buffer as a function pointer, and then run the code that way?
i don't think so, not easily, anyway. besides simply stitching the machine code in the .objs together, the linker also makes sure all the required functions are present, fixes up pointers from the .obj to external items (like external functions and variables) and a ton of other boring, but necessary things.
i'd go with an interpreted language with a nice C/C++ binding. write a bunch of primitive operations as built-ins, for speed, but do all the user's scripting in the interpreted language.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
Yes I would tend to agree - the whole task is not easy. But there are a couple of good reasons why I'm not using an intirpreter - firstly is speed as you mentioned... I know that they do get faster than MsVB, but even so they are slow - I mean I'm talking about raytracing flyround movies of 3d fractals; I need power! Also writing an intirpreter sounds to me like a task as formitable as cut and pasting machine code.
Anyway thanks for the suggestions
With time we live, with money we spend!
Joel Holdsworth.
|
|
|
|
|
Hi Joel,
This sounds like an interesting project indeed. To use the .obj files directly you would need to perform all the processing steps that the linker does. This is stuff like address fix ups, checking referenced code exists etc.etc. I don't think you want to go there.
A better approach is to use a language which runs in a virtual machine. Our programmer's editor (see sig) uses this approach. It has a C extension language, with some C++ features. Code is compiled once into vm code and then executed in an interpreter. Some virtual machines compile on the fly, without producing intermediate code.
There are several C/C++ VM's around including CINT, CH and UnderC, but the one I suggest you look at us UnderC at http://home.mweb.co.za/sd/sdonovan/underc.html[^] This is reasonably young project and is developing fairly slowly, but Steve Donovan is doing a good job. I had a play with an early version last year and was quite impressed. It has come a ways since then.
I'd be interested to hear how your project evolves.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Hmm yes that sounds like an interesting alternative... But what worries me is really the speed. You see with this project I expect to be pushing the boundries of image power - and I need just that raw power + flexiility. This is a much better VM than I had imagined, but i'd still expect it to be slowish. Bear in mind that I am talking about rendering fractals, and other such demanding imaging applications... Incidentally do you happen to know exactly how well it performs?
Alternativly I could save the user time if he/she was repeatedly recompiling by using the intirpreter, and doing an old style Compiler-Linker conventional compile when the code settles down!
*¨¨`)
¸¸.·´ ¸.·*¨¨`)
(¸¸.·* ¸ .·*
¸¸.·*
(¸¸.~~> Joel Holdsworth.
|
|
|
|
|
If at all possible you need to have the CPU intensive stuff in straight C++ and just call high level routines from the interpreted code. So you wouldn't say draw 1M pixels, but draw me this object. I realize that may not be feasible here.
I have't done any performance testing, but my guess it would be fine for the sorts of things I'd want to use it for. Certainly the interpreted code in ED performs just fine. This is not UnderC though.
Starting with code in an interpreter is great for rapid prototyping, and then as you say, if performance is an issue, more it to native code.
I'd give UnderC a whirl and see how it stacks up.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Hi Everyone,
I was wondering what the difference between ON_MESSAGE and ON_THREAD_MESSAGE is? It seems in the documentation it states that when you have a CWinThread class that you should use ON_THREAD_MESSAGE. Does this mean you should use ON_THREAD_MESSAGE everywhere, or just where the thread is posting messages?
Sincerly,
Clint
|
|
|
|
|
You use ON_THREAD_MESSAGE in your CWinThread derived class to handle messages sent via PostThreadMessage(). You use ON_MESSAGE to handle messages sent via SendMessage() or PostMessage() (or others) in CWnd-derived classes, even if the message in question has been sent between threads.
Dave
|
|
|
|
|
Hello,
I was wondering if it was still needed to call ReleaseBuffer(); as after a GetBuffer(); call, if I call (LPTSTR)(LPCTSTR) before the parameter to pass...
As my english is not my best, I've thought of placing a sample:
method A
Arxiu.Write((LPTSTR)(LPCTSTR)cs, cs.GetLength());
method B
Arxiu.Write(cs.GetBuffer(cs.GetLength()),cs.GetLength());
cs.ReleaseBuffer(); Are the two of them right?
Thank you in advance.
|
|
|
|
|
The LPCTSTR operator on the CString returns a constant string - you should never cast it to non-const string to change it. So while the first example will compile, and possibly work (depending on what Arxiu.Write() does), it is bad practice, and could cause problems.
You only need to call ReleaseBuffer() after a call to GetBuffer() to tell the CString to take control over the buffer again (and allowing you to call other methods).
Dave
|
|
|
|
|
First, if Arxiu.Write is not going to modify the string, then it should be declared as a LPCTSTR and not LPTSTR. Then the problem just magically goes away.
However, if you have no control over how Arxiu.Write is defined AND you are 100% sure that it does not modify the buffer, then (LPTSTR)(LPCTSTR) is safe but bad style and risky. The only time I ever use that construct is when I am working with Windows API where some structures are dual purpose and thus can not be defined as const when they are being used in a read-only context. (i.e. SetItem for tree views)
Now, you will need to invoke ReleaseBuffer in method B.
Here is an excellet talk about string classes.
http://www.codeproject.com/string/cppstringguide2.asp?target=getbuffer[^]
(Mike doesn't agree with me on the (LPCTSTR) construct for VERY good reasons. One cut and paste into a situation where the buffer is written to will crash the problem.)
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Thank you, the link has been very useful...
|
|
|
|
|
For some reason I can't find/use the ATL Object Wizard in MSVC6. The button to use it is disabled and its not under my Insert menu. I have the folder and all the files for the Object Wizard (C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Template\ATL) but I cannot use it. Should I reinstall or is there a way to turn it on?
Thanks for any help.
|
|
|
|