|
CreateProcess()
system
WinExec
|
|
|
|
|
Hi
I want to edit my resource file to change it to a UNICODE version. But I can not input UNICODE into VS 6.0 resource editor.
Any one has the experience to solve this problem?
Thanx.
|
|
|
|
|
Open resource script in Notepad editor then input unicode text, save as unicode file and compile. Hope that works
|
|
|
|
|
Hi
Thank you for the reply. I tried that. The VC 6.0 can not compile the UNICODE resource file.
Thanx
|
|
|
|
|
Hi all:
I have a struct like following:
struct {
float x, y, z;
} Vector;
Vector v1, v2;
at some time, I want v1 and v2 to be a single variable what I mean is that v1 v2 are always containing the same value and whenever I change the value of v1, v2 will be changed automatically. For some reason somewhere else the program, I can't declare v1, v2 as pointers Vectorv *v1, *v2 explicitly. I tried &v1 = &v2. But obviously it doesn't work. Does anybody have a solution for this problems please???
Thanks alot!!!
Asura
-- modified at 15:29 Tuesday 7th February, 2006
|
|
|
|
|
Well, if V1 == V2 ( always ), then remove one or the other.
or make V2 a reference to V1;
Vector V1;
Vector& V2 = V1;
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Ming Luo wrote: at some time, I want v1 and v2 to be a single variable...
Can't you just use a union ?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
I'd be a little cautious naming your struct type, 'Vector'. That could collide and cause confusion. But having said that the following should be work okay.
struct{
float x,y,z;
} ThreeFloats;
...
ThreeFloats v1;
ThreeFloats* v2 = &v1;
...
v2->x = 1.2;
v2->y = 3.4;
v2->z = v1.x * v1.y;
assert ( v1.z == 1.2*3.4 );
Chris Meech
I am Canadian. [heard in a local bar]
When I want privacy, I'll close the bathroom door. [Stan Shannon]
BAD DAY FOR: Friendly competition, as Ford Motor Co. declared the employee parking lot at its truck plant in Dearborn, Mich., off limits to vehicles built by rival companies. Workers have to drive a Ford to work, or park across the street. [CNNMoney.com]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
I am transfering around large files and my problem is that I try to open these large files before they are done transferring. Is there a way to check to see if a file is complete or done transferring?
I guess I could just keep trying to open the file until it opens..... however, I was wondering if anybody else had a better idea.
Thanks,
Andrew
|
|
|
|
|
amt35 wrote: ...my problem is that I try to open these large files before they are done transferring.
Define "I." Is the same program doing the transferring and the opening?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Sorry, about that... I see the confusion.
The answer is no. Another program (or user) is transferring the files around and if they are placed in a folder I am "watching" then my program tries to process the file.
I am using ReadDirectoryChangesW to monitor the directory.
Thanks,
Andrew
|
|
|
|
|
you can't ... unless you know the size of the file beeing transfered.
the application that sends the file could rename the file to something like _uncomplete_<filename>.ext
and your application can check that the file name is still _uncomplete_
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
amt35 wrote: I am using ReadDirectoryChangesW to monitor the directory.
What does the call (to ReadDirectoryChangesW() ) look like?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
If the file is kept open during the transfer, try and open it in exclusive mode - if it is alread open, the call will fail with a sharing violation.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Instead of trying to open the file, you could check the size of the file, and when it does not change for (??) 10 seconds or 1 second (depends on the stability of the file transfer) then try to open it.
Fundamentally, this file size approach is similar to your file opening approach - these are both trial-and-error.
The idea suggested in another reply of having the file transfer application rename the file when it finishes is neater.
|
|
|
|
|
hi
i am tryin to write a program(personal interest) which generates the strings of length 5 with a given input of 2 strings from a set of strings.
that is, we have 26 alphabets and the input is "a b".
and my desired output should be "a b c d e"(length =5)
and all possible combinations with "a b - - -".
and also output should not contain "a b d c e" if it has "a b c d e".
can anyone help me the loop.
thanking you.
|
|
|
|
|
You've not supplied near enough information to form a useful pattern. Based on the one example of "a b" producing "a b c d e", most anything is possible such as "s t" producing "s t u v w". I hardly think that is what you are after. Be more specific and you're bound to get more help.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
i meant :
the program takes the input a b (two inputs) and the rest it generates the combinations with a b - - -.(string combination of length 5 with first two given or inputted.)
and also if s and t are the inputs it creates the combinations with s t - - -.
without repetition means if a b c d e is one of the output a b d c e can't be the output.
and the program should generate each and every combination of the input.
like a and b are inputs then,
a b c d e
a b d e f
.
.
.
etc.
thanking you
|
|
|
|
|
well, just generate a random letter between a and z, repeat until it is not one of your 2 input letters, and add to the string ( repeat 3 times for the 3 letters ).
or do the letters "c d e" or "d e f" are sequential ?
can you have :
a b z g r
?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
yeah
we can have a b z g r but if a b z g r comes first then a b g r z cannot occur.
or first can you please give me the loop code for generating the sequence of strings.
like a b c d e
...
..
..
a b x y z .
with each and every combination.
i am not that good in programming.
so can you please help me generating the string sequence.
thanking you
|
|
|
|
|
You're still not making any sense. What is the correlation between the two inputs and the final output? Do the two inputs always get appended to the front of the output? What would "c n" yield?
kamal_aluri wrote: ...the program should generate each and every combination of the input.
Which looks like what? For your "a b" example, the six outputs are:
a b c d e
a b c e d
a b d c e
a b d e c
a b e c d
a b e d c
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
he just want 3 other letters ( different than the 2 original ones ).
I don't think there is any correlation between the 2 input values and the 3 others (except they must be different )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
i am sorry for being unclear.
the thing is there are 26 alphabets and the inputs should be 2(a b or b c or whatever)
and the program should generate strings of length 5 starting with given input.(a b or whatever)
that is combinations of a b - - -
the three -'s should be filled with the string combinations(from the remaining 24 alphabets) of length 3 and other than given input (a b in this case.)
thanking you.
|
|
|
|
|
This should work:
#include <string>
#include <algorithm>
std::string GenerateString(const std::string& input)
{
std::string output("abcdefghijklmnopqrstuvwxyz");
for(int i=0; i<2; i++)
{
std::remove(output.begin(), output.end(), input.at(i));
}
std::random_shuffle(output.begin(), output.end());
output.resize(3);
output.insert(0, input);
return output;
}
[edit]of course, you better check the size of input to make sure it has 2 chars in it, else you'll get an exception. [/edit]
~Nitron.
ññòòïðïðB A start
-- modified at 16:44 Tuesday 7th February, 2006
|
|
|
|
|
Your loop should probably look something like:
char Result[7];
// assuming result[0] and Result[1] have already been filled
Result[6] = '\0';
for (Result[2] = 'a'; Result[2] <= 'z'; Result[2]++)
{
if ( Result[2] != Result[0]
&& Result[2] != Result[1])
{
for (Result[3] = Result[2]; Result[3] <= 'z'; Result[3]++)
{
if ( Result[3] != Result[0]
&& Result[3] != Result[1]
&& Result[3] != Result[2])
{
........ etc.
printf ("%s\n",Result);
}
}
}
}
Didn't yet think this through completely, but its a start.
William
|
|
|
|