|
led mike wrote: You are probably experiencing a timing issue
Yes, but I'd like to have focus return to the right hand pane by default - surely there is a better way than repeatedly calling SetActivePane(), SetFocus(), or some equivalent?
|
|
|
|
|
I have this:
HANDLE hFile;
DWORD wmWritten;
char code[1024];
hFile = CreateFile(filename,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
ReadFile(hFile,code,1024,&wmWritten,NULL);
CloseHandle(hFile);
but i always get a 1024 char file, i mean if the file has more than 1024 chars then it will just show up the first 1024 of them. What should I do for getting always the exact number of chars the file will have. I mean I want a way to get the number of chars instead of just typing 50000 instead of 1024 because if i do that it ll show up iiiiiiiiiiiiiii or something like that for completing the 50000 chars if the value is lower than that.
thanks.
modified on Wednesday, August 27, 2008 5:24 PM
|
|
|
|
|
letueros wrote: What should I do for getting always the exact number of chars the file will have.
I suggest you start by learning to read the documentation[^]
led mike
|
|
|
|
|
thanks, it worked but I used GetFileSize(... for getting the DWORD value, but there seems to be something unusual though at the end of the char* it always says ýýýý««««««««îþîþîþ. Should I remove that manually i mean by replacing that by "" or substringing it or is there a better way to get rid of it?
|
|
|
|
|
letueros wrote: Should I remove that manually
No, simply put a '\0' character in the appropriate spot in code .
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hello every one,
I have one question regarding neural networks and it's functionality. I'm newbie in this field.
Actually i want to use a supervised neural network to estimate a function values at different locations.
Suppose we want to estimate y = x^2 and we have some training data to learn the network
x=1 => y=1
x=2 => y=4
x=3 => y=9
x=4 => y=16
x=5 => y=25
Now suppose we want to estimate function value at x = 10
At first it seems that Back propagation is the best network for this purpose but after i tried some source code from CodeProject i found out that Back Propagation can only estimate function values that are around the training set!(Tell me if I'm wrong!) so for example it can estimate function at x=4.5 but it cannot estimate function at x=10 (i think it will return 25)
So which type of Neural Network should i use for this purpose? Any ideas?
|
|
|
|
|
I'm trying to create some menu items dynamically in a popup menu, varying text, some of which then need check marks against them, and some need to be disabled (greyed).
This all works fine except for the disabled / greyed state.
They are created with InsertMenuItem() and everything is set up in the MENUITEMINFO struct. Everything works fine - including the check marks - except that they never come up disabled.
When I modify them with SetMenuItemInfo(), again everything fine except the disabled state.
At the end of all modifications DrawMenuBar() is called, but it doesn't seem to make any difference either way.
Any suggestions as to why?
|
|
|
|
|
Nick01223 wrote: and everything is set up in the MENUITEMINFO struct.
Can you show the code that initializes the struct?
Have you tried EnableMenuItem()?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes, didn't work either.
But, literally this minute I've fixed it.
Was using WM_MENUSELECT instead of WM_INITMENUPOPUP as the trigger for the updating. Must occur at a different time, and greying must be different to check marks, because what was happening was the greying didn't work, but if while the menu was down you quickly moved the mouse off the menu (ie off the menu window) - it rapidly updated to the greyed state. Use WM_INITMENUPOPUP and it works all the time.
Must be to do with idle time processing.
Thanks for your help.
|
|
|
|
|
Nick01223 wrote: Was using WM_MENUSELECT instead of WM_INITMENUPOPUP as the trigger for the updating. Must occur at a different time
Very different
"The WM_INITMENUPOPUP message is sent when a drop-down menu
or submenu is about to become active. This allows an application
to modify the menu before it is displayed, without changing
the entire menu."
"The WM_MENUSELECT message is sent to a menu's owner window when
the user selects a menu item."
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes, clearly.
I just assumed that detecting selection of the top level menu item where the popup was would have the same effect. Obviously not!
|
|
|
|
|
Testing CPHog with my newly installed Firefox 3.0.1
Can you hear me now?
led mike
|
|
|
|
|
no
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Sure because you're to busy stuffing your face with a double cheeseburger!
led mike
|
|
|
|
|
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am looking for an advise, explanation of using CAVI.
My BITMAPINFO bmiColors at index 0 appears to have RGB color quad (red , green, blue and reserved) OK but it looks like the "reserved" is actually the next red value.
I have been looking thru the documentation and cannot find explanation for usage of "reserved" "color" and how it gets “filled”.
Any help is appreciated.
Vaclav
|
|
|
|
|
I don't know what CAVI is, but...
Are you sure the bitmap HAS an RGB color table?
What are the BITMAPINFO.bmiHeader values?
Vaclav_Sal wrote: cannot find explanation for usage of "reserved"
From the RGBQUAD docs: "Reserved; must be zero."
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
my bitmap has all required values. The code works "almost perfect", I actually display the captured video, however, I need the color histogram and this is where I see strange values.
And the "reserved" value is NOT zero after the single frame capture!
I think I am overlooking some AVI macro to control the "reserved" value.
It looks like the AVI "bitmap" is plain RGB, not a RGBQUAD.
PS. CAVI - multimedia macros - example "capGetVideoFormat".
Thanks Vaclav
|
|
|
|
|
Again...What are the BITMAPINFO.bmiHeader values?
The format is pretty important
Are you the one constructing the BITMAPINFO?
What code is setting the color table values?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
just FYI. I think I can figure this out by myself.
Here is the AVI calback setup and its callback function.
BOOL bCallback = capSetCallbackOnFrame(hWnd, _grabber_CallbackProc);
The docs saiz something about "..and will display it in created window".
It does and that what tru me off - there is no need to convert it to bitmap and then display it if I only want to see it in view window. OK.
However, the _grabber_CallbackProc SetImageData method copies the raw data and it gets messed up in BITMAPINFO!
What I really need is to find out the "layout" of the LPVIDEOHDR and than copy it into BITMAPINFO color map correctly.
Or better yet - do my histogram extraction on the AVI data directly.
LRESULT PASCAL _grabber_CallbackProc(HWND hWnd, LPVIDEOHDR lpVHdr)
{
ASSERT_VALID(theOnlyOneGrabber);
validCallHint = TRUE;
// set grabber image data
theOnlyOneGrabber->SetImageData(lpVHdr->lpData);
validCallHint = FALSE;
return 0;
}
PS As always - ignore the > !!
Thanks for reading.
Vaclav
|
|
|
|
|
Vaclav,
Did you get it straightened out?
There's no BITMAPINFO info in the VIDEOHDR struct. You need to keep
that info yourself if you need it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi friends it's my first participation in this forom and i hope to find a solution to my problem.
I want to build a program (with c++ or vb or borland c++ or other)
1/this program extract some columns from an excel file A (extension .xls) ,an other B (extension .csv) and file C (extension .dat) to a 4th excel file D(.xls).
2/I will then put file D in a data base.
I'm not good in programmation and i wish that u can help me to do the 1st step of my prog.
i'm waiting your popositions .thank u
|
|
|
|
|
This is not a trivial task. One solution would be to use ODBC. The other would be to use Excel Automation.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Here is two sets of preprocessor I did not understand completely,
First one is trying to define the class if it is not already defined and
the second one is trying to define a header file if it is not already defined.
But my quesion is what is the syntax or rules for the identifier.
Why there is a underscore before the word Class and H (in second example).
The way I understand is _Class means for Class and _H means for Header.
In header case, it is all upper case. Why it that.
I understand #define, #ifndef but I am not clear about the systax for identifier.
If any body can answer my confusion or direct me to any article I will be glad.
#ifndef TEggCodeParser_Class
#define TEggCodeParser_Class
#if !defined( EXAMPLE_H )
#define EXAMPLE_H
Thank you.
|
|
|
|
|
You can use any valid identifier. Underscores can be used to prevent
future clashes with similar identifiers, or just to indicate that the
identifier is a macro. Just a matter of convention.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|