|
Use srand( (unsigned)time( NULL ) ) only once at the beginning of the program to "randomize" the sequence generated by GetRandom . Do not use it every time you call GetRandom .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks....it works now!!!
|
|
|
|
|
I am working on a custom drawn menu. I am able to get the rect of the menu items, but the rects coordinates are not in relation to the screen. How can I get the menu items cords for the screen?
|
|
|
|
|
Try using ClientToScreen
Nish
I am looking for a free racing game. Old style racing game without any complicated 3D stuff. Around 4 MB download. If anyone has such a game, please inform me.
|
|
|
|
|
Thats what I thought too, but CMenu is derived from CObject not CWnd. So how do I get the window handle for the menu. Is that even possible?
|
|
|
|
|
Maybe GetMenuItemRect will help? It returns a rectangle using screen coordinates.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Perfect... One more question. Is there an equivilant function to get the rect of the whole menu not just each item?
|
|
|
|
|
How to change an int variable to cstring, so that i can post it using AfxMessageBox....
|
|
|
|
|
CString str;
str.Format("%d",5);
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I am a novice student who's trying to learn MFC.
I am trying to access a chipset using i2c.
When I download about 6k byte of information through i2c in DOS program it takes less than 10 seconds, but when I program a download program with MFC, it takes more than 2 minutes to download through i2c.
Please someone tell me what I am missing here, or recommand me a book or something that I can solve this problem.
Thank you
|
|
|
|
|
Hello,
I am trying to convert a large integer(in a string form) to integer using StrToInt64Ex function. MSDN suggests that this function is defined in shlwapi.h, but it is not defined. I am using Visual C++ 6.0 on windows 2000. Source code is enclosed with the error message here below. Please someone tell me what is wrong with this code ? Is there any other method to convert a large integer? How to proceed further?
Thank you.
Regards,
Mainak.
==============================================================================
#include <windows.h>
#include <Shlwapi.h>
#include <stdio.h>
#include <stdlib.h>
int main ()
{
// with StrToInt64Ex
__int64 a2;
char s2[] = "0xffff";
LONGLONG a3;
StrToInt64Ex (s2, STIF_SUPPORT_HEX, &a3 );
return 0;
}
Compiling...
main.cpp
C:\tmp\str\main.cpp(19) : error C2065: 'StrToInt64Ex' : undeclared identifier
Error executing cl.exe.
str.exe - 1 error(s), 0 warning(s)
==============================================================================
|
|
|
|
|
This is only supported for IE 6.0 or higher. You'll need to add:
#define _WIN32_IE 0x0600
to stdafx.h before the other includes.
(If you look at shlwapi.h you'll see it's wrapped in ifdefs for this value)
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
I upgraded to IE 6.0 still it did not compile.
The header shlwapi.h (version 1) does not have the
function proto. What is your PC configuration?
-Mainak
|
|
|
|
|
|
Instead of StrToInt64Ex, which isn't supported on older Windows version, use plain old sprintf with %I64x or %I64d format specifiers:
char buf[32];
__int64 v;
v = 0x1234567890abcdef;
sprintf(buf, "%I64x", v);
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
how do i implement cpu scheduling using the multilevel feedback priority queues? i have 4 io devices and one cpu
abbas
|
|
|
|
|
i build the MDI(base class is CRichEditView) and i want to know the method to get the string(user write) from MDI
|
|
|
|
|
Check CRichEditView::GetRichEditCtrl .
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I am trying to call a function that adds info to a CListCtrl m_List through a pointer.
pointer->foo(CString). Does anyone know how to do this? I keep getting errors. Thanks if you can help.
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
Huh?
Perhaps I don't understand the question.
But if it is what I think it is do this :-
pListCtrl->InsertItem(0,"string here");
Nish
I am looking for a free racing game. Old style racing game without any complicated 3D stuff. Around 4 MB download. If anyone has such a game, please inform me.
|
|
|
|
|
Maybe this will make sense
pointer->dostuff(CString strStuff)
dostuff(CString strStuff)
{
m_List.InsertItem(.....)
}
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
Matt Newman wrote:
pointer->dostuff(CString strStuff)
What type of object is 'pointer'?
Nish
I am looking for a free racing game. Old style racing game without any complicated 3D stuff. Around 4 MB download. If anyone has such a game, please inform me.
|
|
|
|
|
It is a pointer to my MFC dialog class.
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
Matt Newman wrote:
It is a pointer to my MFC dialog class.
I guess you are trying to insert into the list box before the list box has been created. Where did you call the function? You cant call it anywhere before OnInitDialog()
Nish
I am looking for a free racing game. Old style racing game without any complicated 3D stuff. Around 4 MB download. If anyone has such a game, please inform me.
|
|
|
|
|
It has already been created I get static errors at compile time
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|