|
To add to mikes reply,
Sameer_Thakur wrote: 1. Which are the DLLs that are used in a simple application that I created thr VC++6.0.? I know MFC42.DLL which are the other important ones?
Use dependency walker to check dll's used
|
|
|
|
|
What do you need exactly?
|
|
|
|
|
Hi Iam using Grid control in my application.
how to delete the multiple rows in the Grid.
currently if i select multiple rows to delete but the last selected row is getting deleted.here iam sending the code what i have used to delete the rows.but it is working
pls any body can help in this
CCellRange cRange;
int nCount = 0;
UINT unSel = 0;
INT_PTR nSelctedDMItemsCount = 0;
cRange = m_Grid.GetSelectedCellRange();
nCount = cRange.GetMaxRow();
bool bFlag = false;
for(int nDMIdx = 1;nDMIdx < nCount;nDMIdx++)
{
bFlag =false;
bFlag = m_Grid.IsCellSelected(nDMIdx,0);
if(bFlag )
{
m_Grid.DeleteRow( nDMIdx );
}
}
|
|
|
|
|
reddy harish wrote: Hi Iam using Grid control
What Grid Control?
led mike
|
|
|
|
|
Iam using CGrid control.in this iam facing the problem
|
|
|
|
|
|
Hi,
I created a CDateTimeCtrl control on my view. It is a 24 hour time format. But it still displays AM/PM . If it is 24 hr clock them AM/PM is not necessary there. SO I want to remove the AM/Pm text from control. How can I do this?
Regards,
Hemant Kulkarni.
|
|
|
|
|
use CDateTimeCtrl::SetFormat to change this behaviour
nave
|
|
|
|
|
Thanks!
I got the solution
It is just to change the SetFormat() finction and not to pass tt t options in string
|
|
|
|
|
Hello,
porting my sipmle (hope, C++ standard conforming) console programs from VC++ 2003 to VC++2005 I found out that I can't read unsigned int from the stream if there is a comma after it.
...main...{
unsigned int ui=2345;
cin >> ui;
cout << ui; // still will show 2345 on input "1,1"
}
Input "1,1" prevents reading 1 to ui. The reason is that deep inside the num_get class of the VC2005 iostream library thinks that in the current locale comma is thousand separator. But there is no reason for it. (I don't even mention locales in my program, so it should be standard "C" locale.)
Any sensible suggestions? I want (and could before) reading
// This also affects boost::uBLAS library at matrix input.
Regards,
Alex
|
|
|
|
|
wrote: (I don't even mention locales in my program, so it should be standard "C" locale.)
That's a bold (and invalid) assumption. The locale is set by the OS. It's up to the programmer
to ensure that locale-specific functions are behaving as expected.
|
|
|
|
|
Well, thanks for your answer anyway.
In fact, it was a sort of VC2005 bug. Service Pack helped me.
As far as I know, the C++ program should start with standard "C" locale no matter the OS reports.
Best regards,
Alex
|
|
|
|
|
|
Thank you very much for the info!
As I mentioned in prev message, SP1 fixes the bug.
Regards,
Alex
|
|
|
|
|
Could any1 plz tell me how can i get current time in milliseconds.
thanks.
|
|
|
|
|
ikbahrian wrote: get current time in milliseconds.
SYSTEMTIME st;
GetSystemTime(&st);
I hope this helps.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
Hi. Im using VC6 and trying to swap byte as the file is little endian.
<br />
while (j < 20)<br />
{ <br />
array[j] = file.get();<br />
j++;<br />
}<br />
<br />
j = 0;<br />
<br />
for (i=0; i<10; i++)<br />
{<br />
swap[i] = ((int)array[j+1] << 8) + array[j];
j = j + 2;<br />
}<br />
Is the swapping method correct? Coz I cant seem to get the correct ans.
|
|
|
|
|
array is a char array ? and swap is an int array ? int is four bytes, not two. Try a short array, or just swap in place
for (i=0; i<10; i+=2)<br />
{<br />
byte temp = array[i];<br />
array[i] = array[i+1];<br />
array[i+1] = temp;<br />
}<br />
<br />
That's more efficient than doing shifts as well, I would presume.<br />
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
yeah. array is a char array and swap is an int array.
Im opening a file stream to read in some bytes like: 2E FA CC F6 9F FC and store it in array. So since its little endian, I want to swap the position of the first element of array with the position of the second element of array. And then store both array[0] and array[1] into int swap[0] to do some calculation.
That can be done right? since int is 4 bytes which is equalvalent to 2 char.
What is the best way to do that?
|
|
|
|
|
ReturnRain wrote: since int is 4 bytes which is equalvalent to 2 char.
No, a char is always one byte.
|
|
|
|
|
ReturnRain wrote: What is the best way to do that?
As Mike said ( and I said before him ) a byte is a char. They are the same thing. Do what I suggested in the first place.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Say I have a string key from an INI file. What is the best way to instantiate an object depending on this key? Something like:
if (strKey == "cat") m_pPet = new CCat();
else if (strKey == "dog") m_pPet = new CDog();
else if (strKey == "monkey") m_pPet = new CMonkey();
...
When the list of classes getting longer and longer, the above way is too tedious and hard to maintain. I thought about runtime information but don't know how to tackle this problem with that.
__________________________
S.C.
|
|
|
|
|
There is no problem with your method of creating instances.
If I were to tackle the same problem, I would first convert the strkey into a DWORD value, then use a switch statement rather than comparing the string each time. Also, I would convert the strKey to lower-case before doing any comparison.
|
|
|
|
|
S.C.Wong wrote: When the list of classes getting longer and longer, the above way is too tedious and hard to maintain.
How so? Each additional animal requires 1-2 lines of code.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|