|
Thanks!
I have one question.
In the line:
// CString myString;
CEditCtrl::GetLine(1, myString.GetBuffer(255), 255);
Is 255 the maximun number of characters in *that line*?
I would like to get everything on that line.
In general, is the size (255 in this case) referring to bytes or characters (characters * bytes = maxsize?).
Kuphryn
|
|
|
|
|
How can I have a full screen window (with or without a border) like those we have in expert mode in many applications like MS Word and Photoshop (also used in screen savers I think)?
Regards
(a.k.a. Wal2k) www.wal2k.com
|
|
|
|
|
Not used by screen savers at all, but the way to do it is simply to resize your window so the caption is above the visible window and the status bar is below it. I believe you can programatically hide/show the taskbar, but I'm not sure how.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Christian Graus wrote:
I believe you can programatically hide/show the taskbar, but I'm not sure how.
Just find it with ::FindWindow("The_class_name_of_taskbar", NULL) and then you cab show/hide it programaticly.
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Well, that much is obvious, but I thought there was a more *specific* way
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
HWND FullScreenWindow = ::CreateWindowEx(WS_EX_TOPMOST,
_T("MyRegisteredWindowClass"),
NULL,
WS_POPUP,
0,
0,
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN),
NULL,
NULL,
TheApplicationInstanceHandle,
NULL);
ShowWindow(FullScreenWindow, SW_SHOW);
or something like that
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
It may be that your sole purpose in life is simply to serve as a warning to others.
|
|
|
|
|
I think this does it, TOPMOST is the key .. thanks pal.
Also thanks for all the others.
(a.k.a. Wal2k) www.wal2k.com
|
|
|
|
|
When I do the SetCurSel on the combobox, is there a notification that I receive. I want to handle the change of selection the same way for both programatic and user change.
But, the user change notifications CBN_SELENDOK and CBN_SELCHANGE are not happening when i use SetCurSel.
Should I use another API to select the item to make the notifications occur or is there another notification that is end for programatic changes.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Thomas George wrote:
When I do the SetCurSel on the combobox, is there a notification that I receive. I want to handle the change of selection the same way for both programatic and user change.
But, the user change notifications CBN_SELENDOK and CBN_SELCHANGE are not happening when i use SetCurSel.
Should I use another API to select the item to make the notifications occur or is there another notification that is end for programatic changes.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Huh?
What's the duplicate post for?
Nish
One little CD gone,
Then two CDs gone,
Then 5 more gone,
For a total 7 gones,
If I was a CD R,
I'd wanna cry,
Cause I'd be just a goner,
For a nasty CD burner.
[funny how frustration wakes up the poet in me]
|
|
|
|
|
Unfortunately, all you can do is manually trigger the handler whenever you change the selection. If this is something you need to do a lot, you might want to consider making a custom combo box class, otherwise you'll just have to live with it.
--------
Sip my mind.
|
|
|
|
|
Any idea why this message map would crash my program (sometimes exit without crashing) only in release mode, not in debug mode
ON_COMMAND_RANGE(1001, 6999, OnButtonClick)
Even if I declare OnButtonClick to be empty like so:
OnButtonClick(WPARAM wParam, LPARAM lParam) {}
It crashes as soon as I click one of the dynamically created buttons with an ID in that range.
-Jack
To an optimist the glass is half full.
To a pessimist the glass is half empty.
To a programmer the glass is twice as big as it needs to be.
|
|
|
|
|
handlers for ON_COMMAND_RANGE only take a single UINT parameter.
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_COMMAND_RANGE(ID_FILE_MENUITEM1, ID_FILE_MENUITEM3, OnFileMenuItems)
END_MESSAGE_MAP()
void CMainFrame::OnFileMenuItems(UINT nID)
{
CMenu* mmenu = GetMenu();
CMenu* submenu = mmenu->GetSubMenu(0);
submenu->CheckMenuRadioItem(ID_FILE_MENUITEM1, ID_FILE_MENUITEM3,
nID, MF_BYCOMMAND);
}
-c
Conscience is what hurts when everything else feels good.
Smaller Animals Software, Inc.
|
|
|
|
|
Thanks a ton. I dunno where I got those params from.
-Jack
To an optimist the glass is half full.
To a pessimist the glass is half empty.
To a programmer the glass is twice as big as it needs to be.
|
|
|
|
|
those params are what you use when you do an ON_MESSAGE handler.
-c
Conscience is what hurts when everything else feels good.
Smaller Animals Software, Inc.
|
|
|
|
|
Found this in MSDN "The COM Programmer's Cookbook". It is a #define to find an instance pointer from an interface in vanilla C.
#define IMPL(class, member, pointer) \
(&((class *)0)->member == pointer, ((class *) (((long) pointer) - offsetof (class, member))))
What I have some difficulties understanding is the cast (&((class *)0) . What exactly does that do here?
Thanks
/moliate
|
|
|
|
|
It casts the pointer returned to be the type that is passed in by the class variable, because it is first cast to long for a subtraction. Presumably it is that type of pointer to start with.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
I´m feeling really stupid here, but I still don´t get it. The problem is still the first comma expression. If the interface is the first in a struct, would it not compile down to 0 , leaving a nasty null pointer exception? And what will the result be for the == operation if class->member does not equal pointer ? And isn't the pointer returned the one in the second comma expression?
I really want to understand this, but I have only used commas in simple for-loops before...
/moliate
|
|
|
|
|
#define IMPL(class, member, pointer) \ (&((class *)0)->member == pointer, ((class *) (((long) pointer) - offsetof (class, member))))
I saw the first bit the first time around and didn't think about it much, but it certainly seems to me that it's trying to dereference a NULL pointer and access a member of it, ( before checking if the address of the member == the pointer ), which surely should crash ?
Where is this used ? Where does it come from ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Basically it is a manipulation in "C" in order to get what we have in C++ where classes are concerned. It looks like IMPL is a way to get the this pointer from an interface pointer.
(&((class *)0)->member == pointer
The NULL pointer is first converted to pointer that is the desired type, and this pointer is compared to the input pointer. If this comparison was not between two pointers that had a typesafe cast, the compiler would throw an error at this point in the compilation.
(&((class *)0)->member == pointer , ((class *) (((long) pointer) - offsetof (class, member))))
The key to this macro, is the comma after the comparison test, this basically throws away the result of the comparison, the compiler will see this, and consequently throw away this comparison test in the final compiled code. Then the rest of the macro is used to calculate the offset to the instance data for the struct.
So in short, that comparison is a typesafe cast check in "C", that is performed competely at compile time.
Hope this helps!
Checkout my Guide to Win32 Paint for Intermediates
|
|
|
|
|
kilowatt wrote:
If this comparison was not between two pointers that had a typesafe cast, the compiler would throw an error at this point in the compilation.
[Scchluug] <= Sound of synapses connecting.
Great explanation! Thanks!
/moliate
|
|
|
|
|
Hi.
I havent' really started any .net programming, but i was wondering, is it possible to program the gui using .net extensions (making it easier to program?), but being allowed to program the rest of the code so that it compiles to assembler and hence does not lose any speed (my main reason for using C++)?
I'm only asking because i've got the impression that gui programming using .net is a lot easier then in mfc.
|
|
|
|
|
No. At least not easily. I believe you can still use COM and therefore access C++ compiled code that way, but if you use C++ in .NET you would generally use managed C++ and still compile to the CLR.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
How can I capture a video from a capture device and writing it to a mpeg file.
sorry for me english!
|
|
|
|
|
LoadImage works great for me on most systems and on most bitmaps EXCEPT for
on XP, 2000 & NT, I can't get RLE compressed bitmaps to load!
ALSO is there any info on getting JPEGs to be loaded as well???
Thanks for any help
|
|
|
|