|
|
That did it. I made the assumption that because the SelectObject took my CBrush without complaining that all was OK. WHen I was looking at it (the actual brushes are in an array) I was somehow thinking that they were being treated as pointers because they were array elements. I know - dumb. But I have been up 38+hours and everytime I looked at it I saw a CBrush* because I was thinking of the array and not its array elements:
CBrush GroupBrushes[NUM_GROUPS];<br />
CBrush* OldBrush;<br />
<br />
for(int x = 0; x < NUM_GROUPS; x++)<br />
GroupBrushes[x].CreateSolidBrush(GetGroupBGColor(x)); <br />
<br />
for(x = 0; x < NUM_ELEMENTS; x++)<br />
{<br />
OldBrush = (CBrush*)dc->SelectObject(GroupBrushes[Elements[x].GetGroupNumber()]);<br />
<br />
dc->Rectangle(<br />
((Elements[x].GetColumn() - 1) * CellWidth) + TableBorderWidth, <br />
((Elements[x].GetRow() - 1) * CellWidth) + TableBorderWidth, <br />
((Elements[x].GetColumn() - 1) * CellWidth) + CellWidth + TableBorderWidth, <br />
((Elements[x].GetRow() - 1) * CellWidth) + CellWidth + TableBorderWidth);<br />
<br />
dc->SelectObject(OldBrush);<br />
}
I just added the & where appropriate and all is good in the world now.
|
|
|
|
|
how can i get a double from DB_NUMERIC?? any help will be appreciate.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
IDataConvert. You need something like this;
DB_NUMERIC dbnumeric ;
double dbl;
IDataConvert* pCon = NULL;
CoCreateInstance(CLSID_OLEDB_CONVERSIONLIBRARY,
NULL,
CLSCTX_INPROC,
IID_IDataConvert,
reinterpret_cast<void**>(&pCon));
if (SUCCEEDED(pCon->CanConvert(DBTYPE_NUMERIC,DBTYPE_R8)))
{
pCon->DataConvert(DBTYPE_NUMERIC, DBTYPE_R8,
sizeof(struct tagDB_NUMERIC),
&dbnumeric,
reinterpret_cast<void*>(&dbl),
sizeof(double)),
DBSTATUS_S_OK, 0, dbnumeric.precision,dbnumeric.scale,
DBDATACONVERT_DEFAULT);
}
pCon->Release();
I've omitted error checking on the CoCreateInstance and the conversion itself, but this should help.
<b>S</b><i>teve </i><b>S</b>
|
|
|
|
|
Hi Guys,
This problem is not related to VC++ or, MFC
but it really is bothering me, thought someone can help me.
In my notebook the speaker volume has become too low, I hardly can hear anything. I have maximized all the volume options in the pc including the one at the system tray, but still no result. I had installed AC3 filter a few days ago, I thought it might be because of that, so I uninstalled it, but the volume is still inaudible, using an amplifier speaker I can hear a little bit. Can anybody help? BTW, I have xp home on my pc.
|
|
|
|
|
Has it always been low? Is it all audio formats, or just certain ones?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
earlier it was pretty loud and for all audio formats , even system sounds are low now
|
|
|
|
|
Has the master volume been altered?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
i didn't alter anything AC3 filter might have. how to check what is the master volume? I checked from control panel -> sound that the voulem is set to be maximum
|
|
|
|
|
Double-click the speaker in the icon tray. You'll have a volume for the different audio types (e.g., wav, midi, cd), and then a master volume.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
|
Are any of the other volumes set to minimum? What is the possibility that the speaker is busted?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Have you tried plugging in some headphones to see if those sound loud enough? Like David said, it may just be your speakers.
Regards,
Alvaro
Can I ask you a question?
|
|
|
|
|
i tried, same problem. all the volume levels are at max
|
|
|
|
|
Some laptops (like Dell's) have a keyboard short-cut to adjust
speaker volume. If I am not mistaken, if this is turned all the way
down, even with the system tray volume turned right up you will hear nothing.
For example on a Dell Inspiron 1100, pressing Fn and the blue-color-coded speaker image on one of the arrow keys will raise the volume. Maybe you should check your laptop manual for a similar feature...
John Theal
Physicist/Mathematical Programmer
Digital Immersion Software Corporation
Got CAD?
http://www.presenter3d.com[^]
http://www.merlin3d.com[^]
|
|
|
|
|
hi all...
I have a window... that I want to use in difrent projects...
Should I call CreateWindow(with this window classname)
in that case: How do I permenantly register a window class???
.
.
.
assamption:
Lets say... that I created a win32 app (no MFC or ATL);
Lets say... that this window acts as a control;
problem:
The output file is MyControl.EXE ,
Do I actually need MyControl.OCX ...
----------
Please...
I m very confused....
10x
-=-=-=-=-
The Server
|
|
|
|
|
Not purfect, but extremely small and a nice place to start:
The World’s Smallest Icon Editor:
http://home.online.no/~pethesse/features.html#TWSIE
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
|
Hi,
I recently developed MFC application and it is about to be shipped to customers in a couple of weeks. Before that I want to test my application for memory leaks etc.
1. Is there any automated testing tools to test my MFC application???
2. This question might be silly. But it has been bugging me since day one. What is the basic difference between VC++ application and MFC application??
WHen do I say that my application is VC++ or MFC application???
Thanks in advance for your valuable response.
|
|
|
|
|
Anamika1 wrote:
What is the basic difference between VC++ application and MFC application??
One is a subset of the other, and not vice-versa. A customer might be interested in knowing that your application was created using VC++. They probably couldn't care less that you created it with MFC.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
1. WinRunner. Expensive, but my tester at my last company swore by it.
2. Visual C++ is the compiler, MFC is a class library. An MFC based application could actually be compiled with other compilers.
Joe Woodbury
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
Can I Write data to a CD using Visual C++?
If Yes then please give some sample codes for doing so.
Amit
|
|
|
|
|
Assuming you meant CD-R/CD-RW, look for MSDN article Q260992.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
hi internet... please do the work for me...
Don't try it, just do it!
|
|
|
|
|
I have a CListCtrl that I'm attempting to add items to. I have followed what it says to do for inserting items in the Using the List Control article by Matt Weagle: http://www.codeproject.com/listctrl/listctrldemo.asp?target=clistctrl%7Creport%7Cview%7Cinsert
I have created 2 columns that I'm attempting to add items to. The first row that I insert does go in the correct place, but when I insert the second row, the item in the first column gets entered into row 0 and the contents of the current row 0 get shifted down to row 1. This wouldn't be a huge problem for me, except that that I enter into the second column, doesn't get inserted into row 0, but goes into row 1, overwriting the current value in row 1. Here's my code so far, if anyone notices any mistakes, please let me know!
CString tempstr, strItem;
CStdioFile browseFile;
LVITEM lvi;
int numRead = browseFile.Read(readBuffer, fileLength);
....
int rowNumber = 0;
//read in/set z and concentration values in CListCtrl, use InsertItem
for (counter = 0; counter < numRead; counter++)
{
tempstr = "";
while((readBuffer[counter] != ' ') && (readBuffer[counter] != '\n') && (counter < numRead))
{
tempstr += readBuffer[counter];
counter++;
}
if(readBuffer[counter] == ' ')
{
//if a space, tempstr is for the first column
lvi.mask = LVIF_TEXT;
strItem.Format(_T(tempstr));
lvi.iItem = rowNumber;
lvi.iSubItem = 0;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
m_elementList.InsertItem(&lvi);
}
else if(readBuffer[counter] == '\n')
{
//if a newline, tempstr is for the second column
strItem.Format(_T(tempstr));
lvi.iSubItem = 1;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
m_elementList.SetItem(&lvi);
//increase the row number
rowNumber++;
}
else if(counter >= numRead)
{
//if the last element in the file, tempstr is for the second column
strItem.Format(_T(tempstr));
lvi.iSubItem = 1;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
m_elementList.SetItem(&lvi);
}
}
|
|
|
|