|
Hello
What is difference between console based coding and event based coding
in window platform
Philip
|
|
|
|
|
The former runs in a console window (as opposed to GUI), while the latter is based on events (as opposed to synchronous). They are not necessarily mutually exclusive.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi All,
I want to build a structure of userdefined elements,which will be having child & subchild elemetnts as well(Like a Tree Structure). Using STL or so...
Is there any build-In facility in c++,by which I could create a tree structure like this & query for elements as well, within this structure.
If not any suggestions how to proceed.....
Thanks...
|
|
|
|
|
Try using an XMLDOMDoc. You can use XPath syntax to navigate the tree and find nodes. XML is a self-defining tree structure which includes it's own navigation functions. Sounds like a perfect answer to you problem.
Check out the following links.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmobjxmldomdocument.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmrefxpathsyntax.asp
Some people see things that are and ask, Why? Some people dream of things that never were and ask, Why not? Some people have to go to work and don't have time for all that ...
Author: George Carlin
|
|
|
|
|
Thanks,Will try in that direction...
|
|
|
|
|
hi,
recently i got some work which needed a good GUI. I did a lot of time googling but became even more confused. i hav seen stunning gui's like those of google's picasa, acdc6 ... How do they do it ?
Several sites advices to use a manifest file to make application Theme aware in XP. it works fine but only with Xp. should i go with using bitmaps for all the controls and dialog backgrounds, OR use a third party tool like BCG/codejock software.
I am a beginner and can anyone please give an advice on how to start with this. i am so desparate to make my controls and other parts of my application
look great. any help is highly appreciatable
thankx,
abin
|
|
|
|
|
application like picasa manually draw their own GUI, either by using bitmaps, or simple GDI drawing.
Doing a complete UI package for your software can be time consumming, and should only be done if it's absolutly necessary, or that you have both time and money; BUT it can be really fun to do.
Also, have a look at topics that talk about skinning application.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hello,
I'm writting and app that is completely in Bulgarian language, all the resources are in Bulgarian and the program displays the cyrillic labels and messages correctly undef Windows XP but does not always display them correctly under Windows 9x/ME.
How to ensure that the cyrillic charcters will always be displayed correctly under all OS's ?
Thanks in advance!
|
|
|
|
|
My application is not running in sweden,denmark where the default regional setting is set to dutch.I read in some articles that this is a bug .
And the application runs fine when regional settting is set to English(uk)
Now I want to change regional setting thru my program
will setlocale function help in this respect
|
|
|
|
|
Hello Venu!
you can use SetLocaleInfo to set Regional Setting from your program
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Anyone know of an implementation for cross platform GUID's?
Been looking into them, and they were put together by Paul Leach at Microsft, in an internet RFC, for the Network Working Group, as an alternative to UUID's.
Instead of just being a large random number (UUID's???), they consist of a time stamp, IP address, and some other stuff to guarentee unquieness, but at the same time being sortable.
Been looking around, but have not been able to find the RFC, or any implementations in C++.
I know Java has them, and Windows has them built in as well, but on Unix, its a UUID gen, which is not the same as a GUID in how it should be generated.
|
|
|
|
|
I wasn't sure how to approach this, but say you have a binary file and i want to read it 1 bit at a time -- how would you read one bit at a time?
|
|
|
|
|
1 bit, one 1 byte ???
you have many functions to read files, but only 1 byte at least.
what you could do so is reading the byte, and exctracting its bit that's interresting you...
for example, i want the bit b4 of the first byte of the file (i consider b0 is the LSB, and b7 is the MSB) :
<font color=#0000FF>int </font>file = fopen(<font color=#808080>"file1.txt"</font>, <font color=#808080>"r"</font>);
<font color=#0000FF>char </font>cByte = 0;
fscanf(file, <font color=#808080>"%c"</font>, &cByte);
<font color=#0000FF>bool </font>bBit_b4 = (cByte & 0x10) >> 4;
<font color=#0000FF>if </font>(bBit_b4) {
<font color=#008000>
}
else {
<font color=#008000>
</font>}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
thanx!!
i am doing in a similar fashion..
i just thought if there is any direct function
|
|
|
|
|
POSITION pos = GetFirstViewPosition();
CString temp;
while (pos != NULL)
{
CRichEditView* pView = (CRichEditView*) GetNextView(pos);
int i, nLineLength, nLineCount = pView->GetRichEditCtrl().GetLineCount();
CString strText, strLine;
// Dump every line of text of the rich edit control.
for (i=0;i < nLineCount;i++)
{
nLineLength = pView->GetRichEditCtrl().LineLength(i);
pView->GetRichEditCtrl().GetLine(i, strText.GetBuffer(nLineLength));
AfxMessageBox(strText);
strText.ReleaseBuffer(nLineLength);
}
}
I think there`s a problem with the CString allocation memory.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
Yulianto AKA goodmast3r wrote:
AfxMessageBox(strText);
strText.ReleaseBuffer(nLineLength);
These two lines should be switched. Straight from MSDN:
If you use the pointer returned by GetBuffer() to change the string contents, you must call ReleaseBuffer() before using any other CString member functions.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Besides the problem mentioned with using CString::GetBuffer(...) and CString::ReleaseBuffer(...) , I believe you should be using nLineLength + 1 in the call CString::GetBuffer(...) to store the line extracted from the Rich Edit control to account for the terminating NUL character.
Peace!
-=- James
Tip for inexperienced drivers: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"! Articles -- Products: Delete FXP Files & Check Favorites
|
|
|
|
|
In OnInitDialog() of a class which inherits from CDialog,
SendMessage(WM_CLOSE) will close the dialog, but when using
::SendMessage((HWND)(CWnd*)this,WM_CLOSE,0,0);
it couldn`t close the dialog, where did I do wrong?
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
Why Don't you try
::SendMessage(this->GetSafeHwnd(),WM_CLOSE,0,0);
or
::SendMessage(this->m_hWnd,WM_CLOSE,0,0);
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Why Don't you try
::SendMessage(this->GetSafeHwnd(),WM_CLOSE,0,0);
or
::SendMessage(this->m_hWnd,WM_CLOSE,0,0);
OFFTOPIC:Yulianto AKA goodmast3r?,if you don't mind could you tell me meaning of your name Yulianto.
Thanks
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
ThatsAlok wrote:
OFFTOPIC:Yulianto AKA goodmast3r?,if you don't mind could you tell me meaning of your name Yulianto.
Ehmm, No particular meaning. I was born on July. I think it`s a bad name, but anyway it was given by my parent. And what`s the meaning of
ThatsAlok
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
Yulianto AKA goodmast3r wrote:
I was born on July
ME too , July THE 11
Yulianto AKA goodmast3r wrote:
what`s the meaning of
ThatsAlok
Alok has two meaning Light or Man with Beautiful hair.
and thatsalok mean i think it's simple thatsalok
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Your mistake is that you convert a pointer (this) to a window into a handle.
You have to do like this:
<br />
::SendMessage(m_hWnd,WM_CLOSE,0,0);<br />
SkyWalker
|
|
|
|
|
I have nearly finished my little beginners project and need help in formatting the output my code is below. My question is after the code
/////////////////////////////////////////////////////////////////////////////
// CReverseView message handlers
void CReverseView::OnReverse()
{
// TODO: Add your command handler code here
CEdit &edit = GetEditCtrl();
CString strText;
CString msg = "\r\nThe answer is ";
CString data; // storage for the read in data'
CString line; // to concactenate msg & data
BYTE a;
edit.GetWindowText(strText);
while (!strText.IsEmpty())
{
sscanf(strText,"%c",&a); //read the char
data = (BYTE)a; // put it in data
strText=(const char*)strText1;+1
// move the pointer
line = msg+=data;
// add CR/LF "The message is" to the beginning
}
strText = line;
edit.SetWindowText(strText);
//This prints The answer is qwerty
GetDocument()->SetModifiedFlag(TRUE) ;
}
The above code prints
The answer is qwerty
I want it to print out like this:-
The answer is q
The answer is w
The answer is e
The answer is r
The answer is t
The answer is y
It seems my string objects over write each other. How do I fix this or re set the "object counter" back to zero so that it overwrites the existing data? I have tried many ways but can't work it out
Thank you
|
|
|
|
|
hugPW wrote:
strText=(const char*)strText1;+1
The above statement should not compile.
How about something small like:
edit.GetWindowText(strText);
for (int x = 0; x < strText.GetLength(); x++)
line += "The answer is " + strText[x] + "\r\n";
strText = line;
edit.SetWindowText(strText);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|