|
cool man..I just said one truth regrding the programming field.
How ever I still remeber one bug while trying to extract the file name from path. We were extracting the file name by reverse finding the "\". But later a bug was reported and reason was that, in one secnario in the path input to that function, instead of "\", seperator was "/"
|
|
|
|
|
That's right Naveen.
BTW, how many yrs of experience do u have in VC++? Do u have any Skype/Yahoo id?
Come online at:-
jubinc@skype
|
|
|
|
|
Don Box wrote: Do u have any Skype/Yahoo id?
Yahoo only... Have send my chat id to your mail box. check
|
|
|
|
|
Naveen wrote: Yahoo only... Have send my chat id to your mail box. check
To my which e-mail id? If it is skype, then there's no mail box for this. Its my skype id (just for chatting).
Come online at:-
jubinc@skype
|
|
|
|
|
No I clicked "email" option in the message board.
My chat id is nave432@yahoo.com
|
|
|
|
|
Naveen wrote: Less u write, less will be the bugs...
Write no code and you'll have absolutely no bugs.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Yes. but the damn requirments doesnt allow me to be like that
|
|
|
|
|
I do have written a function to do make the job done, but I still want to know is there some exist functions can do this job for me.
A Chinese VC++ programmer
|
|
|
|
|
_splitpath() is better option.
Come online at:-
jubinc@skype
|
|
|
|
|
You may use PathFindFileName() like this:
TCHAR *szPath = _T("C:\\Program Files\\codeproject.txt");
AfxMessageBox(PathFindFileName(szPath));
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: PathFindFileName()
Thank you Rajesh R Subramanian
I think this is the simplest way I have ever seen
A Chinese VC++ programmer
|
|
|
|
|
zengkun100 wrote: Thank you Rajesh
You're welcome.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
#include <Shlwapi.h>;<br />
#pragma comment(lib, "shlwapi.lib")<br />
<br />
LPTSTR lpszFileName = PathFindFileName(szPath);
============
Einstein
Seeing is believing.
|
|
|
|
|
Hi,
char szFilePath[MAX_PATH] = {"C:\\Program Files\\codeproject.txt"};
char szFileNameOnly = strrchr(szFilePath,'\\');
if(szFileNameOnly)
szFileNameOnly++;
now szFileName points to "codeproject.txt"
i think this works fine for u.
|
|
|
|
|
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) {;};
|
|
|
|