|
hi
thank you for the reply.but it didnt works i got the folowing errors
error C2446: '<' : no conversion from 'struct HINSTANCE__ *' to 'const int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
: error C2040: '<' : 'const int' differs in levels of indirection from 'struct HINSTANCE__ *'
Error executing cl.exe.
lekshmi
|
|
|
|
|
just type cast..
if( 32 < (int)hInst )
{
}
else
{
}
nave
|
|
|
|
|
Do like that
if (ShellExecute(...) > 32)<br />
{do somthing...}
I don't know if it works or not. But i hope it will.
If problem remains, let us know.
Good luck.
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
Use:
HINSTANCE hInst = ShellExecute(...);
if (hInst > (HINSTANCE) HINSTANCE_ERROR)
{
...
} or
if ((int) hInst > HINSTANCE_ERROR)
{
...
}
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
hi
Thank you for the reply.im new to VC++ .can you please give some more detailed explanation.
i have used the shellexecute for extractig a zipfileand i just want whether it returns a success or..
thanks in advance
lekshmi
|
|
|
|
|
lekshmipriya wrote: can you please give some more detailed explanation.
Such as? Short of sitting down at your computer and typing it for you, I've shown you exactly what you need.
lekshmipriya wrote: i just want whether it returns a success or..
Which is exactly what I showed you. What is it that you are not understanding?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
i have some data ranged form 0 to 1,i want show these data in color map.
The function "img" in matlab is what i want.With help of this forum,i have solved the problem how to gradually change one assigned color to the other.Now I feel puzzled about this problem,take an example,
I use "0" to represent RGB (255,0,0) and use "1" to represent RGB(0,0,255);then other data values should represent what?How can i make these data gradually changed from RGB(255,0,0) to RGB(0,0,255)?
In fact,i can assgn "0" to repesent any color such as RGB (0,0,0) and so on,and "1"can represent any colors ,then make one color gradually change to the other.
-- modified at 22:46 Tuesday 25th April, 2006
|
|
|
|
|
It can be simply done as follows, but i don't know whether it will meet your need...
COLORREF rgb1 = RGB( 255, 0, 0 );
COLORREF rgb2 = RGB( 0, 0, 255 );
float fVal = 0.5;
int nR1 = GetRValue( rgb1 );
int nG1 = GetGValue( rgb1 );
int nB1 = GetBValue( rgb1 );
int nR2 = GetRValue( rgb2 );
int nG2 = GetGValue( rgb2 );
int nB2 = GetBValue( rgb2 );
int nR = nR1 + ( nR2 - nR1 ) * fVal;
int nG = nG1 + ( nG2 - nG1 ) * fVal;
int nB = nB1 + ( nB2 - nB1 ) * fVal;
COLORREF rgb = RGB( nR, nG, nB );
- NS -
|
|
|
|
|
When I change large arrays from 'float' to 'double' I got error message.
I need to use 'double' for six large arrays each has size [16200].
Please advise.
Thanks
-- modified at 22:10 Tuesday 25th April, 2006
|
|
|
|
|
I guess you asked the same question yesterday!
As they said dynamically allocate memory.
Nibu thomas
Software Developer
|
|
|
|
|
After changing to double the three large arrays I print out (thr last three column)looks like:
monitor# 1 sampling rate 0.0002441
0.0000 -1.#IO -1.#IO -1.#IO
0.0002 -1.#IO -1.#IO -1.#IO
0.0005 -1.#IO -1.#IO -1.#IO
0.0007 -1.#IO -1.#IO -1.#IO
.........
.........
|
|
|
|
|
mrby123 wrote: When I change large arrays from 'float' to 'double' I got error message.
Mind readers we are not. What is the exact error message?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Hi, I spawn a process to open 'rsh.exe' (c:\windows\system32\rsh.exe), and I'm trying to change the text that appears on the command prompt window title bar, by using this command from my calling function: 'this->SetWindowText("test")'.
This works in Visual Studio, but oddly, the same code brought over to Visual C++ .NET, does not work due to the 'this' pointer being null! Any suggestions on how to accomplish this?
Thanks
-- modified at 22:03 Tuesday 25th April, 2006
|
|
|
|
|
Have you used SetConsoleTitle ?
Nibu thomas
Software Developer
|
|
|
|
|
How to make a .OLB file in VC++?
Thanks in advance.
|
|
|
|
|
You guys have been a big help with my previous question, I have another.
I have input file "input.txt"
i have outputfile "output.txt"
input.txt will always look like
A 1 5 4
B 2 6 3
the first value can be a different, but will always be one char in length.
I want to grab each value on the first and second line and assign variables to them.
i've looked a lot about inFile.get or .getline or .peek, but it's not making a whole lot of sense.
I have this:
ifstream inf;
ofstream outf1;
ofstream outf2;
inf.open(argv[1], ios::in);
outf1.open(argv[2], ios::in);
outf2.open(argv[2], ios::out);
char n, x, y, z;
while(!inf.eof())
inf.get >> n >> x >> y >> z;
Can anyone shed any light?
Thanks,
Ed
|
|
|
|
|
Reading a char doesn't skip white space and you don't need the get . Try this:
inf >> n >> ws >> x >> ws >> y >> ws >> z >> ws;
The ws manipulator can be used to explicitly skip white space.
Steve
|
|
|
|
|
i tried something like that, but i get this error:
error C2475: 'std::basic_istream<_Elem,_Traits>::get' : forming a pointer-to-member requires explicit use of the address-of operator ('&') and a qualified name
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
error C2475: 'std::basic_istream<_Elem,_Traits>::get' : forming a pointer-to-member requires explicit use of the address-of operator ('&') and a qualified name
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
warning C4552: '>>' : operator has no effect; expected operator with side-effect
|
|
|
|
|
I was wrong about the fact that reading a char doesn't skip white space. I used the following test program and was able to read in data like yours however:
-----
// Console.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <fstream>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
ifstream in("C:\\a.txt");
char n, a, b, c;
while (in >> n >> a >> b >> c)
{
cout << n << " " << a << " " << b << " " << c << endl;
}
return 0;
}
Steve
|
|
|
|
|
worked like a charm, Steve.
Thank you!
|
|
|
|
|
Steve, one last quick one, if I have two lines, how would I handle that?
my input file reads:
A 1 2 3
B 4 5 6
|
|
|
|
|
It should work with multiple lines. It will work with or without multiple lines. If reads the 1st character into n and the 2d, 3rd and 4th into a, b, c, respectively. Then it repeats the process. What exactly do you want to do with the data?
Steve
|
|
|
|
|
i came up with this...
char n, x, y, z, n2, x2, y2, z2;
while(!inf.eof())
inf >> n >> x >> y >> z >> n2 >> x2 >> y2 >> z2;
but was just seeing if there was a more efficient way of grabbing it.
in the large scheme of things, I am reading in this values:
A 1 5 7
B 2 4 5
which are actually points on a grid. so they are A(1,5,7) and B(2,4,5). Now I use those values and plug them into my class to do calculations. I never really worked with the ifstream much and i thank you again for your assistance!
-Ed
|
|
|
|
|
Can you show the code which plugs the data into your class?
Steve
|
|
|
|
|
im messing with that right now, but I can show you what I have so far...
int main(int argc, char* argv[])
{
ifstream inf;
ofstream outf1;
ofstream outf2;
inf.open("input.txt", ios::in);
outf1.open("output.txt", ios::in);
outf1.close();
outf2.open("output.txt", ios::out);
char n, x, y, z, n2, x2, y2, z2;
while(!inf.eof())
inf >> n >> x >> y >> z >> n2 >> x2 >> y2 >> z2;
Point p0;
Point p1(x,y,n);
Point3D p1(z);
p1.printP();
Point p2(x2,y2,n2);
Point3D p2(z3);
p2.printP();
system("pause");
/* inf.close();
outf2.close();
return 0;*/
}
I am working on a piece that exhibits inheritance. Basically Point class is already defined. I am inheriting it into Point3D class. I am getting my values from the input file, computing the distance between the points, then outputing to an output file.
|
|
|
|