|
may be you need to pass the handle of the tree view window to the dialog box you create, either by sending a message or a member function call. In your dialog use the handle of the tree view to get a pointer to the tree view, and access it freely
good luck,
Mohammad Gdeisat
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
I would like to align some static variables (floats) to 16 byte boundary's so I can use SSE instructions to speed up calculations. In microsoft visual C++ this is very simple:
__declspec(align(16)) float A[65536];
&A[0]=0x???????0
But for my current project I have to use Borland C++ compiler. The Borland compiler does not support the align keyword. It is very easy to align dynamic variables to 16 byte boundary's using the function VirtualAlloc:
lpAddress=VirtualAlloc(NULL,65536*4,MEM_COMMIT,PAGE_READWRITE);
lpAddress=0x????0000
But if it is possible I would like to use static variables. I have tryed the following:
typedef struct
{
CHAR cPadding[16];
}PADDING;
#pragma pack(16)
PADDING padding;
FLOAT A[65536];
#pragma pack()
#pragma pack(16)
LONG DOUBLE padding1;
LONG padding2;
SHORT padding3;
FLOAT A[65536];
#pragma pack()
but this does not work. Does anyone have experience with this?? Thank You in advance
|
|
|
|
|
Is it possible to turn off and on resize for individual columns?
|
|
|
|
|
I'm writing a project using DirectX 8 SDK in VS 6.
I'm having a problem with following:
Compiler doesn't understand new data types that I need to use.
IDirectSound m_pSound; // OK
IDirectSound8 m_pSound8; //Use of undefined struct IDirectSound8
In dsound.h IDirectSound8 for example defined as new data type only if DIRECTSOUND_VERSION constant is more than 0x8000.
I tryed to define it as 0x8000 in my stdafx.h, but it didn't help.
How do I force my copmiler to understand new data types?
|
|
|
|
|
First of all, if dsound.h has something like this
#if DIRECTSOUND_VERSION > 0x8000
class IDirectSound8 {
... then you will need to #define DIRECTSOUND_VERSION 0x8001 at least in order for the #if test to be satisfied.
Also, you may need to #define more than one value to enable the definition of IDirectSound8 . Check dsound.h to make sure you've got all of the requirements.
Software Zen: delete this;
|
|
|
|
|
I defined DIRECTSOUND_VERSION as 0x0801 almost everywhere it is possible (having redifinitions though).
Now I declare a variable:
IDirectSoundCapture8* m_buffer;
I get an error: 'missing storage-class or type specifiers'
If I change the type of m_buffer to IDirectSoundCapture everything compiles well.
I also looked into dsound.h and didn't find any more defines I need to use
|
|
|
|
|
I resolved the error!
It turned up, that VC++ has it' own DirectX.
The solution was to move in Tools->Options-Directories directories containg the DirectX 8 SDK to the most top, so compiler include them first and only then standard VC files
let's try everythin'!
|
|
|
|
|
Hello,
I am having a problem with a function. I am trying to increment a variable (odometer) using the speed and distance traveled.
Below is what I have. Any suggestions are appreciated.
Thanks,
Eric
<br />
void drive( int, int );
<br />
<br />
<br />
<br />
void Car::drive( int spd, int minutes )
{<br />
int remainderMinutes = 0;<br />
int hours;<br />
int distance;<br />
<br />
system( "CLS" );<br />
<br />
while( minutes > 60 )<br />
{<br />
remainderMinutes += minutes % 60 * oneDividedBySixty;<br />
minutes += remainderMinutes;<br />
}<br />
<br />
hours = minutes * oneDividedBySixty;<br />
<br />
distance = spd * minutes;<br />
<br />
cout << "\n\n The distance is " << distance << ".";<br />
cout << "\n\n The speed is " << speed << ".";<br />
cout << "\n\n The time is " << minutes << " minutes.";<br />
}<br />
<br />
<br />
<br />
int main()<br />
{<br />
Car c;<br />
<br />
char choice;<br />
do<br />
{<br />
cout << "\n\n\n Please make a selection from the menu.\n\n";<br />
cout << "\n Press 'D' to display the car attributes.\n";<br />
cout << "\n Press 'R' to reset the car attributes.\n";<br />
cout << "\n Press 'X' to exit the program.\n";<br />
<br />
cin >> choice;<br />
choice = toupper( choice );<br />
<br />
switch( toupper( choice ) )<br />
{<br />
case 'D': c.printCar();<br />
break;<br />
<br />
case 'R': c.reset();<br />
break;<br />
<br />
case 'X': break;<br />
<br />
default: cout << "\n Unknown choice entered.\n"<br />
<< " Enter a new choice.\n\n";<br />
break;<br />
}<br />
<br />
} while ( choice != 'X' );<br />
<br />
<br />
c.reset();<br />
<br />
c.printCar();<br />
<br />
<br />
<br />
c.drive( c.getSpeed(), c.getMinutes() );<br />
<br />
<br />
<br />
cout << "\n\n\n ";<br />
<br />
return 0;<br />
<br />
}<br />
|
|
|
|
|
You should start by describing what your problem is.
SkyWalker
|
|
|
|
|
My problem is that the remainderMinutes equation is not working correctly.
Thank you,
Eric
|
|
|
|
|
How did you declare (and initialize) oneDividedBySixty ?
SkyWalker
-- modified at 8:32 Sunday 23rd October, 2005
|
|
|
|
|
OK, after tracing my code, I have fixed my previous problems (I think).
As of now, my two main concerns are:
1.) Making sure I convert the ints to floats correctly (where needed).
2.) Figuring out what is going on with my destructor (this is all new to me).
Every time I run the program with the destructor, I get an ENTERNAL COMPILER ERROR.
I really appreciate the feedback and suggestions!
Thanks,
Eric
Here is my program:
<br />
<br />
#ifndef HEADER_H<br />
#define HEADER_H<br />
<br />
<br />
class Car<br />
{<br />
public:<br />
Car();<br />
Car( int, string, string, string, string, int );<br />
<br />
void setYear( int );<br />
void setManufacturer( string );<br />
void setModel( string );<br />
void setColor( string );<br />
void setCondition( string );<br />
void setOdometer( int );<br />
<br />
int getYear();<br />
string getManufacturer();<br />
string getModel();<br />
string getColor();<br />
string getCondition();<br />
int getOdometer();<br />
<br />
void printYear();<br />
void printManufacturer();<br />
void printModel();<br />
void printColor();<br />
void printCondition();<br />
void printOdometer();<br />
<br />
int getMinutes();<br />
int getSpeed();<br />
<br />
void drive( int, int );<br />
void newCar();<br />
void displayOdometer();<br />
void reset();<br />
void setCar( int, string, string, string, string, int );<br />
void printCar();<br />
<br />
private:<br />
int year;<br />
string manufacturer;<br />
string model;<br />
string color;<br />
string condition;<br />
int odometer;<br />
int speed;<br />
int minutes;<br />
<br />
};<br />
<br />
#endif<br />
<br />
<br />
<br />
#include <iostream><br />
#include <iomanip><br />
#include <string><br />
<br />
using namespace std;<br />
<br />
#include "Header.h"<br />
<br />
Car::Car()<br />
{<br />
system( "CLS" );<br />
<br />
year = 9999;<br />
manufacturer = "NoManufacturerYet";<br />
model = "NoModelYet";<br />
color = "NoColorYet";<br />
condition = "NoConditionYet";<br />
odometer = 999999999;<br />
}<br />
<br />
Car::Car( int newYear, string newManufacturer, string newModel, string newColor, string newCondition, int newOdometer )<br />
{<br />
system( "CLS" );<br />
<br />
year = newYear;<br />
manufacturer = newManufacturer;<br />
model = newModel;<br />
color = newColor;<br />
condition = newCondition;<br />
odometer = newOdometer;<br />
}<br />
<br />
<br />
<br />
void Car::setYear( int yr )<br />
{<br />
system( "CLS" );<br />
<br />
year = yr;<br />
}<br />
<br />
void Car::setManufacturer( string manufact )<br />
{<br />
system( "CLS" );<br />
<br />
manufacturer = manufact;<br />
}<br />
<br />
void Car::setModel( string mod )<br />
{<br />
system( "CLS" );<br />
<br />
model = mod;<br />
}<br />
<br />
void Car::setColor( string col )<br />
{<br />
system( "CLS" );<br />
<br />
color = col;<br />
}<br />
<br />
void Car::setCondition( string con )<br />
{<br />
system( "CLS" );<br />
<br />
condition = con;<br />
}<br />
<br />
void Car::setOdometer( int odom )<br />
{<br />
system( "CLS" );<br />
<br />
odometer = odom;<br />
}<br />
<br />
int Car::getYear()<br />
{<br />
system( "CLS" );<br />
<br />
return year;<br />
}<br />
<br />
string Car::getManufacturer()<br />
{<br />
system( "CLS" );<br />
<br />
return manufacturer;<br />
}<br />
<br />
string Car::getModel()<br />
{<br />
system( "CLS" );<br />
<br />
return model;<br />
}<br />
<br />
string Car::getColor()<br />
{<br />
system( "CLS" );<br />
<br />
return color;<br />
}<br />
<br />
string Car::getCondition()<br />
{<br />
system( "CLS" );<br />
<br />
return condition;<br />
}<br />
<br />
int Car::getOdometer()<br />
{<br />
system( "CLS" );<br />
<br />
return odometer;<br />
}<br />
<br />
void Car::printYear()<br />
{<br />
<br />
cout <<"\n\n Year: " << year;<br />
}<br />
<br />
void Car::printManufacturer()<br />
{<br />
<br />
cout <<"\n\n Manufacturer: " << manufacturer;<br />
}<br />
<br />
void Car::printModel()<br />
{<br />
<br />
cout <<"\n\n Model: " << model;<br />
}<br />
<br />
void Car::printColor()<br />
{<br />
<br />
cout <<"\n\n Color: " << color;<br />
}<br />
<br />
void Car::printCondition()<br />
{<br />
<br />
cout <<"\n\n Condition: " << condition;<br />
}<br />
<br />
void Car::printOdometer()<br />
{<br />
<br />
cout <<"\n\n Odometer: " << odometer;<br />
}<br />
<br />
int Car::getSpeed()<br />
{<br />
system( "CLS" );<br />
<br />
cout << "\n\n Please enter the speed you drove the car: ";<br />
cin >> speed;<br />
<br />
return speed;<br />
}<br />
<br />
int Car::getMinutes()<br />
{<br />
system( "CLS" );<br />
<br />
cout << "\n\n Please enter the number of minutes you drove the car: ";<br />
cin >> minutes;<br />
<br />
return minutes;<br />
}<br />
<br />
void Car::drive( int spd, int minutes )<br />
{<br />
int miles;<br />
<br />
system( "CLS" );<br />
<br />
miles = ( ( spd * minutes ) / 60 );<br />
odometer += miles;<br />
<br />
cout << "\n\n The speed you entered is " << speed << ".";<br />
cout << "\n\n The number of minutes you entered is " << minutes << " minutes.";<br />
cout << "\n\n The milage added to the odometer is " << miles << ".";<br />
<br />
cout << "\n\n Press Enter to continue.";<br />
cin.get();<br />
}<br />
<br />
void Car::newCar()<br />
{<br />
system( "CLS" );<br />
<br />
cout << "\n Please enter the year of the car: ";<br />
cin >> year;<br />
cout << "\n Please enter the manufacturer of the car: ";<br />
cin >> manufacturer;<br />
cout << "\n Please enter the model of the car: ";<br />
cin >> model;<br />
cout << "\n Please enter the color of the car: ";<br />
cin >> color;<br />
cout << "\n Please enter the condition of the car: ";<br />
cin >> condition;<br />
cout << "\n Please enter the milage (odometer) of the new car: ";<br />
cin >> odometer;<br />
<br />
setCar( year, manufacturer, model, color, condition, odometer );<br />
}<br />
<br />
void Car::displayOdometer()<br />
{<br />
system( "CLS" );<br />
<br />
cout << "\n The odometer is at " << odometer << ".";<br />
}<br />
<br />
void Car::reset()<br />
{<br />
system( "CLS" );<br />
<br />
year = 0;<br />
manufacturer = "";<br />
model = "";<br />
color = "";<br />
condition = "";<br />
odometer = 0;<br />
<br />
cout << "\n\n The car attributes have been reset.\n";<br />
}<br />
<br />
void Car::setCar( int year, string manufacturer, string model, string color, string condition, int odometer )<br />
{<br />
system( "CLS" );<br />
}<br />
<br />
void Car::printCar()<br />
{<br />
<br />
printYear();<br />
printManufacturer();<br />
printModel();<br />
printColor();<br />
printCondition();<br />
printOdometer();<br />
}<br />
<br />
<br />
<br />
#include <iostream><br />
<br />
using namespace std;<br />
<br />
#include "Header.h"<br />
<br />
int main()<br />
{<br />
Car c;<br />
<br />
char choice;<br />
do<br />
{ <br />
cout << "\n\n\n Please make a selection from the menu.\n\n";<br />
cout << "\n Press 'A' to add milage to the odometer.\n";<br />
cout << "\n Press 'C' to clear the screen.\n";<br />
cout << "\n Press 'D' to display the car attributes.\n";<br />
cout << "\n Press 'N' to add new/used car attributes.\n";<br />
cout << "\n Press 'O' to display the odometer.\n";<br />
cout << "\n Press 'R' to reset the car attributes.\n";<br />
cout << "\n Press 'X' to exit the program.\n";<br />
<br />
cin >> choice;<br />
choice = toupper( choice );<br />
<br />
switch( toupper( choice ) )<br />
{<br />
case 'A': c.drive( c.getSpeed(), c.getMinutes() );<br />
break;<br />
<br />
case 'C': system( "CLS");<br />
break;<br />
<br />
case 'D': c.printCar();<br />
break;<br />
<br />
case 'N': c.newCar();<br />
break;<br />
<br />
case 'O': c.displayOdometer();<br />
break;<br />
<br />
case 'R': c.reset();<br />
break;<br />
<br />
case 'X': break;<br />
<br />
default: cout << "\n Unknown choice entered.\n"<br />
<< " Enter a new choice.\n\n";<br />
break;<br />
}<br />
<br />
} while ( choice != 'X' );<br />
<br />
cout << "\n\n\n ";<br />
<br />
return 0;<br />
}<br />
-- modified at 11:04 Sunday 23rd October, 2005
|
|
|
|
|
Does anyone know what the INTERNAL COMPILER ERROR means?
<br />
--------------------Configuration: Implementation - Win32 Debug--------------------<br />
Compiling...<br />
Implementation.cpp<br />
I:\Documents and Settings\Implementation.cpp(48) : fatal error C1001: INTERNAL COMPILER ERROR<br />
(compiler file 'msc1.cpp', line 1794) <br />
Please choose the Technical Support command on the Visual C++ <br />
Help menu, or open the Technical Support help file for more information<br />
Main.cpp<br />
Error executing cl.exe.<br />
<br />
Implementation.exe - 1 error(s), 0 warning(s)<br />
I found this http://owlnext.sourceforge.net/qa51.html[^].
The site says, "This error occurs only on machines with the Windows 95 or Windows 98 operating system."
But I am running Win XP Home w/SP2.
I'm puzzled.
Thanks,
Eric
|
|
|
|
|
Oops, nevermind the INTERNAL COMPILER ERROR.
I forgot a set of parenthesis (see http://lithiumdata.com/QandA/compileerror.htm[^]).
Originally I had:
<br />
Car::~Car<br />
{<br />
cout << "\n\n The destructor has been called.\n\n";<br />
}<br />
Here is what it needs to be:
<br />
Car::~Car()<br />
{<br />
cout << "\n\n The destructor has been called.\n\n";<br />
}<br />
Thanks,
Eric
|
|
|
|
|
if i have a clistctrl on my dialog.
a variable called list is associated with it.
now, i want to add listview-groups in this list.
i try to create a PLVGROUP-structure,
but if i want to run this code, the compiler generates an error.
i can't create any PLVGROUP structure!
what do i have to do to create one? if i create
a variable of PLVGROUP, then i can access it's members, like cbSize.
but if i want to compile, it doesn't work.
can anyone help me?
(i hope you understand my bad english. im from switzerland, so i don't
know english very well )
|
|
|
|
|
|
#include "commctrl.h"
Software Zen: delete this;
|
|
|
|
|
thanks.
but it still doesn't work when i add "#include 'commctrl.h'".
and: how do i specify comctl32.dll, ver. 6 in the manifest?
|
|
|
|
|
LVGROUP is only for XP+ so you have to tell your compiler that you are targeting XP.
in your stdafx.h file add the following
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x501 // target windows NT version 5.01 (XP)
#endif If you do not do this then the portions of commctrl.h that declares LVGROUP etc. is left out by the preprocessor.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
oke, i tried to do this.
but if i compile, it still fails....
do i have to include other headers or
some libs?
i hope you can help me! thanks
|
|
|
|
|
"It fails" is not very discriptive. If look at the compiler output it will give you an error number (ie C####), a brief description of the error, and the line number in your files that caused the error. Look up the error number in MSDN for a better description, and possible solution for the error. Then try to fix your source file taking into account what MSDN says. If you still have troubles, then post the code here that caused the error, and the compiler output that describes the error, complete with the error number. Then maybe I can help you, but the most obvious solutions, based on the very limited info you supplied, has already been given by me and others.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hi.
Although i have some experience in VC++ but lack in fundamentals and want to learn some basics of VC++ 6.plese help me in this regard.
please forward me the links at "ubiquee@gmail.com".
thanks
|
|
|
|
|
|
Thanks for the link .but i am looking for visual C++ vesion 6.there is a difference between the version 6 and 5.(in commands and prcedures)
|
|
|
|
|