|
that means the application has some bugs which are exposed in one machine and not the other.
remmeber the famous quote - "it works in my machine".
Saurabh
|
|
|
|
|
Oh, how I wish I could disagree, but you are absolutely right.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Can someone tell me how to access the 'ProductVersion" from VS_VERSION_INFO in the resource file.
I want to set the version number when I compile and use in a MessageBox from within my program
Thanks
|
|
|
|
|
BOOL CString::LoadString( UINT nID );
throw( CMemoryException );
Return Value
Nonzero if resource load was successful; otherwise 0.
Parameters
nID
A Windows string resource ID.
Reads a Windows string resource, identified by nID, into an existing CString object.
The following example demonstrates the use of CString::LoadString.
<br />
#define IDS_FILENOTFOUND 1<br />
CString s;<br />
if (! s.LoadString( IDS_FILENOTFOUND ))<br />
{<br />
AfxMessageBox("Error Loading String: IDS_FILENOTFOUND");<br />
...<br />
}<br />
路漫漫其修远兮,吾将上下而求索。
|
|
|
|
|
There are a number of articles here on CP.
Just do a search on 'version'.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
cgb143 wrote:
Can someone tell me how to access the 'ProductVersion" from VS_VERSION_INFO in the resource file.
Use [GetVersionInfo] api or try out this wrapper class:-
www.codeproject.com/file/VersionInfo.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I am trying to write a function that will take a string (read from a whole line) as input. Then for each phrase found in the line, it will add it to a vector. Finally, we return the number of phrases we found. The way that phrases are delimited are with the tab character. The below almost works, but I am finding that it is delimiting on any whitespace. Is there some easy way to tell the istringstream >> operator to only use tabs?
int setcol(const std::string& input_record, std::vector<std::string>& colv)
{
std::istringstream s(input_record);
std::string temp;
colv.clear();
while (s >> temp)
{
colv.push_back(temp);
}
return colv.size();
}
--
Marcus Kwok
|
|
|
|
|
I got it by brute force, but I am hoping someone has a more elegant way to do this.
int setcol(const std::string& input_record, std::vector<std::string>& colv)
{
std::string temp;
colv.clear();
typedef std::string::const_iterator CI;
for (CI ci = input_record.begin(); ci != input_record.end(); ++ci)
{
if (*ci != '\t')
{
temp += *ci;
}
else
{
colv.push_back(temp);
temp.erase();
}
}
colv.push_back(temp);
return colv.size();
}
--
Marcus Kwok
|
|
|
|
|
|
Greetings All,
This might be a rather simple question,
I understand how Reverse works in gDI+ but i dont see a good application of this method, Is it possible to create a test that would use this method and display visual differences on whether method was used or not?
Sincerely,
Max Pastchenko
|
|
|
|
|
Hello!
May I use Windows XP icons in my application? I searched the Microsoft website, but couldn't find anything related to licensing their icons... Or are they free to use for anyone? I don't need them as application icon, I need them for some lists and toolbars...
Best regards
|
|
|
|
|
you has better alter the icon not fully the same as M$
or you may be some day charged with....
路漫漫其修远兮,吾将上下而求索。
|
|
|
|
|
|
I believe that distributing / using the icons that are distributed with the SDK is fine, but extracting one from a copyrighted application violates that copyright.
|
|
|
|
|
how can i get the number of instances of my clasess?
there is one way like we can declare a static member variable and increment that in the constructor, but if you create a derived object, that count also increases
in the base class. how can i prevent that ?
i need to get the count of parent objects only.
any idea?
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
just write two constructors function
路漫漫其修远兮,吾将上下而求索。
|
|
|
|
|
Decrement the counter by one in your derived class's constructor?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
|
can u write the code for that ???
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
class CBase {
static int m_iCounter;
public:
CBase() {
m_iCounter++;
}
virtual ~CBase() {
m_iCounter--;
}
};
class CChild : public CBase {
};
now, you could do this :
void foo() {
CChild myChild1;
CChild myChild2;
{
CCHild myChild3;
}
myChild1.~CChild();
}
when the program goes out a scope, the objects destructor is automatocally called.
for a CCHild object, the CCHild destructor is firstly call, then its CBase destructor...
was it well what you wanted ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Writing a virtual destructor for a base class is generally a good idea, but is not absolutely necessary for this application.
That apart, my interpretation of the OP's question was that he wanted to count only explicitly created instances of CBase, that's why I suggested decrementing it in derived class constructors.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hey how it is possible?
how can i say other ppls to decrement parent clasess counter in your clasess?
i need to maintain my class as an entity, i just need to know the number of instances of my base class
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
class Base
{
protected:
static int counter;
public:
Base() { counter++; }
};
int Base::counter;
class Derived : Base
{
public:
Derived()
{
counter--;
}
};
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
How can I convert a string to an ASCII value and then store it in an element of a char array? For example, I'd like the 30 to be stored in element[18] of the array. This is what I have. Thanks!
char array[20];
array = "Supernatural";
CString str = "40";
strcpy(array[18],str); error C2664: 'strcpy' : cannot convert parameter 1 from 'char' to 'char *'
|
|
|
|
|
str.GetBuffer will work!
路漫漫其修远兮,吾将上下而求索。
|
|
|
|