|
Thanks..I got it to work..All I needed actually was to delete the Class object first which is a Graph in this case.
Thanks
|
|
|
|
|
I want to know any builtin function for highlighting a given keyword in HTML file.
Only the text outside of tags, comments, script code should be highlighted.
I think this could be done by :
Finding out the position of keyword which is a normal text
Replace it with </FONT> keyword </FONT>
Write the new content into the HTML file
Is there any standard method for doing the same?
Any suggestion would be greatly appreciable!!
--
"Programming is an art that fights back!"
|
|
|
|
|
You should look at HTML DOM Parser.
Some interface and methods that may help you are
IHTMLDocument<br />
IHTMLElement2::getElementsByTagName<br />
IHTMLDocument2::createElement<br />
IHTMLDOMNode::replaceChild<br />
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Is there a way to create a class that can be instantiated with different method names? For example, I would like to have an unnamed method in class foo, that can be renamed at compile time using template parameters (or some other method). I envision the class definition as follows:
template<const char* const MethodName>
class foo {
public:
double (MethodName)() {
return 0;
}
}; And it would be instantiated/used in the following way
foo<"asdf"> fooWithMethodASDF;
foo<"mnbv"> fooWithMethodMNBV;
double a = fooWithMethodASDF.asdf();
double m = fooWithMethodMNBV.mnbv(); The purpose behind attempting to do this is because I have two classes, both with three members of type double that have different names, and all other code is identical. Perhaps I could use properties with get/set methods in two different classes that inherit the public interface from the base class, but I am wondering if there is another way to implement this functionality? Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Skippums wrote: Is there a way to create a class that can be instantiated with different method names?
In some way I interpret this as you have a desire to use types as variables, which suggests that you should probably re-evaluate you design.
Even if you were able to do what you want, I don't see the benefit other than adding to the confusion.
Skippums wrote: The purpose behind attempting to do this is because I have two classes, both with three members of type double that have different names, and all other code is identical.
This sound like a very good opportunity to use inheritance and polymorphism.
Perhaps you disagree depending on how you're using the data, but then you may need a container instead and could probably use the std::vector template (or a similar container) combined with std::for_each from the STL library.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I thought about that as well... there is just some complexity in doing it via inheritance. The most direct way that I can think of going about this is to create protected members in the base class, and write get/set properties for each of the members that I want to have a dynamic name in the inherited class. The code for this would be as follows (the Property class simply allows me to use the syntax "instance.propName" without parentheses):
class base {
private:
double m_Val;
protected:
double getVal() {
return m_Val;
}
void setVal(const double other) {
m_Val = other;
}
public:
...
};
class asdf : public base {
public:
Property<asdf, double> m_asdf;
asdf() {
m_asdf.Container(this);
m_asdf.Getter(&this->getVal);
m_asdf.Setter(&this->setVal);
}
}; Not too terrible.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Skippums wrote: Is there a way to create a class that can be instantiated with different method names
The only way I could perceive is to use the pre-processor...but that would be a real hack.
The problem is that method names are tokens. They are fixed between the pre-processor and the compiler's lexer.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I want to select multiple directories from the dialog box and OnOk I should get the path of all the selected directories.
plz somebody help me.
Thanks in advance
Ranjith
|
|
|
|
|
ranjith_adapu wrote: from the dialog box
What does that mean?
|
|
|
|
|
By using CFileDialog, we can select multiple files. Similarly, I want to select multiple directories.
|
|
|
|
|
ranjith_adapu wrote: I want to select multiple directories from the dialog box...
Which one?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
Hi Folks,
I want to write an FSM which starts with an idle state and moves from one state to another based on some event. I am not familiar with coding of FSM and google didn't help. Appreciate if someone could post the C data structure that could be used for the same.
Thanks,
syuga2012
|
|
|
|
|
|
Boost.Statechart[^] might take the pain away
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
struct FSM{
enum { RAMEN=1,ELICHE,CANNELLONI,FARFALLE,TAGLIATELLE,SPAGHETTI };
unsigned int state;
};
FSM IAm;
...
Iam.state=FSM::ELICHE;
... I imagine his noodliness has a lot more states than that, but this is a start. Good luck figuring out the IFsm createUniverse() method.
a finite state machine is usually a markup language.. the prof wants you to draw some pictures w/ some arrows. You could actually use this struct to keep track of your state, if you wanted...
|
|
|
|
|
Actually the only C data structure you need to implement an FSM is int. Each integer value represents a different state of your machine. It's that simple.
|
|
|
|
|
Hi all,
In my main dialog we have a menu, in this menu we have some options as per the option selected we want the values to be changed in all the other 3 dialog boxes that we have in the application.We have actually created all the 3 dialogs in the main dialog using create hence the value is not getting loaded in the other windows..Plz anyone help me
Kind regards
anitha
|
|
|
|
|
AnithaSubramani wrote: we want the values to be changed in all the other 3 dialog boxes
Use the observer pattern[^] or send a user defined message to the other dialog boxes to inform them that the value should be updated.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
AnithaSubramani wrote: We have actually created all the 3 dialogs...
Are they modal or modeless?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
They are modelless dialog boxes.
|
|
|
|
|
Have you tried posting a message to the other dialogs that need updating?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Dear all,
In my program we have written code to download folders from the server to the PC,When the downloading process is started my dialog box disappears.Actually we have 3 dialog boxes and all these 3 boxes are loaded once our application starts and each and every time when i want a window the corresponding window is hide and displayed using FindWindow() and ShowWindow()... What can be the problem Plz anyone help me...
Kind regards
anitha
|
|
|
|
|
Read what you've written and see if you think it makes sense.
The only thing clear is that you have three dialog boxes. I cannot figure out whether you want them hidden or shown and whether the use of FindWindow() is part of the problem or the solution.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
we have 3 dialog boxes and all these 3 boxes are loaded once our application starts and each and every time when i want a window the corresponding window is found using FindWindow() and displayed using ShowWindow()...In one of the dialog when we click a button it starts downloading the files from the server. When it is downloading i need a progress bar to be ruuning in my dialog box. But in my code the dialog box disappears. Please help me to know what can be the problem why the dialog box disappears when the it starts downloading..
|
|
|
|