|
Yes, you can use "..\" to specify to look in the parent folder. Example:
In file from folderB:
#include "..\FolderA\MyFile.h"
|
|
|
|
|
Thanks a lot!
Patrick
|
|
|
|
|
You can also add the relative (or absolute) path of the other directory to the project's additional include's in your project settings.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
I am trying to derive bytes from a pass phrase. The latest MSDN doc
indicated that the PasswordDerivedBytes.GetBytes method is obsolete. This
leads me to the CryptDeriveKey method. I can get it to work just fine with the following:
algName = "TripleDES"
algHashName = "SHA1"
keySize=192
rbgIV. Length =8
[this produces byte[] length = 24 {192 bits}]
Now. I want to create a 256 bit byte[] for use with Rijndael.
Unfortunatelty, I do not know the "correct" parameter values. I thought:
algName = "RijndaelManaged"
algHashName = "SHA256"
keySize=256
rbgIV.Length = 16
I can not get it to work. I keep getting the following exception:
System.Security.Cryptography.CryptographicExceptio n was unhandled
Message="Object identifier (OID) is unknown."
Source="mscorlib"
Q1. What are the valid values for the algName ?
Q2. Can any hash be used for any algnName?
Thanks for you help.
|
|
|
|
|
Hi all,
I am currently working on Serial Interface between a control box and PC and want to send/receive double values from Pc to the box as 8 uint8 values since the box only accepts in uint8 form.
For that i thought as follows : to get that double value (64 bits) in binary form and get the last 8 bits with &(and) operator and shifting bits to right till all bits are finished,namely :
double var;
char var2send[8]; % in array
var2send[0]= var & 0x00000000000000ff % last 8 bits with & operator
var>>8; %shifting bits
var2send[1]= var & 0x00000000000000ff
var>>8;
.
. % and sending this array as output
.
But in this code, i received an error that says i cant use double with & operators so that must be converted 64 bit long form.Besides, cast function rounds my double value to the nearest integer even if i type number like 23.34353 with precision.
How can i manage to do this?? or anyone has better way or suggestion?
I hope i could clearly explain my problem.
I would be very pleased if you could help me!
Thanks a lot!
Cahit
|
|
|
|
|
This is just a guess, but can you use a union for this?
union
{
double dValue;
struct
{
uint8 uValu1;
uint8 uValu2;
uint8 uValu3;
uint8 uValu4;
uint8 uValu5;
uint8 uValu6;
uint8 uValu7;
uint8 uValu8;
}
};
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
or even
union
{
double dValue;
uint8 u8value[8];
};
In general, what makes stuff like this tricky is using it across different architectures, such as x86 and m68k, for example, where byte ordering is different.
Steve S
Developer for hire
|
|
|
|
|
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Steve S wrote: union
{
double dValue;
uint8 u8value[8];
};
I would like to suggest this:
#pragma pack(1)
union
{
double dValue;
uint8 u8value[8];
};
#pragma pack()
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
There really is no need for that. Unsigned char's will be placed on 8-bit boundaries on all common systems, and doubles will be placed on 64-bit boundaries. The union will be sized and oriented based on the largest size requirement (the double), so packing it serves no purpose.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
BYTE *pBytes = (BYTE *)&var;
send(pBytes[0]);
send(pBytes[1]);
...
send(pBytes[7]);
|
|
|
|
|
hello everyone. i am building an FTP client to upload files on to an FTP server. my ftp client can create a folder, upload files and almost does everything when connected to local server. in fact, the code works fine with the local server. but when a remote server is used, my ftp client cannot upload files on to the server. the directory listing also cant be obtained. can anyone heip??
|
|
|
|
|
Hi...
Does anyone know why FaxRegisterRoutingExtension fails on Windows XP,
while it succeeds on Windows 2000?
Thanks very much
|
|
|
|
|
See here[^] if its good for you
|
|
|
|
|
Hello everyone,
I need to record a set of data items. For each data item, users may modify to some new content. So, I plan to use a timestamp field for each data item to record the time when user modifies data item last time.
I am not sure whether I should use a simple integer value (like version information, which increase 1 each time when user modifies data item)?
Which approach is better? What are the advantages and disadvantages of each approach?
thanks in advance,
George
|
|
|
|
|
George_George wrote: I am not sure whether I should use a simple integer value (like version information, which increase 1 each time when user modifies data item)?
This would only tell you how many times, rather than when, the item was modified.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thank you DavidCrow,
Do you mean using timestamp is always better than using integer?
regards,
George
|
|
|
|
|
George_George wrote: Do you mean using timestamp is always better than using integer?
Only if your goal is to "record the time when user modifies data item last time."
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi DavidCrow,
I only want to check which one is new and which one is old. I do not have to use timestamp, right? Anyway, are there any advantages when using a simple integer other than using timestamp?
regards,
George
|
|
|
|
|
George_George wrote: I only want to check which one is new and which one is old.
Then a simple numeric value would work.
George_George wrote: I do not have to use timestamp, right?
Correct.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thank you all the time, DavidCrow!
regards,
George
|
|
|
|
|
I have a string class, where I defined the binary operator '+' in the following ways:
class String:public List<char> {
...
String& operator + (const char[]) const;
String& operator + (const int) const;
friend String& operator +(const char[], const String& );
friend String& operator +(const uint, const String& );
...
}
along with an inherited method from the base class List<type> as follows:
List<TYPE>& operator + (const List<TYPE>& ) const;
When I try to build the project, I get the following error:
error C2678: binary '+' : no operator found which takes a left-hand operand of type 'String' (or there is no acceptable conversion)
I am getting three identical errors from other parts of my program that were written in a similar manner. Does anyone know what this can be attributed to? Thanks,
-Jeff
-- modified at 8:03 Wednesday 16th August, 2006
|
|
|
|
|
The message is issued by the compiler that didn't find a match that
satisfy the RIGHT operand, you said nothing about.
Admitting it was another "String", the reasons is because, when you
override a name all definition pertinent to that
name are lost in the inner scope.
In fact, since you override operator+ in String ,
any underlying operator+ in List
are anymore visible while accessing String .
You should redeclare, in String ,
friend String& operator+(const String& s)
{ return List<char>::operator+(s); }
along with the other operator+ variants you
already declared.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
I attempted that piece of code, and received an error like "Using non-static member of List<char>"
However, your response inspired me to try other things that were close to your solution, and the one that finally made the problem go away was simply to redefine the operation in the string class like:
String& String::operator +(const String&) const { <code here> }
I guess what I am confused about, is the following: In the following code, why isn't the List operator + equivalent to the String operator + as defined above from the compiler's perspective? Is there a way to make them equivalent, perhaps by using another method of definition?
template <class TYPE>
class List<TYPE> {
...
public:
List<TYPE>& operator +(const List<TYPE>& ) const;
...
}
class String:public List<char> {
}
Thanks,
-Jeff
-- modified at 14:36 Wednesday 16th August, 2006
|
|
|
|
|
Skippums wrote: I attempted that piece of code, and received an error like "Using non-static member of List<char>"
OOPS: In fact I did a mistake in writing the function: List::operator+ returns a List, not a String as i did.
Skippums wrote: Is there a way to make them equivalent, perhaps by using another method of definition?
No, that's basic C++ scope overriding.
class A
{
void f1(int) { ... }
void f1(double) { ... }
};
class B: public A
{
void f1(double) { ... }
};
It is not B::f1(double) overriding A::f1(double) .
It is B::f1 masking A::f1 , whatever f1 represent in A or B .
You can have as many f1 variant you want in A , but as you declare f1 to do whatever thing in B , f1 in A is "masked, when working with B scope".
-- modified at 11:32 Thursday 17th August, 2006
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|