|
Nitheesh George wrote: char szFileNameOnly = strrchr(szFilePath,'\\');
Good, but a small correction. strrchr returns a character pointer.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
When you drag a URL from within a browser onto a windows explorer folder windows explorer creates .URL file that has the same name as what is displayed if you were to bookmark the URL. The contents of the .URL file contains the iconfile and iconindex which are somehow gotten by connecting to the URL link. What APIs are available to retrieve this information?
|
|
|
|
|
hi i have a stepper motor named "philips MB11-4786" and i dont know which circuit i should use to control it via parallel port.
is there anyone having an idea?
|
|
|
|
|
Maybe try the Hardware board[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Do you know which pin does what on the motor (e.g., pin 1 is on, pin 2 is off, pin 3 is forward, pin 4 is reverse)?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i got some information, but finding it was very hard.
it has six wires. two reds, two yellows and two grey.
Grey1 --- --- Grey2
¦ ¦
¦ ¦
Red1 --- --- Red1 (reds are common)
¦ ¦
¦ ¦
Yellow1 --- --- Yellow2
i cannot understand which wire has to be connect to the uln's first output and second etc.
thanks for your answer.
|
|
|
|
|
I'm having trouble with vtables. I have a class:
class CLatticeNode {
public:
CLatticeNode(void);
virtual ~CLatticeNode(void);
CLatticeNode(double SpotPrice) {
m_dUnderlyingPrice = SpotPrice;
m_dOptionValue = 0.0;
};
inline double GetUnderlyingPrice(void) const { return this->m_dUnderlyingPrice; };
inline double GetOptionValue(void) const { return this->m_dOptionValue; };
inline void SetUnderlyingPrice(double Price) { m_dUnderlyingPrice = Price; };
inline void SetOptionValue(double Value) { m_dOptionValue = Value; };
private:
double m_dUnderlyingPrice;
double m_dOptionValue;
};
I have a std::vector of boost pointers declared as follows:
typedef boost::shared_ptr <CLatticeNode> CLatticeNodePtr;
and a vector of vectors:
std::vector< std::vector<CLatticeNodePtr> > Tree;
I'm trying to call the member function GetUnderlyingPrice as follows:
Tree[col].push_back(CLatticeNodePtr(new CLatticeNode((Tree[col-1][row])->GetUnderlyingPrice() * m_dU)));
Basically I'm trying to access the CLatticeNode member function GetUnderlyingPrice via
the call:
Tree[col-1][row]->GetUnderlyingPrice()
But on compile, I consistently get:
g++ -L/usr/local/boost-1.34.1 -o "AMMPricer" ./AMMPricer.o ./LatticeClass.o ./TrinomialTree.o
/usr/bin/ld: Undefined symbols:
vtable for CLatticeNode
collect2: ld returned 1 exit status
make: *** [AMMPricer] Error 1
Is this a linker error or have I got something wrong in the class definition?
modified on Wednesday, January 23, 2008 3:57:49 PM
|
|
|
|
|
73Zeppelin wrote: Tree[col].push_back(CLatticeNodePtr(new CLatticeNode((Tree[col-1][row])->GetUnderlyingPrice() * m_dU)));
If you spit those line, will that work ? or does that give you some other error/warnings ?
can you test your code with Visual Studio compiler ?
|
|
|
|
|
Yes, I've tried splitting them and I get the same problem. This code is in a unix environment - I don't have the ability (or the time) to port it to VS. The vtable problem is usually a linker error, but I suspect there's something wrong with the class definition. I can't see what it is though.
|
|
|
|
|
73Zeppelin wrote: g++
There's your problem
Seriously, have you tried this without using the boost shared ptr? If that works then maybe it's the way you're using the smart pointer? I would try and break up that single line statement into *all* it's component parts and see if there's something weird going on there.
One other thought - do you implement the default constructor? You don't have any impl here, maybe that's the problem?
¡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
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Jim Crafton wrote: There's your problem
I know, g++ is not the most stress-free compiler...
Jim Crafton wrote: Seriously, have you tried this without using the boost shared ptr? If that works then maybe it's the way you're using the smart pointer? I would try and break up that single line statement into *all* it's component parts and see if there's something weird going on there.
I have tried breaking it up into a million little pieces, but I consistently get the vtable error. That's why I called this thread "VTable Madness". It's driving me insane.
Jim Crafton wrote: One other thought - do you implement the default constructor? You don't have any impl here, maybe that's the problem?
Hmmmmm, it should be in there. If not, I've done it like this in the .h file:
CLatticeNode(void) {;};
|
|
|
|
|
Jim Crafton wrote: There's your problem
Seriously, have you tried this without using the boost shared ptr? If that works then maybe it's the way you're using the smart pointer? I would try and break up that single line statement into *all* it's component parts and see if there's something weird going on there.
One other thought - do you implement the default constructor? You don't have any impl here, maybe that's the problem?
Found it! Not the CONSTRUCTOR, but the virtual DESTRUCTOR wasn't implemented. Gah!
|
|
|
|
|
73Zeppelin wrote: Found it! Not the CONSTRUCTOR, but the virtual DESTRUCTOR wasn't implemented. Gah!
Sometimes we spend days together to hunt down a complex problem and finally it boils down to something like this.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Awesome! I think I've seen a similar kind of error with VC 6, only it's occurs in the compile phase as opposed to the linking phase.
¡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
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Yeah, truly annoying. THanks for the push in the right direction.
|
|
|
|
|
I'm having trouble finding a c or c++ function that will convert a string of 1's and 0's to a string of characters. I also need something that will do the opposite. I was just wondering if there is a class out there that will handle this. I really don't feel like writing my own, if I can find one that will do it for me.
|
|
|
|
|
mindspin311 wrote: I'm having trouble finding a c or c++ function that will convert a string of 1's and 0's to a string of characters.
Assuming you meant to its numeric equivalent, check out strtol() .
mindspin311 wrote: I really don't feel like writing my own, if I can find one that will do it for me.
There are plenty available (e.g., CP, Google), but writing your own will take all of five minutes. You'll spend more time than that searching (and then implementing).
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: but writing your own will take all of five minutes
Sure?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Ok, four minutes if you don't do any simultaneous browsing or game-playing.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
OK, I promise to do no browsing nor game-playing (until the four minutes timeout expiration) while waiting him to complete the job.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hi i'm wondering if the console could be viewed in windows forms?
I'm not sure what the line would be to view the console.
Sorry to post this on this forum but the is best forum in terms c++ help.
|
|
|
|
|
Are you wanting to spawn, and view the output of, a console application from your code?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have code that writes to a console but I can't see the console because it is a windows forms application i'm writing
|
|
|
|
|
I'm confused. If you are already writing to the console window, can't you just write the same text to some other location (e.g., a form)?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The code that writes to the console is to connect to a server and I don't want that to be shown on the form for the user to see but in the background in a console. It connects to the server fine but just doesn't display in a console window.
|
|
|
|