|
dazinith wrote:
i got the code to do what i want..
Excellent!! Glad I could be of help! Now I really must get off my posterior and update the article!
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
is it possible to use these same ideas to store a CObArray inside of another CObArray? for example, if the CObArray im serializing now contains a data variable which is also a CObArray with its own serialize function, when the top level CObArray gets serialized does this in turn call the serialization of the lower object?
-dz
|
|
|
|
|
Absolutely!
The top level CObArray doesn't know how to serialize its content objects. It just tells each one "go serialize yourself". If the content object is another CObArray, it goes about serializing itself by storing its signature, version, item count, and then asks each of its objects to serialize themselves.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
i have a Cedit control that hold phone#.
i can create a display mask to show the phone # like(111)111-1111.
but how can i create this as an imput mask for automatically place the () and- while typing and also not let them type alpha char?
thank you.
|
|
|
|
|
try looking in the Edit Controls section of this site. there are probably five or six of them there.
-c
"Do you mind if I smoke?"
"Madam, I don't care if you burn."
-Oscar Wilde
Smaller Animals Software, Inc.
|
|
|
|
|
http://www.codeproject.com/editctrl/maskededit.asp
im using this control, its pretty k-rad, but it seems to have a problem when tabbing from field to field (doesn't highlight the field)..
btw, the typo in the title made me laugh
-dz
|
|
|
|
|
What the hell is "k-rad" ? is it kEwl sPeEK ??
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
somethin like that
-dz
|
|
|
|
|
Hi guys
Does anyone know how to change the icon of an executable? I could really do with a handy application or something.
Cheers
Tom
|
|
|
|
|
In your project's ResourceView, click on Icon, you will find IDR_MAINFRAME, that's the icons used for your executable. Remember to change both the Standard (32x32) and Small (16x16).
|
|
|
|
|
The icon shown for an executable by Explorer is the one with the lowest ID. If you have VS, you can edit the resources for any program; just open it as a resource file.
Sometimes i only remember, The days when i was young Nowadays no one remembers when they were young and stupid... ADEMA, The Way You Like It
|
|
|
|
|
If you don't have the source, try ResHacker.
/moliate
|
|
|
|
|
Here's a simple program I wrote just now:
#include "iostream.h"
#include "fstream.h"
void main()
{
int array;
ifstream infile ("binga");
infile >> array;
cout << array << endl;
}
the file binga looks like this:
1,2,3,4,5,6
a,b,c,d,e,f
one,two,three,four,five,six
So when I run the program, why do get the output as
-858993460
shouldn't the output just be
1
|
|
|
|
|
Your program does the equivalent of atoi("1,2,3,4,5,6") when enters infile>>array. You have to use space or CR to separate the numbers, not commas.
rechi
|
|
|
|
|
okay...
I just changed the file "binga" so it looks like this:
1 2 3 4 5 6
a b c d e f
one two three four five six
I ran the program again and I still got the output as
-858993460
as opposed to what it clearly should be:
1
what is going on here??
|
|
|
|
|
I think something wrong in your computer or your OS. Because in my computer, it's right. Output is: 1
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
Your main problem is simply that it's poorly written code.
For one, void main is NOT valid C++. For another, you don't initialise your variable, and for a third, you don't check to see if you've succeeded in opening a file, which you give only a relative path to.
int main()
{
int array = -1;
ifstream infile ("c:\binga");
if (infile.isopen())
{
infile >> array;
cout << array << endl;
}
else
cout << "Unable to open file";
}
I think you'll find it cannot open/find the file and is giving you the initial value of array.
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 trying to create a custom toolbar to be used inside MS Word, however I'd like it to contain edit boxes, custom icons, etc. I'd like to do this using VC++/MFC, but I can only find references to "custom command bars" using VBA.
I'd like it to appear like Visual Assist's toolbar in DevStudio.
If anyone has any suggestions, or could point me in the right direction I'd be very grateful.
Alan.
|
|
|
|
|
-Create your toolbar.
-After that, you edit your resource by a editor, add any SEPARATOR neccesary in resource.
-In OnCreate(), use method SetButtonInfo(..) of the toolbar to change the width of edit box (or combobox...)
-Use Create(...) of edit box (or combo...) to create it onto the toolbar.
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
I'm trying to set the font in my CComboBox dropdown but am having
trouble getting it to work. The Combo Box has the right font information
but it doesn't seem to use it when displaying the text in the box when it
is dropped-down. Any thoughts on how to get it to work? Just for some background, I'm creating the CComboBox in the CMainFrame class and placing it on a toolbar to replace a button. I'm creating the CFont object and setting the font in the CComboBox in the CMainFrame::OnCreate() function. Not sure what I'm doing wrong.
|
|
|
|
|
Try SetFont() .
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
I tried that. I set the font with a font I created using CreatePointFont().
If I do a GetFont() on the CComboBox object, it returns the font information that I sent it using SetFont(), but the font in the CComboBox when it is drawn remains whatever the default font is when it is created.
|
|
|
|
|
You should check that your font object (example: m_font) must be declare as a class member. Don't declare it as a local variable.
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
I have commands that come into a program. Each command has a set of parameters depending on the type. So, I made a base class for the command and derived the the commands from this.
One of the operations was to convert the command to a string in a particular communication protocol and was named
toString(). Now I have to support another protocol. I could add another function to the base class (say toProtocol2String(), but is there a better way to do this?
The data to generate the strings are in the derived classes right now.
Or is there an entirely different way of looking at it?
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Hi!
Maybe: define base class for translating commands into strings:
class ICmdProtocol;
redefine method in the command class:
CString toString( IProtocol * );
And now, move the conversion implementation from command itself to protocol, or to command based on actual protocol.
You can always define current protocol for all commands too (as static pointer in base class for example).
Hope this helps
Mukkie
|
|
|
|