|
before i knew about getbuffer i have used this kind of type casting to modify the data also, never gave me any problem but not doing it now.
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
*coughs and shuffles feet nervously*
i sometimesam too lazy to do the GetBufferSetLength() thing
"there is no spoon" biz stuff about me
|
|
|
|
|
Well that is a BAD thing. However, casting to (LPTSTR) to deal with some MS API routines that can not or do not have the arguments defined as (LPCTSTR) works just find AS LONG AS you know the API will not write to the string. Many API's have arguments that have double duties and thus can not be defined as (LPCTSTR).
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Its very simple to convert a CString to LPTSTR, Just use
CString str;
str.operator LPCTSTR ( );
The "operator LPCTSTR ( )" will return a char pointer to the string data.
Best Regards,
Jijo.
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
Hi,
I am looking for an easy way to change text color in CListCtrl header.
Thank you in advance.
csgogogo
|
|
|
|
|
If you use MFC, you will probably have to created your own class derived from CHeaderCtrl.
This article[^] will indicate you how to use the Header Control.
HTH,
K.
And all the girlies say I'm pretty fly for a white guy
|
|
|
|
|
|
Hi:
Q1: How do I remove all breakpoints in project at once.
I used to be able to do that in older VC++ versions, but I can't figure out how to do it in VC7.0.
Q2: In older VC++ versions, when I open new window of same source file and if cursor is in middle of it, the newely opened file will also open up with cursor pointing to same location. In VC7.0 it opens up pointing to first line. I don't like that, how can I change that.
Thanks.
|
|
|
|
|
|
Q1:
Simply on Debug menu click on the Clear All Breakpoints or use Ctrl+Shift+F9.
Q2:
This problem in not important i think that in older version editor open the file at begining of it.
in erlier version if windows has been opened and u open it again the view of this was active and u see it at the same location. in this version if u wasn't close the window u will see the same as older version.
|
|
|
|
|
I'm trying to make an Edit Box automatically scroll down while the program is running. As I get data in to the edit box, I want to follow the latest data string in the box, however the focus is at the top of the edit box and even though the vertical scroll bar shrinks, all I see is the first data strings entered into the edit box. Any ideas on how to do this? I'm using MS Visual C++ 6.0. Thanks!
tsc
|
|
|
|
|
|
when i did this sort of thing i always used a list control
then just added the new string at the top or the bottom depending where i wanted it to scroll
"there is no spoon" biz stuff about me
|
|
|
|
|
I have a problem with using _inp & _outp in windows 2000 .
when I this instructions Execute, windows prompt this error message :
The exception Privileged instruction.
how can I get Privilege For process to solve this problem.
(I'm so sorry for my English )
Iman Ghasrfakhri
|
|
|
|
|
These are kernel-mode instructions that can't be called from a user-mode application. They are typically called by a device driver (which runs in kernel mode).
Nick Hodapp
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2003 Microsoft Corporation. All rights reserved.
|
|
|
|
|
you mean its imposible ? to use this instruction ?
Iman Ghasrfakhri
|
|
|
|
|
|
hi,
if i drag an objekt from my CScrollView window to the top of the area of a scroll bar, i want the view to scroll automatically in the same direction.
Could you plz tell me how to do it?
Thanks!
withoutdruck
|
|
|
|
|
Normaly you should set timer, when in drag mode and cursor x pixels from top; and then inside OnTimer handler scroll window.
Brian
|
|
|
|
|
Thanks Brian.
But when I tried to identify the runtime class according to the cursor position, it told me always it was of the same CSrcollView class, although the cursor was just above the scroll bar.
|
|
|
|
|
how do i set up a floating toolbar so that it will be displayed vertically? (all buttons displayed in column, not in row)
|
|
|
|
|
// in your CMainFrame class, create a CToolBar
// that includes the TBSTYLE_WRAPABLE and
// CBRS_SIZE_FIXED flags.
// next, call the SetRows() method. have a look
// at the MSDN docs for a full desciption of the
// method and its parameters.
int numRows; // TODO: initialise this value
m_wndToolBarFloat.GetToolBarCtrl().SetRows(numRows, true, 0);
// last, dock the tool to the left or right side
// of the MDI frame
m_wndToolBarFloat.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBarFloat);
|
|
|
|
|
Hi,
I would like see if I can get the system date in a few lines of code?
any ideas?
Thanks
Ehsan Behboudi
|
|
|
|
|
look up time_t in the MSDN.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
#include <time.h>
time_t now;
struct tm *newtime;
char todaysDate[128];
// get the number of seconds since January 1, 1970
time(&now);
// get the current system date
newtime = localtime(&now);
todaysDate = asctime(newtime));
|
|
|
|