|
Can you give me a small sample please?!
|
|
|
|
|
this is just a sample as i said you can use any data storage thing you want like a linked list or map you could also use a class instead of a struct there this is just a small example of what i think your looking for
<code>
int m_Value1 = 0;
int m_Value2 = 1;
struct stuff
{
char*name;
int id;
};
stuff_array[2] =
{
{"m_Value1", m_Value1},
{"m_Value2", m_Value2},
};
int GetVal(CString name)
{
for(int i = 0; i < 2; i++)
{
if(name == stuff_array[i].name)
return stuff_array[i].id
}
}
</code>
|
|
|
|
|
I need a 16 bit compiler to compile the project that located at:
Microsoft Knowledge Base Article - 324409[^]
Because I tink BLDDRV.cpp (that Calls the 16-bit API which causes the INF driver index to be built ) need a 16 Bit compiler. Is it correct!?
I can NOT compile it by MSVC 6. I get many error by VC6 such as:
c:\98ddk\inc\win98\inc16\windows.h(181) : error C4226: nonstandard extension used : '_near' is an obsolete keyword
(Is older version of MSVC such as VC++ 1.52, 16 bit compiler?)
|
|
|
|
|
Behzad Ebrahimi wrote:
(Is older version of MSVC such as VC++ 1.52, 16 bit compiler?)
Yes. From time to time you can find a copy on EBay.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I found just book about VC++ 1.5, on ebay.com.
Can you help more me!
|
|
|
|
|
Behzad, send me your mailing address. I'll be happy to give you my copy of MSVC 1.52. I no longer use it and don't have it installed on my PC. Btw, it's also available on the MSDN discs (you need to be a subscriber).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
What the hell is it for?
I see them all the time in MFC code and have never had the need for it, so i've never bothered to read up on it...
Cheers
How do I print my voice mail?
|
|
|
|
|
A forward reference tells the compiler about a type (usually a class/struct) without giving the full definition. Its purpose is similar to a function prototype in that regard.
You most often use them when two classes have to refer to each other.
class Bar;
class Foo
{
Bar* m_pBar;
};
class Bar
{
Foo m_foo;
};
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
You cannot truly appreciate Dilbert unless you've read it in the original Klingon.
|
|
|
|
|
I kinda figured it was like a function prototype, but I wasn't sure...
Thanks for clearing that up for me
Cheers
How do I print my voice mail?
|
|
|
|
|
a class that has been declared but not been defined,the class is been called forward referenced.
|
|
|
|
|
I am trying to determin wether a point with certain koordinates is inside a circle determined by other 3 pointes.
I calculated the radius of the circel and the coordinates of its middle point
I now want to put the coordinates of the point I am examining into the circles equation to see wether its inside the circle or outside but becuse of inaccurate calculations (sqrt function etc.) I always get a very big error my calculations are correct as far as I can determine, how can I bypass this problem:
bool HszogTeszt (Pont a, Pont b, Pont c)
{
double hossz1qvd = Distanzqvd(a[0], a[1], b[0], b[1]);
double hossz2qvd = Distanzqvd(a[0], a[1] ,c[0], c[1]);
double hossz3qvd = Distanzqvd(c[0], c[1], b[0], b[1]);
double hossz1 = sqrt(hossz1qvd);
double hossz2 = sqrt(hossz2qvd);
double hossz3 = sqrt(hossz3qvd);
if (hossz1>= (hossz2+hossz3)) return false;
if (hossz2>= (hossz2qvd);
double hossz3 = sqrt(hossz3qvd);
if (hossz1>= (hossz2+hossz3)) return false;
if (hossz2>= (hossz1+hossz3)) return false;
if (hossz3>= (hossz2+hossz1)) return false;
double radiusqvd;
double s;
s = (hossz1 + hossz2 + hossz3)/2;
radiusqvd = (hossz1qvd*hossz2qvd*hossz3qvd)/(16*(s*(s-hossz1)*(s-hossz2)*(s-hossz3)));
double kx, ky;
ky = ((c[0]*c[0]-b[0]*b[0]+c[1]*c[1]-b[1]*b[1])*(c[0]-a[0])/2-(c[0]*c[0]-a[0]*a[0]+c[1]*c[1]-a[1]*a[1])*(c[0]-b[0])/2)/((c[1]-b[1])*(c[0]-a[0])-(c[1]-a[1])*(c[0]-b[0]));
kx = ((c[0]*c[0]-b[0]*b[0]+c[1]*c[1]-b[1]*b[1])/2-ky*(c[1]-b[1]))/(c[0]-b[0]);
int dpszamol;
{
double aux;
aux = ((FelszinPontok.PontHalmaz[dpszamol][0] - kx)*(FelszinPontok.PontHalmaz[dpszamol][0] - kx) +
(FelszinPontok.PontHalmaz[dpszamol][1] - ky)*(FelszinPontok.PontHalmaz[dpszamol][1] - ky) - radiusqvd);
if (aux<-1) return false;
}
return true;
}
Muad-Dib
mailto:adamo_piar@freemail.hu
Made in Hungary
|
|
|
|
|
I am using MFC in VC++ v7. I need to do two things:
1. Programmatically give my window focus, and put it over all other windows.
2. Take away my windows focus, but still leave it on top of all other windows. Or, if it is possible, exclude one, and just put my window on top of all others without giving it focus.
Any help would be great.
|
|
|
|
|
One solution is SetWindowPos().
Kuphryn
|
|
|
|
|
|
IHMO if a DLL or EXE is in memory it IS loaded
Secondly...how do you know it's in memory and how did you get it there?
Did you open the exe and copy the entire file into RAM???
Use LoadLibrary()
If after this you still feel the need to load a DLL manually you would probably have to read some of the advanced hooking articles on here...I recall and article that disscussed ways of changing your CPU's IP allowing you to hijack API calls and such, which is probably the direction you want to head in
Cheers
How do I print my voice mail?
|
|
|
|
|
HINSTANCE hinst_yourdll;
BOOL m_bCanDo;
hinst_yourdll = LoadLibrary( "yourneed.dll" );
m_bCanDo= FALSE;
if(hinst_yourdll)
{m_bCanDo = TRUE;
dllfunc_yourneed = ((LPFNDLLFUNC1) GetProcAddress( hinst_yourdll, "yourneedfunc" ));
}}
|
|
|
|
|
Hi !!
Please help me, i have the following problem with "read data from txt"
First of all I have #include <fstream> and there is also : using namespace std;
typedef int Pont[3]; // 3D (x,y,z) co-ordinates
<code>int Pointloader()
{ const int PontNum= 5;
int load[3]= {0};
Pont RendPoints[PontNum];
ifstream my_file("d:\\prog2004\\my_file.txt");
my_file >> (int)load[0] >> (int)load[1]>> ' ' >> (int)load[2] >> ' ' >> '\n';
my_file.close();
}</code>
DEBUG:
error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'const char' (or there is no acceptable conversion)
Muad-Dib
mailto:adamo_piar@freemail.hu
Made in Hungary
|
|
|
|
|
Remove ' ' from this line:
my_file >> (int)load[0] >> (int)load[1]>> ' ' >> (int)load[2] >> ' ' >> '\n';
and change it to:
my_file >> (int)load[0] >> (int)load[1]>> (int)load[2];
Kamyar Souri
Booria CAD/CAM Systems
www.booria.com
|
|
|
|
|
#include<fstream>
#include<iostream>
using namespace std;
void Pointloader()
{ //const int PontNum= 5; //i dont know its use
int data;
int load[3]= {0};
//Pont RendPoints[PontNum];
ifstream my_file("F:\\test\\mytest.txt");
int i=0;
while ( my_file >> data )
{i+=1;
cout<
|
|
|
|
|
Hello,
<br />
while ( my_file >> data )<br />
{i+=1;<br />
cout<<data;<br />
load[i]=data;<br />
} <br />
this won't work when there are more lines of data!
Exemple:
The text file contains two lines of data:
1 23 345
456 5 567
The first two numbers will be read correctly. After you read the third number, i will contain the value 3, which will result in undefined behaviour!!!
if the program is very small, you can be lucky, but this is very and I mean VERY bad programming!!!
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
guys:
there are the folowing data(greater than three lines:
123 23 45
23 56 89
123 345
6564
65757
123 456
the running result:
123 23 45 23 56 89 123 345 6564 65757 123 456 Press any key to continue
|
|
|
|
|
and therefore the running result for the index integer i would become greater than two! since your array isn't dynamic, you'll end up writing to adresses that arn't allocated or even worse, adresses allocated to other variables...
That kind of programming mistakes lead to undefined behaviour...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Hi All,
What do I need in oreder to store Information from some computers, and later check/use this information in a different files?
mmfried
|
|
|
|
|
Why is the title "Registry"?
Don't try it, just do it!
|
|
|
|
|
If I wasn't clear enough I want to read the registry of other computer (remotl connected) to some computer, collect the reg. info. from that computer, (and then use the info. later).
- I don't want just to copy files, but registry info. from a remote computer.
|
|
|
|