|
Or strcat ? I suspect he's doing a homework assignment ( which is fair enough, he's had a go and posted code to ask for help, but I can't think of any other reason to write another string class. Having said that, I did it for the sake of the exercise, although I obviously use basic_string rather than my own, that was not the point. ).
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
He may be doing what he's doing because...
a) the existing code that has to be amended but cannot be changed beyond the new code being added
b) an insane project lead refuses to think outside the box and insist that the guy use his (the project lead) classes
c) he's doing a homework assignment which requires him to write his own string class
d) he doesn't like the std::string class
Why can't you just answer the question posted instead of asking why he doesn't use this or that?
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
The same way you answered the question?
His code doesn't even call the function he's asking for so I was somewhat confused as to what he wanted.
|
|
|
|
|
Hi, I need to make my own owner drawn/custom drawn trackbar control but all the examples that I have found are geared for the listview control. I was wondering if anyone has a tutorial or an example of what to do.
Thanks,
Clint
|
|
|
|
|
Here's the example - it draws the 'channel rectangle' in green:
void CMySlider::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
{
LPNMCUSTOMDRAW pcd = (LPNMCUSTOMDRAW)pNMHDR;
if (CDDS_PREPAINT == pcd->dwDrawStage)
{
*pResult = CDRF_NOTIFYITEMDRAW;
return;
}
*pResult = 0;
if (TBCD_CHANNEL == pcd->dwItemSpec &&
CDDS_ITEMPREPAINT == pcd->dwDrawStage)
{
CDC dc;
dc.Attach(pcd->hdc);
CRect rc;
GetChannelRect(rc);
dc.DrawEdge(&rc, BDR_SUNKENOUTER, BF_RECT);
rc.DeflateRect(2, 2);
dc.FillSolidRect(&rc, RGB(0, 255, 0));
dc.Detach();
*pResult = CDRF_SKIPDEFAULT;
}
}
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I can kind of get it to work. My control won't draw itself unless I set a breakpoint somewhere in the function and press F5 repeatedly. I am not sure if I have my message handler set up right. If anyone has a complete implementation that they could share with me so I can study it.
All help is much appreciated!
Thanks,
Clint
|
|
|
|
|
I have an MDI app that contains an open and modified document. The file specification of the document is in a UNC format (GetDocument()->GetPathName() returns \\Server\Share\MyDocument.txt). When I click on Save As, MFC calls GetSaveFileName() for me to display the CFileDialog so that I can enter a filename. When the dialog box is displayed I get four copies of the following message displayed in the debugger's output window: "First-chance exception in MyProgram.exe (RPCRT4.DLL): 0x000006BA: (no name)." If I look at the m_ofn.lpstrFile member variable that GetSaveFileName uses, the filespec is in UNC format. If I gludge things up, map a drive, and change m_ofn.lpstrFile to be a normal file spec (c:\temp\MyDocument.txt), I don't get these exceptions! In either case, the Save As appears to work just fine - the exceptions don't seem to bother things.
Does anyone with UNC experience know what is going on here? Is there something special I need to do when using UNC file specs - i.e. some flag I need to set?
Thanks,
Don Sanders
|
|
|
|
|
Does anyone with UNC experience know what is going on here?
I don't have much UNC experience, but think that you can safely ignore these messages. KB article Q105675 has more info on 'first-chance exceptions'.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
How can I make the computer beep w/ a few lines of code?
|
|
|
|
|
|
or
::MessageBeep(0);
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
Is easy:
With the Beep function....
Carlos Antollini.
Today is Friday?
No Bob!!!
|
|
|
|
|
I don't know if it calls messagebeep, but beep(50,50) works fine. You can put any numbers you want, they still sound the same ;0)
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Beep(500,500);
works best on my w2K system.
|
|
|
|
|
According to Big Bad Bill, Beep() does the right thing on NT (and perhaps 2000), but not on Win 9x/ME.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
I frequently use Beep as a sophisticated debugging tool, and I've not noticed it doing any different under W2000. Not that I was looking.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Guys, I agree with Christian, The most important that the machine will do a simple Beep. It did Work?
Ready.....
Cheers!!!!
Carlos Antollini.
When Is Friday?
|
|
|
|
|
\a makes a beeb for those who have ME and cant use the beep function(like me )
cout<<"beep sound \a";
<marquee>Raffi
|
|
|
|
|
Unplug the keyboard and reboot
|
|
|
|
|
COULD SOMEONE HELP ME OUT AS TO HOW TO WRITE A WRAPPER IN Visual C++ 6 I have a dll (SbLm_LogClient.dll ) written in C which I need to use in my vb code. I guess the DLL functions uses _cdecl convention. I guess the way round it is to write a wrapper in C++ using the __stdcall convention. I know the dll exposes two interfaces.
Interface 1 - SbLm_Log accepts an Integer and a Char
Interface 2 - SbLm_CloseLogClient is a sub, it accepts no parameters
I have an include file from the from the author of the .a and .h file. The content of the .h file is below
#ifdef WINDOWS_NT
#ifndef SbLm_LogClient_h_included
#define SbLm_LogClient_h_included
#ifdef BUILDING_DLL
#define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
#define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */
DLLIMPORT int SbLm_Log(int, char *);
DLLIMPORT int SbLm_CloseLogClient();
#endif // SbLm_LogClient_h_included
#else
int SbLm_Log(int, char *);
int SbLm_CloseLogClient();
#endif
|
|
|
|
|
I am developing my own custom ActiveX Control for the first time and I am not sure how to design the GUI for this control using the resouce editor. Do I have to setup my control in code?
Please help.
|
|
|
|
|
I have a serial port class which continously polls the serial port and writes to the serial port as needed. I have a seperate thread for reading from the serial port. My problem is that I created the handle for the serial port in the main thread to be used when writing to the serial port, but I need to use that same handle in the other thread so that I can read from the serial port. I passed the handle to the worker thread, but I can't use it because it's not part of the thread's handle map. How can I get a handle to the serial port in the worker thread?
Mark Lenz
|
|
|
|
|
When I need to make that I use a global Variable with the handle that I need to use.
For example If I have a conecction with a database, I don't use diferent conections for each handle, I put the connection pointer into a global variable, that is acceded for each handle, and this work, i don't Know if you will have any problem with this practice.
I hope to help you...
Carlos Antollini.
Is today Friday?
No Bob!!!
|
|
|
|
|
take a look at DuplicateHandle,
and use 1 handle for writing and the other for reading..
hope this helped
B.Bruggeman
|
|
|
|
|
Does the structure, for example 8 bpp bitmap, goes thus:
Red;
data+=byte;
Green;
data+=byte;
Dark blue;
data+=byte;
// Miss of reserve
data+=byte;
If so, whence to take colours?
Willn't structure RGBQUAD help any more?
I.e. what analog will be to string:
Red = Quad->rgbRed?
There can be I are mistaken?
In what my error?
|
|
|
|