|
The list box in the second dialog has not been created yet. Has the dialog been opened yet? If not, then you can't add strings to the list box.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Well the listbox, is declared in the class of the dialog. Okay, the dialog is not opened at that stage. I will try opening it then, and then try DoModal. But I know if will fail at the point when I try AddString. Let me test first then tell u......
DoModal works fine. But now its all a matter of adding to the list when the dialog is opened. Lets try that.
Live in peace
|
|
|
|
|
It does not work at all.
2ndDialog.DoModal()
takes away the execution from the main dialog, so I am not able to addString from the main dlg.
How else can i do it?
Live in peace
|
|
|
|
|
Make an array of strings in your second dialog that the first dialog can add into, then in the second dialog's OnInitDialog() function, add the strings from the array into the list box. CArray will be fine.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Well, I understand the OnInitDialog is not defined, only as virtual funtion it is defined. Now if I do use that function, without defining anything, the system crashes.
Problem is that the ListBox seems to be in the wrong context. This inevitebly causes the assertion fail. I hope that is correct reasoning though.
How does one use a richedit control, without using a richedit view?
Live in peace
|
|
|
|
|
Ohhh! Thanks I now understant your explanation. I need to define the OnInitDialog function. I see. And then I do what I need to do now.
Thanks
Live in peace
|
|
|
|
|
Does any1 knows anything more (like syntax) then they are ADODB functions?
Nothing in MSDN, NOTHING!!!
Love is the law, love under will.
|
|
|
|
|
|
The names suggest that they are wrapper for the Collection property.
inline _variant_t Recordset15::GetCollect ( const _variant_t & Index ) {
VARIANT _result;
VariantInit(&_result);
HRESULT _hr = get_Collect(Index, &_result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _variant_t(_result, false);
}
inline void Recordset15::PutCollect ( const _variant_t & Index, const _variant_t & pvar ) {
HRESULT _hr = put_Collect(Index, pvar);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}
I suppose the valuje of Index depends on the context of the Collection
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
I always get these two errors when trying to include commctrl.h in my application.
c:\program files\microsoft visual studio\vc98\include\commctrl.h(26) : error C2146: syntax error : missing ';' before identifier 'HRESULT'
c:\program files\microsoft visual studio\vc98\include\commctrl.h(26) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
I've added comctl32.lib to the list of library modules in my project settings, but it wouldn't resolve the problem. I use MS Visual C++ 6.0.
Any ideas?
Cheers, Blackmesa.
|
|
|
|
|
Blackmesa wrote:
I've added comctl32.lib to the list of library modules in my project settings, but it wouldn't resolve the problem. I use MS Visual C++ 6.0.
Any ideas?
Your problem has nothing to do with linker settings. The problem is that you need some header included before commctrl.h. What type of project is this MFC, ATL, Win32 API... ?
John
|
|
|
|
|
It's a WIN32 API project.
Cheers, Blackmesa.
|
|
|
|
|
Do you have #include <windows.h> before #include <commctrl.h> ?
John
|
|
|
|
|
The first #include in the incriminated file concerns commctrl.h, as you can see below.
/**
* input.cpp
*
* Input module.
**/
#include <commctrl.h>
#include "input.h"
#include "inputvars.h"
#include "gamevars.h"
#include "layout.h"
#include "resource.h"
//.... rest of file
Cheers, nickelplate.
|
|
|
|
|
make sure you have included "winnt.h" or "wtypes.h" first. Does this help?
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
After including wtypes.h, I have no more errors. Thanks a lot guys.
Cheers, nickelplate.
|
|
|
|
|
You're welcome
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
You would think that the following bit of code would produce a 6-byte file:
wofstream f( "test.txt" ) ;
f << wstring( L"123" ) ;
But it doesn't. It produces a 3-byte file. A bit of experimentation indicates that the stream seems to be converting the wide characters to single-byte before writing it to the file. This also happens using Stlport (with their iostream library).
This seems just plain wrong. Anyone care to explain why it's like this?
Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.
Awasu 1.1[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Curse you for making me look at the VC 6 STL code this early in the morning.
The fstream inserter eventually calls basic_filebuf::overflow() , which has this line:
fwrite(_Str->begin(), 1, _N, _File) The problem is that it writes 1 byte, when it should write sizeof(_E) [where _E is the template character type, wchar_t in this case].
--Mike--
"So where does that leave us? Well, it leaves us right back where we started, only more confused than before." -- Matt Gullett
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Michael Dunn wrote:
Curse you for making me look at the VC 6 STL code this early in the morning.
Taka sent that message after midnight on a Friday night, so I don't want to know what he was thinking
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
Taka sent that message after midnight on a Friday night, so I don't want to know what he was thinking
I'm converting Awasu to Unicode. My life is over until further notice
Actually, it's not quite that bad. Most of it is ready for Unicode but there are some core modules that I wrote years ago that need to be converted. Of course, *everything* uses them...
Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.
Awasu 1.1[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Michael Dunn wrote:
Curse you for making me look at the VC 6 STL code this early in the morning.
He he
Michael Dunn wrote:
fwrite(_Str->begin(), 1, _N, _File)
Yep. The odd thing is, Stlport does the same thing i.e. even when I use their iostreams instead of Microsoft's. They correctly process each character as 16-bit but then explicitly call codecvt to convert it 8-bit!
Which makes me wonder if this is what is supposed to happen. If this is a bug, it's a pretty obvious one and someone would've picked it up. Seems definitely wrong to me...
Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.
Awasu 1.1[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
This is just fscked!!!
According to this guy[^]:
The standard *does not* provide a way to output (i.e.: to write on a disk file) a stream of wide characters. You can put wide characters into a wide stream but you will always obtain a file of "narrow" characters, obtained through a "degenerate conversion" as explictly specified in the standard.
Also here[^]:
On Win32, VC++ 6sp5, STLport the following test program produces the output 52 (0x34) instead of 4660 (0x1234). According to the standard, this behaviour is perfectly conformant.
int main()
{
wchar_t a = L'\x1234';
std::wofstream out("test.txt", std::ios::binary);
out << a;
out.close();
std::wifstream in("test.txt", std::ios::binary);
in >> a;
in.close();
std::cout << unsigned(a) << std::endl;
return 0;
}
(The second poster also makes the interesting point:
the ios::binary is required, because the I/O library could apply CRLF translation to a part of a two-byte character.
)
This makes no sense. What possible justification could there be to have wide streams output narrow?! The only thing I can think of is possible problems with sending wide data to the console, for example, but surely it would be preferable to hack wcout et.al. rather than crippling wide streams!
Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.
Awasu 1.1[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
hi,
i need help from you guys again.
My program uses classes like CButtonST, AnyFormDialog, etc.
I am not blaming these classes, but i think my program is leaking memory. (found out using system monitor). when app closes, the memory is not released to the point where it was when launched.
now the question is how can i detect where in my application memory leaks? any free third party utilities ?
BTW, it leaks in ME, not in XP.
thanks for your reply.
Hari Krishnan
|
|
|
|
|