|
How can I determine the available/installed RAM on a machine? In VC++.
|
|
|
|
|
|
|
Hi,
I have a string formatted somewhere in my program as
Cstring strMain;
strMain.Format("Health: \nWealth");
At some other part of the program, I need 'Health:’ as a separate string and ‘Wealth’ as a separate string. I tried using sscanf but it is not separating the strings.
Cstring s1,s2;
Cstring strOriginal = getmain();
Sscanf(strOriginal,"%s: %s",s1,s2);
This give just ‘Health’ . i.e. both s1 and s2 hold the string ‘Health’
Please can you tell me the right way?
Fortitudine Vincimus!
-- modified at 9:02 Saturday 8th July, 2006
|
|
|
|
|
First of all, you can't use pass CString 's directly to sscanf . Arguments to sscanf must be pointers.
If you are using the '\n' as the delimiter, you could try something like the following:
CString s1,s2;
CString strOriginal = getmain();
int offset = strOriginal.Find('\n');
if (offset >= 0) {
s1 = strOriginal.Left(offset);
s2 = strOriginal.Mid(offset + 1);
}
Software Zen: delete this;
|
|
|
|
|
Thanks a lot.
Fortitudine Vincimus!
|
|
|
|
|
hi all,
i am getting following error in vc ++ .net 7.0
fatal error C1083: Cannot open include file: 'olestd.h': No such file or directory
can any one help me to solve this problem ?
Regards
venu
|
|
|
|
|
for which function, you are referrnig the same file? I strongly believe that, the file is local one(defined for your project).
AFAIK there's no such file named, oldstd.h
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
i'd like to see color dialog when i click a button(ID_BORDERCOLOR) on my ToolColor and then i can get color by m_bordercolor in CView.
Thanks
all for development
|
|
|
|
|
add message handler for ID_BORDERCOLOR, then inside the message handler,
add the code
CColorDialg dlg;
dlg.DoModal();
COLORREF clr = dlg.GetColor();
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
hai guys
here i have oneproblem to get the specified port is running or not by
programatically .plz kindely help me in my project
#sankar#
|
|
|
|
|
|
Thanque for ur reply but i didn't get it ,plz send me clearly
#sankar#
-- modified at 6:59 Saturday 8th July, 2006
|
|
|
|
|
See the sample from MSDN[^]
if we fail to bind to a specified port of listen to a specified port fails, which means that, the port is in use or invalid.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
|
Hello i hav a Dialog class say ABC. In this dialog i have a listbox & button control.
i have another class say XYZ in the same file say it has a Display() Fucntion in which i have add some string into the list box.
what i want when a user click on button dispaly function should be called.
for calling a listbox control variable i have made a object of dialog class within the display function and with the help of this object i call the listbox control variable and add the string into the list box.
and on button click i hav made aobject of xyz class.and call the display function but its giving me assertion error.
what should i do to avoif this error.
thanx
|
|
|
|
|
aavesh wrote: or calling a listbox control variable i have made a object of dialog class within the display function and with the help of this object i call the listbox control variable and add the string into the list box.
I think wha you were doing is wrong.
Seems you need something like this.
this is code can't be applied directly... Just a logic "how to do"
class CXYZ
{
public:
SetListBoxHandle(CListBox* pListBox);
Display();
};
class CMyDialog
{
private:
CXYZ m_xyz;
CListBox m_ListBox;
BOOL OnInitDialog()
{
m_xyz.SetListBoxHandle(&m_pListBox);
}
void OnBtnClick()
{
m_xyz.Display();
}
};
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
hi thanx for replying me.i hav got the answer where i was making mistake but one thing is also which is i'm not getting that how can i call the list control variable in display function.
thanx
|
|
|
|
|
Plz saarth reply me..
i'm waiting for ur reply.
|
|
|
|
|
sorry I left office yesterday...
for that purpose, there's in Set handler function.
keep that in a member varible (pointer type of CListBox) and call when it is required.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
hello
thanx for replying..
sorry i tried to do it but i'm not getting in display function when i call the sethandler function what should i pass into the sethandler function.
i'm doing like this
CTestList::Display()
{ List control variable here
CListBox *l1 = sethandlerlist("what i have to pass here");
l1->AddString("Abc");
}
tell me where i making mistake
thanx
|
|
|
|
|
actually set handler function should be call from the owner of list. i.e in this case, the dailog class. he also contains the XYZ Class too.
so he is becoming as mediator for communication.
set set handler should be called from OnInitDialog or from the constructor.
in the class, you pls add CListBox* m_pList;
in the set handler function
m_pList = pListBox;
inside display function, you can use m_pList, if you properly set the handle.
it's actually not big deal.
I dont have time to write code, that is why im explaining through these steps.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
hello sir,
thanx for replying..
i implement it as u said but its giving me error
"Unhandled exception at 0x7c291bfa (mfc71d.dll) in Kletsmajoor.exe: 0xC0000005: Access violation reading location 0xccccccec."
i try to debug the error and found that NULL in the m_hwnd variable.
what should i do.
thanx
|
|
|
|
|
you are calling an invalid pointer.
i.e ListBox pointer is invalid
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
thanx dude
u r gr8
thank you very much
bye
|
|
|
|