|
Hello Gentlemen,
I have another problem with the same project I was talking about in an earlier post.
This time my error is error C2228: left of '.current_energy' must have class/struct/union.
The code in question is...
caster.Creatures[i].current_energy = nrg[i];
I realize that Creatures[i] indicates a pointer, not an array, however I don't quite understand how to rewrite it to access that curren_energy data that I require at this point.
Any help would be much appreciated.
Thank you.
|
|
|
|
|
I should add more so you know where caster comes from.
Caster is passed by reference to this function ala
void SpellList::Flame_Control(player &caster, player &enemy)
Caster is of class player.
|
|
|
|
|
I apologize, it seems now that my syntax was correct, but I was a getting the error because the
int i;
in
nrg[i];
hadn't been defined in that scope. My apologies.
|
|
|
|
|
That's the number one problem moving from VC6. Once I realised that VC6 was non standard, I'd write loops like this:
int i = 0;
for(;i<10;++i)
knowing that I was writing standard compatible code that VC6 could use.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Using GetDriveType() I can determine that a logical unit is removable. How can I determine that is a CD/DVD unit? Or an USB drive?
In VC6++, please!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
I don't know if this will help, but I found this on MSDN
GetDriveType<br />
<br />
The GetDriveType function determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive.<br />
<br />
To determine whether a drive is a USB-type drive, call SetupDiGetDeviceRegistryProperty and specify the SPDRP_REMOVAL_POLICY property.
http://msdn2.microsoft.com/en-US/library/aa364939.aspx[^]
______________________
stuff + cats = awesome
|
|
|
|
|
Using GetDriveType() I can determine that a logical unit is removable. How can I determine that is a floppy unit?
In VC6++, please!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
|
Mark Salsbery wrote: Nice grammar in the title there, Microsoft
You know what ? I followed the link just to see the title and I came on the article but which was translated into french. But, the translation was done by an automatic system (like babelfish) and of course it is full of mistakes. And of course you cannot find a link to get back to the original article . What the hell !!
EDIT: just to give you an example for those who understand french, the title of the article is "Comment à obtenir d'informations de type de lecteur correspondant"
|
|
|
|
|
Cedric Moonen wrote: What the hell !!
You're on your own, my friend
I'm just a C++ programmer - I don't understand this interweb thingy.
LOL!
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
OK I lied - you're not on your own.
I took a look at the link. On the right is a dropdown listbox under "Article Translations"
or "Traductions disponibles". I selected the French translation, but being a stupid American, I
have no idea if there's mistakes or not
*edit* So I wonder what the ORIGINAL language was
Good luck!
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: On the right is a dropdown listbox under "Article Translations"
or "Traductions disponibles"
Yep, I didn't see it first. But if I want to change the language it still "reminds" that you came on the english article and the list is... in english. And of course, there is no english in the list. You first have to select another language and then you'll be able to choose english
Mark Salsbery wrote: Good luck!
In fact I don't care I was just curious about the title and what a surprise when I saw the article in french. I just wanted to rant about it
|
|
|
|
|
Cedric Moonen wrote: In fact I don't care ... I just wanted to rant about it
Exactly!
Cheers
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks!
I'll test!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Ok, rember me? The novice who is working on an assignment for school?
Well, you guys were so helpfull last tiem, I decided to return.
How do you start/stop a timer useing a button?
|
|
|
|
|
Interface a GUI to the QueryPerformanceCounter API.
|
|
|
|
|
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Am I missing something? If my suggestion is a really bad one, which it may be, then please tell me why.
|
|
|
|
|
Just my first reaction. I don't have the CodeProject mind-reading unit yet.
Of all the possibilities for what kind of timer the OP wanted, that was probably the hardest
for a novice to understand.
I guess you knew what (s)he wanted.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hmm... that's the only way I know how to work a timer, aside from GetTickCount(), but that button click event sounds like a good way too -- I didn't know about it.
|
|
|
|
|
The first timers I think of are multimedia one-shot/periodic timers or the window timers
created with SetTimer().
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
A c++ timer. I have NO idea what you just said =/
|
|
|
|
|
What kind of timer do you need?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
You have a handler for button clicks.
In that you use SetTimer() to get your timer running.
Windows will call your OnTimer() function.
There you do whatever needs to be done.
Now you should have more than enough to look up!
Failure is not an option - it's built right in.
|
|
|
|