|
I don't know. I was referring to C/C++ apps using MFC or the Windows SDK.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hello,
i have a problem with the Clistctrl, i have created it with the extended style LVS_EX_SUBITEMIMAGES, then i have created a new bitmap with the createbitmap method and i have attached it to imagelist,
the problem is that when the clistctrl is displayed the bitmap is always
black.
Thanks
|
|
|
|
|
Does this happen with every bitmap in the image list? Do the bitmaps have to be a certain size or from a certain palette? It might be helpful to find a working example here at CP and compare the code to what you have.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I want to find the maximum value in an array. The array may contain more than one than one maximum values. Therefore, I also need to count the number of maximum. For example, I have an array {1, 2, 3, 6, 6, 6, 5}
The maximum value is 6
The count is 3
How can I do it in optimal way? i.e. with minimum number of for loops
I've tried in my way:
int maxvalue = array[0];
for (int i = 0; i < 6; i++)
{
if (array[i] >= maxvalue) maxvalue = array[i];
}
int count = 0;
for (int i = 0; i < 6; i++)
{
if (array[i] == maxvalue) count++;
}
Here I think I loop too many.
Is there any way to do it faster?
Thanks
|
|
|
|
|
How about:
int array[7] = {1, 2, 3, 6, 6, 6, 5},
max = array[0],
maxcount = 0;
for (int x = 1; x < 7; x++)
{
if (array[x] > max)
{
max = array[x];
maxcount = 1;
}
else if (array[x] == max)
maxcount++;
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
Have you tried to combine the loops with something like this:
int iMaxValue = array[0];
int iCount = 1;
for (int iLup = 0; iLup < 6; iLup++)
{
if (array[iLup] > iMaxValue)
{
iMaxValue = array[iLup];
iCount = 1;
}
else if (array[iLup] == iMaxValue)
{
iCount++;
}
}
onwards and upwards...
|
|
|
|
|
I'm using MSVC6 with SP4 (Yes I know 5 is out, but 4 is the corporate standard)
on XP Prof. with SP1 (again... corporate standard)
Anyway....
Whenever I try to open or manage macros, developer studio crashes. I tried to step into the debugger and it's coming up with an empty CString somewhere.
Has anyone seen and hopefully fixed such a problem?
Thanks
|
|
|
|
|
I just want to know how to use these functions in a dll . I want to create a dll through which i can find the subkeys ,by providing the key , but how to pass an string array pointer that can be used by other application is the problem .thx
Rahul Agarwal
|
|
|
|
|
I'm not sure what RegEnumKeyValue() is but here is an example using RegEnumKeyEx() .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
hi, i want to know how to copy the contents of an array of strings into a listbox which can be displaied on screen?
Any help would be nice.
Thanks
|
|
|
|
|
MFC user ?
have a look at CListBox::AddString()
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
yeah im a MFC user (only been using c++ for about 2 weeks) Thanks for the help that should do what i want it to do
|
|
|
|
|
let consider you array if of type char*
char <code>str</code>[][]={"code","project","is","great"};
<font color=#008000>
CListBox *<code>m_lst</code>=(CListBox*)GetDlgItem(<code>IDC_LIST1</code>);
<font color=#008000>
if(m_lst)
{
<font color=#008000>
for(int i=0;i<4;i++)
{
<font color=#008000>
m_lst-><code>AddString</code>(str[i]);
}
}
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi I have a raw image buffer (unsigned char *). I have all the information like width, height, pixel depth, etc. How do I display this buffer in window?
Thanks,
Ajay
|
|
|
|
|
how are the pixels formatted in that 'raw' buffer ?
Windows really only has built-in support for drawing DIBs (and DIB-like data), so you're probably going to have to massage your pixel data to get it into a form Windows likes - then you can use SetDIBits, StretchDIBits, etc.
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
How do I program the following ?
//............................................................
String *names[] =new String*[50];
int x=0;
for (x=0; x<=10; x++)
{
textBox[x]->Text = names[x]; // <-- How can I do this ?
}
//............................................................
Thanks alot
Steve
|
|
|
|
|
This is just a guess, but what does this do:
textBox[x]->Text = *names[x];
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have gone through all the CSockets articles here but cud not find what i want. Okay let me tell u what i have done till now. First i created CMySocket(inherited from CSocket) object and call the Listen. Now i want to be notified that the socket is ready to accept connection. I am also catching the message in OnAccept Function. But unfortunately it never enters into it. So now client can then communicate.Please help me on it ????
|
|
|
|
|
You need to use CAsyncSocket instead of CSocket for that.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
I have tried that as well but could not obtain what i want. I am getting an run-time error which says "No connection could be made because the target machine actively refused it." which is error 10061L. This means client is not finding to connect to server. I have not call accept at this stage. However, When i call accept my program stuck and i know why because accept is blocking call. I dont want to call in a thread as CSocket provides a high-level Socket Programming. SO i want to learn it you can say. But i am facing problems in it. Can please some one1 help in it ?
Please tell me a solution where i am able to find that server is ready to accept connection in OnAccept.
|
|
|
|
|
Nemanja, doesn't CSocket derive from CAsynSocket ? Methinks the problem may be that the client simply isn't connecting to the open socket.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Yeah the same problem persist. Please help me and kindly provide me with a solution
Regards,
Ibraheem
|
|
|
|
|
It's hard to do this without seeing your source code. Perhaps you could post the (brief) code fragments that show (a) how your server starts listening and (b) how your client attempts to connect?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|