|
useloops to find the position where you want to "insert" the new string...
after that, use malloc, strcpy, strcat, ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
lino_i wrote:
it's a char* not a string
but the functions exist also for char* strings... use your brains guy...
TOXCCT >>> GEII power
|
|
|
|
|
instead of asking me to adapt your solution to my problem just provide what I and other on the board are looking for if not then do not reply...keep your opinion to yourself.
don't reply to look like a hot shot...
get a life and in the future do not reply to any of my posts...your responses are not welcome nor needed.
|
|
|
|
|
as you like, i thaught i was helping you in giving you a piece of code... visibly, you don't need it.
i just want to add : CODEPROJECT IS NOT AN HOMEWORK SITE !!!
TOXCCT >>> GEII power
|
|
|
|
|
no you were not helping...and wake up this is a message board you should only be responding if you genuinely want to help. NO ONE IS FORCING YOU SO IF YOU DON'T HAVE PATIENCE AND ARE FRUSTRATED AT WHAT MAY SEEM TO YOU AS ROUTINE CODING THEN YOU SHOULD OPT OUT OF RESPONDING.
This has nothing to do with homework IT IS A MESSAGE BOARD WHERE YOU COME TO GET HELP FOR ALL!!! (Homework, leisure, work...whatever it may be)
so shut it!
|
|
|
|
|
|
are u laughing at your own ignorance about what a message board is for?
|
|
|
|
|
you cannot directly insert chars ( or sub string ) in an existing string, you need to rebuild the a string with the diffeernt parts.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
One way would be:
char *m_Str = "Test A";
char *Str = " of";
char szResult[10] = {0};
strncpy(szResult, m_Str, 4);
strcat(szResult, Str);
strcat(szResult, &m_Str[4]);
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi,
Does anyone know how to hide a window's title bar on a Win32 app?
Thanks in advance!
|
|
|
|
|
Use SetWindowLong API call and pass in a modified windows style. Look up the various WS_XXX window styles in MSDN. I *think* (off the top of my head) that you want to remove the WS_CAPTION style. But you may also have to remove others.
Once you have modified the style you need to call SetWindowPos like so:
::SetWindowPos( hwnd_, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOACTIVATE );
SWP_FRAMECHANGED is the critical part that causes Win32 to refresh the window properly.
You can use GetWindowLong(GWL_STYLE) to get the orginal window style and then modify that accordingly.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Hi,
Thanks for the help but I cant make it work. I can remove other WS_*** styles but not WS_CAPTION. For some reason my window has a caption bar by default. Do you know any possible reasons why?
Thanks again!
|
|
|
|
|
You might have to remove other window styles that would also cause Windows to draw a caption bar. The ones that come to mind are WS_MAXIMIZEBOX , WS_MINIMIZEBOX , WS_OVERLAPPEDWINDOW and WS_SYSMENU , but there may be others as well.
|
|
|
|
|
How to change font color and backround color C++ program
|
|
|
|
|
In CView::OnDraw(CDC* pDC) or using the CDC *pDC=GetDC() member function
//To Set font color
COLORREF oldCol=pDC->SetTextColor (RGB(0,0,255));//Blue Color
// use font to draw stuff
//.....
pDC->SetTextColor (oldCol);//restore old font color
//the same Way to set back ground color
COLORREF OldbkColor=pDC->SetBkColor (RGB(0,0,0));
//Do your drawing
//......
//if U want to restore BK Color
pDC->SetBkColor(OldbkColor);
|
|
|
|
|
what about dialog based programs ?
TOXCCT >>> GEII power
|
|
|
|
|
see this arrticles
http://www.codeguru.com/Cpp/W-D/dislog/background/article.php/c1849/
http://www.codeguru.com/Cpp/W-D/dislog/background/article.php/c1895/
|
|
|
|
|
For dialog based programs, you will have to override a handler WM_CTLCOLOR. This can change the colors of all the controls on a dialog and the color of the dialog itself.
<marquee> STUCK STUCK STUCK STUCK
Stuck to Programming through an unbreakable bond
My Articles | My Blog
|
|
|
|
|
How to change font color and backround C++ program
|
|
|
|
|
Where you want change color : in control, in view, int title bar ... ?
|
|
|
|
|
Hello guys...
Now, i am currently working to develop an application for my school project. My project is making communication between two computer via telephone line using modems.I wanted to enhance my application, and here is my question :
How do I add an event sound to my application? (i.e. when one computer making call to another, and its receive "RING" message from modem and produce sound (ring.wav)
->> I mean, when one computer receive "RING" message (its shows in edit box), i want the computer produce ringing tone.(some sound alert for the user)
Beside that, when the transfer of data is complited, the computer produce sound for this event.
I have surfed the web for examples and tutorials, but majority of them seem to be a little too advance for me. If someone out there can explain the basics to me, along with a simple example, I would really appreciate it.
|
|
|
|
|
In your .cpp file you have to include mmsystem.h and link to the winmm library. You can then use PlaySound to play .wav files.
#include <mmsystem.h>
#pragma comment (lib, "winmm.lib")
.
.
.
PlaySound(_T("Ring.wav"), NULL, SND_ASYNC | SND_FILENAME);
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
hello programmers,
the last code snippet from here:
http://www.codeproject.com/cpp/CPPMathFun.asp
woun't compile ,
here it is:
#include
using std::cout;
using std::endl;
template<int n="">
class CalculateCycle
{
public:
enum { count = CalculateCycle&t N % 2 ?
(N * 3 + 1) : (N / 2) >::count + 1 };
};
template <>
class CalculateCycle<1>
{
public:
enum { count = 1 };
};
int main(int argc, char* argv[])
{
const int iNo = 22;
cout << "Cycle length of " << iNo << " is = "
<< CalculateCycle<ino>::count << endl;
return 0;
}
the article is called
Template Meta-programming
please help, what can I do ?
// Lord Byte has started to code
void swap(char **p, char **q)
{
char *tmp;
tmp = *p;
*p = *q;
*q = tmp;
}
|
|
|
|
|
hi!
i have the following line which i print output to the user:
printf("%s:%f\t %s:%f\t %s:i\n", "Mean",mean,"Variance",var,"Number",N);<br />
now i hope to instead write these values into a text file. is there any way i can do it?
thanx!
|
|
|
|
|
Try looking up the functions fopen() , fprintf() , and fclose() .
Software Zen: delete this;
|
|
|
|