|
And allocate an extra array just for that job?
What about something like
foo(char *s)
{
char *mid = s;
while (*(s++) != ' ')
{
if (s == '\0')
{
break;
}
*(++mid) = s;
}
}
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Duh brian... sorry. My brain has been on a go slow for the last 3 months, or so
Regards,
Brian Dela
|
|
|
|
|
Assuming you function is
fn(char* p)
just get a local pointer that you initialize to "p", and whenever you reach a non-space you
*p++ = *local++;
and whenever it is a space you just increment "local".
|
|
|
|
|
Hello,
I want to resize an edit control in my Cdialog derived class :
void CMyDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
GetDlgItem(IDC_EDIT_TEXT) -> SetWindowPos(NULL, 0, 0, cx, cy, SWP_NOMOVE | SWP_NOOWNERZORDER);
}
But my app crash... why ??
|
|
|
|
|
The OnSize is first called, before the dialog window is displayed and GetDlgItem returns NULL.
Pavel
Sonork 100.15206
|
|
|
|
|
Hello, I need to be notified somehow when the mouse hovers above
a button on my toolbar and I need to know which button it hovers
above. I was under the impression that if I created the toolbar
with the style TBSTYLE_REGISTERDROP I could catch TBN_GETOBJECT, but
it never gets generated, it seems. What is the most straightforward way
to accomplish this?
// William Payne
|
|
|
|
|
catch the WM_MOUSEMOVE message for your button:
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
|
|
|
|
|
In Some websites I get this message(box), How do I get rid of this?!
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
IE->Tools->Internet Options->Advanced->Browsing->Disable script debugging should help.
Pavel
Sonork 100.15206
|
|
|
|
|
When I loaded the ".dsw" file into the VC++ IDE, a message popped up saying that VC++ was unable to load the ClassView information file.
Yes, there was no ClassView information shown after the loading took place, though ResourceView and FileView were present!
Might anyone know why this occurred, and how I may get back ClassView? I did try reloading the program several times, but each time it was the same.
Thanks!
William
|
|
|
|
|
I'm assuming you're referring to VS6.
Usually this problem is caused by your classview file (.ncb) being read-only, check for this first of all. Otherwise delete any existing .ncb file and restart VS, it will then rebuild the classview file from scratch.
Hope this helps,
Jason.
modified 10-Jul-19 21:02pm.
|
|
|
|
|
This can also happen when you have more than one instance of the IDE openning the same workspace.
Gary R. Wheeler
|
|
|
|
|
You have an interesting point there, because while there are two distinct projects being worked on (residing in two separate directories, with different names) the files both projects have, are about 99% the same.
Both projects were loaded into their own respective workspace, but only the first one showed the ClassView. The second project with its different name, located in a different directory and loaded into its own workspace, did not show its ClassView.
William
|
|
|
|
|
if (connect (sock, (struct sockaddr *)&address,
sizeof (SOCKADDR_IRDA)) == SOCKET_ERROR)
{
wsaError = WSAGetLastError();
}
wsaError returns WSAEINVAL;
Why? Which error?
|
|
|
|
|
In VC projects there is an option to choose Runtime library ,
Project-Settings,
C++ Tab
Category:Code generation
Use of runtime library: Multithreaded DLL.
I Want to understand about this option, what difference would it make on my application if I make it Single thereaded.
Thanks in advance.
Abhishek Narula
|
|
|
|
|
You will not be able to safely create multiple threads.
It uses libraries that are multi-thread safe when you select the multithreaded libraries, as well as adding functions that are only specifically used in multi-threaded applications.
The difference between the multi-threaded and single-threaded libraries is that multi-threaded functions serialize access to global data to prevent common problems that occur in MT apps. If you try to use a single threaded function or library in a MT environment, undefined behaviors could possibly occur.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I want to write a NT Services with ATL.Can anybody tell me a link or tutorial about NT Services with ATL?
Thanks
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
|
Hi,
how can I create a popup menu and it should *not* be repositioned by Windows? At the moment my popup menu is repositioned when it would be party invisible (across desktop border. I need to avoid this in my current dialog, partly visible is really wanted!
thx for help.
|
|
|
|
|
I don't think this is possible. TrackPopupMenu() always ensures that the whole menu is visible. If the menu is taller than the screen, scroll arrows are added so the contents can be scrolled.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
|
Hi there dear coders...
how do I create a bold font from an existing font?
//CDC* pDC
CFont fontBold, *pFontOld;
LOGFONT lf;
VERIFY(pDC->GetCurrentFont()->GetLogFont(&lf));
lf.lf?????=1; //what do I set here???
VERIFY(fontBold.CreateFontIndirect(&lf));
thanks for your help!
|
|
|
|
|
From MSDN:
lfWeight
Specifies the weight of the font in the range 0 through 1000. For example, 400 is normal and 700 is bold. If this value is zero, a default weight is used.
The following values are defined for convenience:
Value Weight
FW_DONTCARE 0
FW_THIN 100
FW_EXTRALIGHT 200
FW_ULTRALIGHT 200
FW_LIGHT 300
FW_NORMAL 400
FW_REGULAR 400
FW_MEDIUM 500
FW_SEMIBOLD 600
FW_DEMIBOLD 600
FW_BOLD 700
FW_EXTRABOLD 800
FW_ULTRABOLD 800
FW_HEAVY 900
FW_BLACK 900
_____________________
"So in the interests of survival, they trained themselves to be agreeing machines instead of thinking machines. All their minds had to do was to discover what other people were thinking, and then they thought that, too."
Breakfast of Champions, Kurt Vonnegut
|
|
|
|
|
thx, i was confused by those many posibilities... I didn't get them, e.g. no idea what a FW_SEMIBOLD is.
now it works!
|
|
|
|
|
I find the documentation confusing sometimes myself.
I have not used any values for lfWeight besides the standard (regular and bold) ones, but I assume the other values are are for degrees of bold (which probably does nothing at normal point sizes).
_____________________
"So in the interests of survival, they trained themselves to be agreeing machines instead of thinking machines. All their minds had to do was to discover what other people were thinking, and then they thought that, too."
Breakfast of Champions, Kurt Vonnegut
|
|
|
|