|
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
|
|
|
|
|
I haven't check it yet, but it would make sense to use the return message, the return code is -1. But the return code when a sql error occurs, is also -1. Thus going on the return code is not accurate, but I can get a hold of the return message. Which I can use to see what the real problem was. Making use of SQLGetDiagRec(SQL_HANDLE_STMT, hstmt, 1, sqlState, &nativeErr, Msg, sizeof(Msg), &TextLengthPtr); function.
Thanks for the advice David.
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: Making use of SQLGetDiagRec...
Which is what I was implying.
"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
|
|
|
|
|
A Q&D way to ensure that you are correctly roundtripping to the RDBMS and successfully executing SQL is to execute something like:
select 1 -or if using Oracle:
select 1 from dual If you get back a successful return code with a result column of "1", then you know everything is working correctly.
Note: this is a fairly heavyweight solution to what may be an easy problem, depending on the API(s) you have avaialble for your target RDBMSes. But it might be easier than decoding error messages from different RDBMSse...
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
|
How to do it?
I want to create an application with VC,and the application can create .exe file
Such as,software can produce electronic album
I have no idea,please introduce some skills about this.
Sorry,My english is not very good.
|
|
|
|
|
In order to create a .exe file, you first need to become very familiar with the PE file format. As you are an obvious beginner, I would advise against it. Stick with something more on your skill level.
"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
|
|
|
|