|
Rage wrote: but I cannot bind STLs
Why? It's just code. Do you plan on having this container without any code? That's not how it works.
|
|
|
|
|
Because we use it on a plateform where we do not have enough memory to bind it with our code.
I know STL is standard and is only code. My requirement is, I cannot use it. So before I reinvent the wheel, I only wanted to know if there is already something out there.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
Rage wrote: we do not have enough memory to bind it with our code.
Then how are you going to have enough memory for the something else that you are asking for?
|
|
|
|
|
because I only need a simple functionality, not the complete STL or even any of them, that I can modify for my purposes. And I do not want to start it from scratch. For God's sake, you have a CP award, how come YOU are asking such dumb questions ?!
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
Rage wrote: how come YOU are asking such dumb questions ?!
Your kidding right?
|
|
|
|
|
I've had the same requirement from a previous employer. I wrote my own list class that was just a simplified rip off of std::list and took less than a day to do. I guess they're still using it . You could check out some of the stl free data structures I used in my patterns article[^]
There are undoubtedly bugs but you're welcome to use and improve these classes at your own risk. No iterators with these I'm afraid they really are simplistic. I do have versions with template Allocator parameters of most of these but they aren't published. Let me know if you're interested.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Very useful, thank you very much.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
hi,
I written a MFC program using wimnn.dll to PlaySound and it succeeded.
After formatting my PC, everything is fine, BUT it fails to PlaySound.
Should I install something as well?
Please help!
Thanks!
|
|
|
|
|
Do sounds play at all, or just not via code?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The wave files are included in the project.
In the code, PlaySound() is called.
Before formatting my PC, it works.
But I what else should I install to make it work...
|
|
|
|
|
You did not answer my question. Does sound work at all on this machine, or does it just not work via code?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The sound device is ok. Only the program cannot play the wave files now.
|
|
|
|
|
Archyami wrote: The sound device is ok.
How are you verifying this?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Other programs like windows media player amd games can play sound. Only my program cannot.
2 computers have the problem after formatting.
|
|
|
|
|
What are the attributes of the sound you used? I mean the sampling rate, bit, etc. May be some driver mismatch after formatting? Did you try with some other wavs?
- NS -
|
|
|
|
|
I am NOT sure the wave attributes.
I am in office now.
I will try to replace the project wave files by windows wave files.
Thanks for you suggestion.
|
|
|
|
|
Hey guys, I'm having some problems adding a groups to a list control object. Here is what I'm trying:
LVGROUP group;<br />
ZeroMemory(&group, sizeof(group));<br />
<br />
group.cbSize = sizeof(group);<br />
group.mask = LVGF_HEADER | LVGF_GROUPID | LVGF_ALIGN;<br />
<br />
LPWSTR header = new WCHAR[printableAttributes->name->size() + 1];<br />
MultiByteToWideChar(0, 0, printableAttributes->name->c_str(), -1, header, <br />
(int)printableAttributes->name->size() + 1);<br />
<br />
group.pszHeader = header;<br />
group.cchHeader = (int)wcslen(group.pszHeader);<br />
<br />
group.iGroupId = index;<br />
group.uAlign = LVGA_HEADER_CENTER;<br />
<br />
listControl->InsertGroup(index, &group);<br />
<br />
NonCompositeJob* temp;<br />
LVITEM item;<br />
<br />
for(int i = 0; i < (int)((CompositeJob*)job)->getNoJobs(); i++)<br />
{<br />
ZeroMemory(&item, sizeof(item));<br />
item.iItem = i;<br />
item.mask = LVIF_GROUPID;<br />
item.iGroupId = group.iGroupId;<br />
item.iSubItem = i + 1;<br />
<br />
temp = ((CompositeJob*)job)->getJob(i);<br />
<br />
listControl->InsertItem(i, (LPCTSTR)printableAttributes-><br />
name->c_str());<br />
<br />
listControl->SetItemText(i, 1, (LPCTSTR)printableAttributes-><br />
totalNumberOfCopiesPrinted->c_str());<br />
<br />
listControl->SetItemText(i, 2, (LPCTSTR)printableAttributes-><br />
status->c_str());<br />
<br />
listControl->SetItemText(i, 3, (LPCTSTR)printableAttributes-><br />
type->c_str());<br />
<br />
listControl->SetItemText(i, 4, (LPCTSTR)printableAttributes-><br />
fileSize->c_str());<br />
<br />
listControl->SetItemText(i, 5, (LPCTSTR)printableAttributes-><br />
fileLocation->c_str());<br />
<br />
listControl->SetItemData(i, (DWORD_PTR)temp);<br />
listControl->InsertItem(&item);
groups is the LSVGROUP object and item is the LVITEM. index is the index of the list control object(listControl). CompositeJob is an object that holds 2+ print jobs.
In the loop, I'm trying to add the items one at a time and getNoJobs returns the number of jobs inside of the CompositeJob object. After creating the group, I try to add each item to the group, I set the text of the fields that will be displayed for each of the objects in the group, return to the top of the loop, and continue for each job in the CompositeJob object.
-- modified at 10:14 Monday 15th October, 2007
When I add 2 composite jobs to the list, I end up with 4 entries, two for each one.
[Insert Witty Sig Here]
|
|
|
|
|
And the problem you have are... ?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Sorry, I got lost in the massive message that turned out to be.
When I add 2 composite jobs to the list, I end up with 4 entries, two for each one.
[Insert Witty Sig Here]
|
|
|
|
|
Have you tried replacing the second InsertItem call with MoveItemToGroup. The result you are seeing is what I would expect with 2 InsertItem calls.
|
|
|
|
|
first, call listControl->InsertItem(&item);
Your first call
<br />
listControl->InsertItem(i, (LPCTSTR)printableAttributes-><br />
name->c_str());<br />
should be converted to
<br />
listControl->SetItemText(i, 0, (LPCTSTR)printableAttributes-><br />
name->c_str());<br />
BTW, why do you cast to LPCTSTR? If you have your Unicode setting right, it should compile cleanly without the cast; if your Unicode settings are wrong, the cast will not help at runtime.
Cheers,
Alex
|
|
|
|
|
Hi all,
I am doing multiple SQL statement into the database. But what to do when the database connection was dropped or lost. Is there a function I can use to test the db connection before performing the SQL statement?? or is there another technique I can use ??
Many thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Are you using SQLExecDirect() ? If so, what does it return when you try and interact using a dropped connection?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi David,
Thanks for your reply, and I must say point made. Yes I am using SQLExecDirect() , can I use the return message to establish whether a connection exists or not?
Thanks again
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: Yes I am using SQLExecDirect(), can I use the return message to establish whether a connection exists or not?
What does it return when you try and interact using a dropped connection?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|