|
Never mind, it turned out to be looking in a different directory which had icon files 1 - 3, so I found 1 after renaming one and the others were still being missed. I had to use a very qualified path without a drive to find the correct files.
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Hi,
Does anyone know how GetDIBits() and SetDIBits() are implemented ?
Windows CE does not support these procedures.
|
|
|
|
|
Is there any limit on the number of devices we can open using mciSendCommand ?
Problem:
Our application demands to open multiple devices to play Avi files. Before playing, we are opening multiple devices using mciSendCommand and MCI_OPEN as command parameters. Basically, we have a problem when we open more than 25 devices,its giving error message "There is no driver installed on your system".
But if we open less than 25 devices and try playing them, there is no problem.
We want to know:
Is there any limitation on the number of mci devices we can open with in an application.
|
|
|
|
|
Hello,
I want to ask how to generate a random number which is lie between 0 and n, and they are evenly distributed (i.e. all number have the same probability).
Calvin
thx!!!
|
|
|
|
|
Why dont u use :
srand ( time ( NULL ) ) ;
int RandomNumber = rand () % (n + 1) ;
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
oops, misread the question.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
For a reasonably good random number generator you might want to have a look at the source for dev/random from the Linux sources (rand() from e.g the MS CRT will get you nowhere near randomness).
|
|
|
|
|
Hi,
In the below code I've copied the value of a string variable into "store" (which is Char(50).
When I print the value of store, it crashes!!!
please can someone tell me how to store from string to char and print the value of char!!
thanks,
John
Code:
======================================================================
strcpy(store,ret.c_str());
printf("%s",store);
======================================================================
|
|
|
|
|
what u did is correct, but printf crashes if store == null, check for this
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
In that case, the strcpy would fail too, surely?
Steve S
[This signature space available for rent]
|
|
|
|
|
oups yes, that's what i meant
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Does anybody know, where can I find any sample of http download resume?
Thank You
Jirka
|
|
|
|
|
HTTP doesn't really do this. The only possible mechanism for it's implementation is using HTTP/1.1 range header... http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35
You are probably thinking of FTP resume though.
Signature space for rent. Apply by email to....
|
|
|
|
|
Hi,
I have few questions about CCriticalSection usage:
1)
What is the purpose of the following code ?
<br />
CSomeClass::someFunc()<br />
{<br />
.<br />
.
.<br />
cs.Lock();
cs.Unlock();<br />
.<br />
.
.<br />
}<br />
What's the sense ? Why it calls Lock() and immediately after it Unlock() ???
I was very surprised when I found this piece of code in MSDN...
Why it isn't written this way ?
<br />
CSomeClass::someFunc()<br />
{<br />
cs.Lock();
.<br />
. <br />
.
.<br />
. <br />
.<br />
cs.Unlock();<br />
}<br />
???
2)
Is it safe to use CCriticalSection object directly, without using it together with CSingleLock ???
3)
In my program, calling CCriticalSection::Lock() sometimes blocks program execution and never returns. It just freezes the application. In which cases it happens ? Is there any way to avoid this behaviour ?
Any help or suggestion will be appreciated, thanks in advance.
Standa.
Celebrate Mr. Cesilko!
|
|
|
|
|
It has been sometime since I dealt with this, so please forgive the vagness.
Anyway, I think you need to declare the CS like this
volatile CCriticalSection cs;
otherwise the compiler will wrongly optimize the cs itself. If this does not work you may need to
volatile BOOL bHasLock; and test bHasLock before Locking and Unlocking.
It has been a long time, I just do not remember. But the voliatile keyword is a must to prevent the compiler optimize problems.
Phil F
|
|
|
|
|
Hi, I just started with DX8, and I'm trying to make a point light source over a small flat square (2 triangles). All parameters seem be make sense, but I get a black square, as if no light is applied. I've changed the background color to sth brighter than 0.0, to make sure that the square is actually rendered (and not culled for example).
I have my vertex setup using the XYZ | NORMAL flags, and my vertex struct looks like this:
struct MYVERTEX
{
float x,y,z;
float nx,ny,nz;
};
My vertex buffer is two triangles stuck together facing "up", and they create a small square on "the floor". As use can see, they are defined clockwise, like they're supposed to:
{-2.0f,0.0f,-2.0f, 0.0f,1.0f,0.0f},
{-2.0f,0.0f,2.0f, 0.0f,1.0f,0.0f},
{2.0f,0.0f,2.0f, 0.0f,1.0f,0.0f},
{-2.0f,0.0f,-2.0f, 0.0f,1.0f,0.0f},
{2.0f,0.0f,2.0f, 0.0f,1.0f,0.0f},
{2.0f,0.0f,-2.0f, 0.0f,1.0f,0.0f}
I initialize the light after initializing the device.
This is a snippet of my GameInit() function:
...
light.Type = D3DLIGHT_POINT;
light.Diffuse = D3DXCOLORVALUE(1.0f,1.0f,1.0f,1.0f);
light.Position = D3DXVECTOR3(0.0f,10.0f,0.0f);
light.Range = 100.0f;
pDev->SetLight(0, &light);
pDev->LightEnable(0, TRUE);
...
Notes:
the D3DXCOLORVALUE is just a wrapper for the D3DCOLORVALUE struct, that supplies a ctor
'pDev' is a HAL rendering device with software vertex processing.
I'm working in windowed mode
Backface culling NOT disabled.
This is another snippet, from my Render() function, to show what material I use:
...
// initialize material:
static D3DMATERIAL8 mat;
ZeroMemory(&mat, sizeof(mat));
mat.Ambient = D3DXCOLORVALUE(1.0f,1.0f,1.0f,1.0f);
mat.Diffuse = D3DXCOLORVALUE(1.0f,0.0f,0.0f,1.0f);
pDev->SetMaterial(&mat);
...
I even added a small feature to help me control the light position in real time, so that I see how changes in its distance from the square affect the lighting, but no matter how close or how far I bring it, the square stays black!
Well, that's about it. Like I said, I don't get any light. Any ideas? I'm sure the normals are correct and so is everything else. Please help.... Thanks!
/=/=/=/=
Deus
/=/=/=/=
|
|
|
|
|
You want to try to find more specialized forums
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Hi,
My App creates an array of sockets and listen()'s on them all. I run the following code to handle the connection attemps. The array of events is 1 event per socket, looking for FD_ACCEPT.
while (TRUE)
{
lEventFlagged = WSAWaitForMultipleEvents( lAddrCount,
pEvents,
FALSE,
WSA_INFINITE,
FALSE);
if (lEventFlagged == WSA_WAIT_TIMEOUT)
continue;
lEventFlagged -= WSA_WAIT_EVENT_0;
SOCKET client;
if ( (client = accept(pSockets[lEventFlagged],NULL,NULL)) != INVALID_SOCKET)
{
send(client,"hi\r\n",4,0);
closesocket(client);
}
else
{
OutputDebugString("invalid socket");
}
}
Everything initially runs fine. The WSAWaitForMultipleEvents() blocks as i would expect. When I try and connect, the function returns. I successfully accept the socket, send data ("Hi") and then close the socket. Then I loop again. I now want to be waiting for more connections... However, this time, WSAWaitForMultipleEvents returns immediately, with the same event set as before. This time, accept fails with INVALID_SOCKET. WSAGetLastError returns 100035, "A non-blocking socket operation could not be completed immediately. ". Which is to be expected because there are no pending connections. I just don't understand why the event is still set.
I believe that the event should reset itself. MSDN says of WSAEventSelect:
"Having successfully recorded the occurrence of the network event... and signaled the associated event object, no further actions are taken for that network event until the application makes the function call that implicitly reenables the setting of that network event and signaling of the associated event object."
Furthermore, it goes on to say that accept() is a reenabling function for FD_ACCEPT event.
Anyone got any ideas???
Thanks
Jon
Signature space for rent. Apply by email to....
|
|
|
|
|
Ok I figured it. Calling WSAResetEvent() is the key. Would have been handy if MSDN had mentioned that in the docs for WSAEventSelect or WSAWaitForMultipleEvents. :-/
Signature space for rent. Apply by email to....
|
|
|
|
|
hello!
in my mfc-program i need a two dimensional matrix. my problem is: the dimensions (Rows, Cols) are no constant integers, they are integers, only.
a few people in this forum tried to help me, but i still have errors and problems. i know, now (because of the feedback here), that i must do something with 'new' and 'pointer'.
who can help me more in detail?
MFC
|
|
|
|
|
i recomand u using vector of vectors its better that way,
see STL Type: std::vector
If u want to use pointers its something like this:
double ** ppDouble ;
for ( int iLines= 0 ;iLines<iNumberOfLines;iLines ++)
ppDouble = new (double*);
for ( int iColumns=0;iColumns<iNumberOfColumns ;iColumns++)
ppDouble [ iColumns ] = new double;
for ( int iLines= 0 ; iLines< iNumberOfLines ; iLines ++)
for ( int iColumns=0; iColumns<iNumberOfColumns ; iColumns++)
ppDouble [iLines][iColumns] = someValueUwantToaffectOrResultOfAfunction;
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
great, thanks.....
only one small mistake:
u wrote:
for(int iColumns=0 ;
iColumns<iNumberOfColumns ;
iColumns++)
but i think you must write:
for(int iColumns=0;
iColumns<iNumberOfLines ;
iColumns++)
thanks for everything!
MFC
|
|
|
|
|
You could use this ready built class
http://www.codeproject.com/cpp/MatrixClass.asp[^]
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
consider the following code snip of code
#include <map>
using namespace std;
typedef map<float,float> XY_DATA;
XY_DATA m_mapLines;
..
..
for(int i=0;i<100;i++)
m_mapLines[i]=i;
well the following assignment for the map is done
and a relative increase in memory consumed is observed.
OK
now for my problem
when i try to release the memory allocated using
m_mapLines.empty()
or
clear()
eventhough when i try map.size() i get zero.
there is no memory reduction in the taskmamager
what should i do to reduce the memory consumed by the map after emptying all its contents???
|
|
|
|
|
What the task manager displays is the memory footprint of the program, which usually does not decrease automatically when deallocating memory. You shouln't actually worry much about it, except if the footprint grows continually and does not stabilize.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|