|
Try putting that code in your main() function.
|
|
|
|
|
Remove the static local variable making it an argument passed by reference.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi..
return i + i;
Please let me know what does this return?
wether it reurns addition of i + i Or it returns only i.
Thanks.....
modified on Monday, June 15, 2009 1:40 PM
|
|
|
|
|
Why not just try it and see?
Anand9669 wrote: wether it reurns addition of i + i Or it returns only i.
Statements end with semicolons, so 2i will be returned. Otherwise, why would the compiler choose to ignore the + i; (and thus produce an error)?
"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
|
|
|
|
|
Thanks for ur reply
right now i don't have c compiler in my machine..
|
|
|
|
|
it would be very much the same in the majority of programming languages...
Assuming i is int,
int a=i+i;
return a;
does return the same value as
return i+i;
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Thanks for ur reply..
u mean to say it is as good as
return (i + i);
and there is no need of paranthesis...
|
|
|
|
|
I am trying to handle the 'Cancel' button in my property pages (wizard) and I've implemented the 'OnQueryCancel' function to catch the cancel message successfully, but unfortunately it seems that the 'OnQueryCancel' function is being called twice if the user clicked the cancel button. Any ideas on how I could address this issue? Thanks!
virtual BOOL OnQueryCancel();
BOOL CWiz_Page1::OnQueryCancel()
{
int ret;
ret = MessageBox("Are you sure?", NULL, MB_YESNO);
if(ret == IDYES)
return true;
else
return false;
}
|
|
|
|
|
JBAK_CP wrote: ...but unfortunately it seems that the 'OnQueryCancel' function is being called twice if the user clicked the cancel button.
By default, this does not happen. You've added (or removed) something that is causing this. Trying creating a new CPropertySheet -based project from scratch and note its behavior.
"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,
I have problem with the CListCtrl drag and drop. I used the CreateImageEx to display the image while dragging the contents of the CListCtrl but unfortunately the image is displaying at the left top corner of the screen and not relevant to my GUI where the CListCtrl is placed.
The following is the code snippet. Please advice why the image is displayed like that.
void TestDlg::OnLvnBeginrdragList3(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
OnBegindrag(&pList, pNMHDR);
*pResult = 0;
}
void TestDlg::OnBegindrag(CListCtrl* pList, NMHDR* pNMHDR)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
if (pList->GetSelectedCount() <= 0)
return;
int iItem = pList->GetSelectedCount();
POINT pt;
m_pDragImage = CreateDragImageEx(pList, &pt);
if (m_imageList == NULL)
return;
m_pDragWnd = pList;
CPoint ptStart = pNMListView->ptAction;
ptStart -= pt;
m_pDragImage->BeginDrag(0, ptStart);
m_pDragImage->DragEnter(GetDesktopWindow(), pNMListView->ptAction);
SetCapture();
}
|
|
|
|
|
Please anybody help me!!!
|
|
|
|
|
Hello all, im very much confused with this make this snippet work,, let me explain my problem in simple. please follow the folling code.
class ClassA
{
public:
function_A();
function_B();
}
class Class1
{
public:
ClassA A1
Function_1();
}
class Class1::Function_1()
{
Dlg1.DoModal();
A1.function_A();
A1.function_B();
}
class ClassDlg
{
FunDlg();
}
ClassDlg::OnRefresh()
{
i wanted "A1.function_A();"
i wanted "A1.function_B();"
}
The Dialog window will be called by "Class1::Function_1()" so after closing the dialog window the function "A1.function_A();" and "A1.function_B();" are called in order to update the contents of the mainpage(say property page). actually the contents are modified in the dialog window. so what i wanted to do is call the functions "A1.function_A();" and "A1.function_B();" before closing the dialog window say at after pressing the"Refresh" button(OnRefresh will be called). Im confused its not just happening what i desired. can any expert give me a solution, like is there any try statement i can give..??
please help me...
|
|
|
|
|
From your question it seems that you want to call the function of classA from ClassDlg. Why don't you create the object for class A in ClassDlg as well as you do in Class1?
or please rephrase your question if I understood incorrectly.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hi anshuman, thanks for your reply,
Actually,A1(object of ClassA) is like a handle to the table in the mainpage(flex grid). if i create 2 bjects that will create 2 flex grids. Instead i just wanted to update the already created table contents by this object A1.
"Dlg1" is the object of class "ClassDlg" where
class ClassDlg
{
public:
FunDlg();
OnRefresh()
}
i just wanted to call these function say "A1.function_A(); and A1.function_B();" inside the member function of class ClassDlg.
|
|
|
|
|
Hi,
how can i set an attribute with value at a particular postion in an Xml node....(im using MSXML)
|
|
|
|
|
pradeep455 wrote: particular postion in an Xml node
Particular position within an XML node? What do you mean by that exactly? What I read that as is that you want to ensure a particular ordering of attributes within an element - which you can't do, because attributes form an unordered (or more correctly, I guess, an arbitrarily ordered) collection.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i mean suppose i have an xml file..
<test a1="1" a2="2">
</test>
and i need to add a0="0" before a1...is it possible...
|
|
|
|
|
Why would you do something like that ? As far as I know, the order of the attributes is not important in the xml format. So, why is it a need to have a0 before a1 ?
|
|
|
|
|
Nope. You add it to the test node and that's all you can do. Attributes[^] are stored as a NamedNodeMap[^], which is an unordered collection.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for ur reply...
May i know is there any possibility for Xml nodes to insert at a particular position...
|
|
|
|
|
Define what you mean by an XML node....
Strictly, an XML node is the smallest indivisible unit of an XML document - an element is a node. A text run is a node. An attribute is a node. Whitespace is a node.
Even better - tell us what you're trying to accomplish - why this insistence on creating attributes or nodes at a certain position? What significance does the position of the attribute/node have? Tell us the question you're trying to answer with your need for ordered attributes.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello sir,
We are working in the VC++ platform .we developed an application based on Windows Location API. We have a GPS receiver but it doesn’t have driver on Windows7 OS. How Can I get GPS with a Location Platform-compatible driver for Windows 7.
Thanking You in Advance!!!!!!!!!
Regards
Arjun
|
|
|
|
|
Hii
How can I convert string into LPCWSTR
struct FILELIST
{
string path;
vector<string> theList;
};
string path
list<FILELIST>& theList
struct _finddatai64_t data;
string fname = path + "\\*.*";
long h = _findfirsti64(fname.c_str(),&data);
---------------
----------------
---------------
I've changed string to wstrig ,that time _findfirsti64() must have string argument...!!
any idea....
Thanking you..
|
|
|
|
|
You should really read this article[^], it will help you a lot understanding what you are doing wrong with your code.
Basically, you should avoid these kind of conversions unless there is absolutely no other way. In your case, you can perfectly go without conversion. Your application is probably built for unicode support, so you should support that throughout your app:
- use wstring if UNICODE is enabled by using your own string type everywhere in your app:
#if defined _UNICODE || defined UNICODE
typedef std::wstring TMyString;
#else
typedef std::string TMyString;
#endif
- instead of using _findfirsti64, you should use the unicode independant version (_tfindfirsti64). You should have a look at the documentation for all those functions, there is always a table with the different versions.
But anyway, first thing to do is to read the article
|
|
|
|
|