|
|
Thanks, i've already got that, it only really solves conflicts and when it renumbers it changes the order.
I went back to the website though and it had a link to a macro on codogure which might solve it.
cheers.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
hello, this may be very easy, but i've been trying to add a windows line break to a CString so when i write the string to a file it makes new lines. is this possible? i've had no luck so far. thanks in advance.
Luke.
|
|
|
|
|
CString s = ...
s += "\r\n"
Pavel
Sonork 100.15206
|
|
|
|
|
Sorry, if I display the CString in a MessageBox the new lines work, but when i used CStdioFile::WriteString to write the string to a file when i open the file there are no line breaks, everything is just on the first line. how do i get the line breaks, or do this a bette way?
Luke.
|
|
|
|
|
Sorry again, dont worry about replying, i figured out that some of my logic is stuff this up sorry about that. cyas
Luke.
|
|
|
|
|
Hey Luke,
I have been putting \r\n and even just \n in my strings and I get linefeeds and carriage returns just fine when I view my file from notepad.
CStdioFile file;<br />
file.Open("c:\\tempfile.dat",CFile::modeCreate+CFile::modeWrite,NULL);<br />
file.WriteString("Hello\r\nLine2\nLine 3");<br />
file.Close();
How about you post the code that's causing the problem?
Cheers
Adam.
www.beachwizard.com/travelogue[^]
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
m_combo.AddString("");
int x=m_combo.FindString(-1, "");
Is this behaviour ok?
rechi
|
|
|
|
|
what is the return code of AddString
is it adding the String, if yes the behavior is wrong!
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Yes, the string is added successfuly! Guess it's about a bug...
rechi
|
|
|
|
|
Bogdan Rechi wrote:
Is this behaviour ok?
It depends on definition of 'ok', I guess
Probably the combobox wndproc checks if string is empty in its CB_FINDSTRING handler and immediately returns CB_ERR if so. While this behavior seems reasonable for CB_FINDSTRING (because it's searching for item beginning with given string), it doesn't for CB_FINDSTRINGEXACT. CB_FINDSTRINGEXACT/CComboBox::FindStringExact also return -1 when you pass empty string.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Tomasz Sowinski wrote:
this behavior seems reasonable for CB_FINDSTRING
Don't believe it does. "" should be a prefix for every string in the list, in order to avoid loosing itself. It's the best way to implement FindString .
rechi
|
|
|
|
|
It wouldn't make any sense, since empty string satisfies CB_FINDSTRING search criteria for *all* items. Basically, it would return 0 if list is non-empty, -1 otherwise.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Tomasz Sowinski wrote:
It wouldn't make any sense
Yes, you're right!
So, it's all about CB_FINDSTRINGEXACT.
(don't tell me it's not, otherwise i will commit some and i don't think i deserve it)
rechi
|
|
|
|
|
I think it's definitely a bug with CB_FINDSTRINGEXACT returning -1 for empty search phrase. Of course, MS will tell you that 'this behavior is by design'
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Hi everyone.
I have Dialog based app with listbox on it.
In the second modal dialog i'm entering some data to editbox.
Can anybody show me how to add string with text from editbox(from modal dlg) to the lisbox on main dlg?
Thanks.
|
|
|
|
|
ok, object oriented way:
Write a function that takes a string and add it to ur listbox in the main dialo
Pass a pointer to the other dialog of ur main dialog and call the function
To pass the pointer u can do it when constructing the dialog as parameter to its constrctor, and there u cast it to the main dialog class pointer and store it in a member in the second dialog ( its type pointer to main dialog )
Hope this help
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Can I use standart:
CMainDlg:
CListBox list;
CModalDlg:
CMainDlg* mDl
mDl->list.AddString("blablabla");
?? such thing make no errors, but didn't work ...
|
|
|
|
|
You have at least two options:
1) The dialog with edit box has pointer listbox in parent dialog. It uses CListBox::AddString to add string
2) main dialog invokes secondary dialog with edit box. Secondary dialog maps string variable to edit box. When CEditDlg::DoModal returns IDOK, then main dialog adds string using CListBox::AddString
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Hi,
When I compiled and ran the sample code from DirectX 8.1 SDK Tutorial 1,
CreateDevice, I got a D3DERR_INVALIDCALL return value from CreateDevice()
and the sample app failed.
...
HRESULT hRst = g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, &g_pd3dDevice );
...
I did copy the code from Platform SDK without any changes. And I am sure
that I have installed DirectX 8.1.
Is there anyone know what this error means? What should I do then? I am a
freshmen for DirectX SDK development.
Thanks for your help in advance.
|
|
|
|
|
D3DERR_INVALIDCALL
The method call is invalid. For example, a method's parameter may have an invalid value.
What is ur VGA card??
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Trident Video Accelerator 3D Image975
|
|
|
|
|
Hi..
Now i try to develop the application that can support both Chinese and standard english in one edit control
It is possible and how to implement it..
Thankz
;P ((
:_Rocket_:
|
|
|
|
|
|
::LoadImage
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|