|
<br />
LPBYTE p = new BYTE[1024];<br />
How can swap p into virtual memory?
modified on Wednesday, April 2, 2008 2:41 AM
|
|
|
|
|
Good news, it is already inside it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
http://en.wikipedia.org/wiki/Virtual_memory[^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi,
I am looking for ways to display RSSI status for wireless connection (basically vertical bars with increasing height). I am looking to see if microsoft provides me an ActiveX control (like a progress bar) to display the signal strength on inputting a value in a range. Please let me know if you know if this is available or a way to implement this using VC++.
Thanks!
-A
|
|
|
|
|
abupriabi@yahoo.com wrote: control (like a progress bar) to display the signal strength on inputting a value in a range. Please let me know if you know if this is available or a way to implement this using VC++.
Take a look at CDC::FillRect Should work.
led mike
|
|
|
|
|
abupriabi@yahoo.com wrote: I am looking to see if microsoft provides me an ActiveX control (like a progress bar) to display the signal strength on inputting a value in a range.
Why do you need an ActiveX control for the above?
Don't you like the standard progress bar control?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: Why do you need an ActiveX control for the above?
Don't you like the standard progress bar control?
In standard progress bar all the bars are of the same height. I want a control wherein the height of the bars are increasing: Like the signal strength indicator on cell phone.
|
|
|
|
|
CP search engine makes the magic happen [^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
hi
how can i reverse a vertical slider (min at bottom max at top)
"i know there are lots of math functions for reverse it"
i tried TBS_DOWNISLEFT but nothing was happen
this is a VC++ 6.0 project and i.m updating/Compiling it
with VS .NET 2003 it compiles without error but slider seems normal
i am creating it with
CSliderCtrl *m_slider;
m_slider->CreateEx()
at runtime
and a second question
is there any way to set visible or invisible
slider's (standard)tooltip at runtime(after created)
thanks
|
|
|
|
|
Have you tried the SetRange() method?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DAVID! Stop passing out those secret documented methods!
led mike
|
|
|
|
|
humm! i got it
|
|
|
|
|
good answers with mockingly
i do not asked how to set range of slider
normally if orientation of slider is vertical
SetRange(0,100); 0 at the top and 100 at the bottom
i want to do 0 at the bottom 100 at the top
i hope you understand me
thanks
|
|
|
|
|
If you want the top and bottom to be the opposite numbers, try setting the range with opposite numbers too.
Eg,
SetRange (100,0);
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Iain Clarke wrote: If you want the top and bottom to be the opposite numbers, try setting the range with opposite numbers too.
Dear Iain Clarke
before open this thread, i have tried it lots of times
SetRange (100,0); << this locks slider have you tried it..?
is it works for you..? if so please tell me what i have to do aditionally
i have used either TBS_DOWNISLEFT and TBS_REVERSED
i have defined different WINVER s
i thing i am doing something wrong but what i do not know
thanks
|
|
|
|
|
I owe you an apology - I was thinking of the up/down control, and just setting the range works fine.
eg:
SendDlgItemMessage (IDC_SEGMENTEDGECORRSPIN, UDM_SETRANGE, 0, MAKELONG((short)20, (short)-20));
is operational.
But the trackbar (as windows rather than MFC) calls it, is a different control.
Rather than MFCs set range, have you tried using: TBM_SETRANGEMIN , TBM_SETRANGEMAX .
TBS_REVERSED is just cosmetic.
Last but not least, just reverse it in your code:
SendDlgItem (hDlg, IDC_zzzzz, TBM_SETPOS, TRUE, (LPARAM)(1000-nPos));
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Grettings everyone, today im dealing with Crypto552 created by Wei Dai.
im converting a project my father did long ago. since we think different i didnt want to have all the crypto files spread across my solution so i created a project for them.
in my visual studio 8 solution i have 2 projects: CRYPTO (In wich the cryptography solucion is written in c++) and builds perfectly; ZEUS08 (Wich is the project thats gonna have the conversion of what my father did in C++) both projects are in C++
inside CRYPTO theres a namespace called CryptoPP. (NAMESPACE_BEGIN(CryptoPP)) wich is in all the files .h and.cpp
since im copying parts from the last version im having some problems.
the most important one is:
im trying to use the namespace CryptoPP in ZEUS08 but it wont allow me...
i have tried
USING_NAMESPACE(CryptoPP);
using namespace CryptoPP;
but it keeps telling me:
error C2781 : 'CryptoPP' : a namespace with this name does not exist
does anybody have an idea why it tortures me with that nonsense?, i mean the project is in my solution why it wont recognize it?
help would be apreciated.
|
|
|
|
|
pabloraul wrote: NAMESPACE_BEGIN
what the heck is that?
pabloraul wrote: i mean the project is in my solution why it wont recognize it?
That means nothing. You have to have the namespace header file included for the compiler to know about the namespace.
led mike
|
|
|
|
|
about the NAMESPACE_BEGIN(CryptoPP), i really dont know. the compiler understands that it its the beggining of the namespace and at the end of the file theres a NAMESPACE_END. when i look at the object browser it has something like this:
CRYPTO
{}CryptoPP //meaning that cryptopp is inside crypto
{}Std
about including the header file of the namespace, i dont now which one since every file of the class has that thing inside...
by the way, i cant even include the files of CRYPTO into de files of ZEUS
example:
#include "config.h" //cannot include file, no such file or directory
modified on Tuesday, April 1, 2008 1:13 PM
|
|
|
|
|
pabloraul wrote: i dont now which one since every file of the class has that thing inside
Well you have to include every header file that defines any class that you want to use anyway. If you are really this confused about header files and namespaces you might need to learn a little more about C++ fundamentals before attempting your project.
led mike
|
|
|
|
|
that would be perfect but try explaining that to my dad.
lets try this example:
file structure:
CRYPTO
-config.h
ZEUS08
-myfile.cpp
config.h
NAMESPACE_BEGIN(CryptoPP)<br />
<br />
typedef unsigned short word16;<br />
typedef unsigned int word32;<br />
<br />
#if defined(__GNUC__) || defined(__MWERKS__) || defined(__SUNPRO_CC)<br />
#define WORD64_AVAILABLE<br />
typedef unsigned long long word64;<br />
#define W64LIT(x) x##LL<br />
#elif defined(_MSC_VER) || defined(__BORLANDC__)<br />
#define WORD64_AVAILABLE<br />
typedef unsigned __int64 word64;<br />
#define W64LIT(x) x##ui64<br />
#endif
since it has the definition for W64LIT i decided to include it.
so i put into my file
#include "config.h"
but it gives me fatal error C1083: Cannot open include file: 'config.h': no such file or directory
would u please help me with that or give me a link to c++ basics¿?
|
|
|
|
|
pabloraul wrote: but it gives me fatal error C1083: Cannot open include file: 'config.h': no such file or directory
Looks like a n include path problem, not a namespace problem.
I'm still curious what the NAMESPACE_BEGIN macro expands to...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
include path problem, im gonna research about that.
about the namespace begin im gonna post few of the files for you to see at least how its supposed to work. wei dai wrote it somehow and it works, i just need to use that library in order to use cryptography in my solution.
here is a picture of the object browser for you to see that CryptoPP is a namespace
argnames.h
#ifndef CRYPTOPP_ARGNAMES_H<br />
#define CRYPTOPP_ARGNAMES_H<br />
<br />
#include "cryptlib.h"<br />
<br />
NAMESPACE_BEGIN(CryptoPP)<br />
<br />
DOCUMENTED_NAMESPACE_BEGIN(Name)<br />
<br />
#define CRYPTOPP_DEFINE_NAME_STRING(name) inline const char *name() {return #name;}<br />
<br />
CRYPTOPP_DEFINE_NAME_STRING(ValueNames)
CRYPTOPP_DEFINE_NAME_STRING(Version)
CRYPTOPP_DEFINE_NAME_STRING(Seed)
CRYPTOPP_DEFINE_NAME_STRING(Key)
CRYPTOPP_DEFINE_NAME_STRING(IV)
CRYPTOPP_DEFINE_NAME_STRING(StolenIV)
CRYPTOPP_DEFINE_NAME_STRING(Rounds)
CRYPTOPP_DEFINE_NAME_STRING(FeedbackSize)
CRYPTOPP_DEFINE_NAME_STRING(WordSize)
CRYPTOPP_DEFINE_NAME_STRING(BlockSize)
CRYPTOPP_DEFINE_NAME_STRING(EffectiveKeyLength)
CRYPTOPP_DEFINE_NAME_STRING(KeySize)
CRYPTOPP_DEFINE_NAME_STRING(ModulusSize)
CRYPTOPP_DEFINE_NAME_STRING(SubgroupOrderSize)
CRYPTOPP_DEFINE_NAME_STRING(PrivateExponentSize)
CRYPTOPP_DEFINE_NAME_STRING(Modulus)
CRYPTOPP_DEFINE_NAME_STRING(PublicExponent)
CRYPTOPP_DEFINE_NAME_STRING(PrivateExponent)
CRYPTOPP_DEFINE_NAME_STRING(PublicElement)
CRYPTOPP_DEFINE_NAME_STRING(SubgroupOrder)
CRYPTOPP_DEFINE_NAME_STRING(Cofactor)
CRYPTOPP_DEFINE_NAME_STRING(SubgroupGenerator)
CRYPTOPP_DEFINE_NAME_STRING(Curve)
CRYPTOPP_DEFINE_NAME_STRING(GroupOID)
CRYPTOPP_DEFINE_NAME_STRING(PointerToPrimeSelector)
CRYPTOPP_DEFINE_NAME_STRING(Prime1)
CRYPTOPP_DEFINE_NAME_STRING(Prime2)
CRYPTOPP_DEFINE_NAME_STRING(ModPrime1PrivateExponent)
CRYPTOPP_DEFINE_NAME_STRING(ModPrime2PrivateExponent)
CRYPTOPP_DEFINE_NAME_STRING(MultiplicativeInverseOfPrime2ModPrime1)
CRYPTOPP_DEFINE_NAME_STRING(QuadraticResidueModPrime1)
CRYPTOPP_DEFINE_NAME_STRING(QuadraticResidueModPrime2)
CRYPTOPP_DEFINE_NAME_STRING(PutMessage)
CRYPTOPP_DEFINE_NAME_STRING(TruncatedDigestSize)
CRYPTOPP_DEFINE_NAME_STRING(HashVerificationFilterFlags)
CRYPTOPP_DEFINE_NAME_STRING(SignatureVerificationFilterFlags)
CRYPTOPP_DEFINE_NAME_STRING(InputBuffer)
CRYPTOPP_DEFINE_NAME_STRING(OutputBuffer)
CRYPTOPP_DEFINE_NAME_STRING(InputFileName)
CRYPTOPP_DEFINE_NAME_STRING(InputStreamPointer)
CRYPTOPP_DEFINE_NAME_STRING(InputBinaryMode)
CRYPTOPP_DEFINE_NAME_STRING(OutputFileName)
CRYPTOPP_DEFINE_NAME_STRING(OutputStreamPointer)
CRYPTOPP_DEFINE_NAME_STRING(OutputBinaryMode)
CRYPTOPP_DEFINE_NAME_STRING(EncodingParameters)
CRYPTOPP_DEFINE_NAME_STRING(KeyDerivationParameters)
CRYPTOPP_DEFINE_NAME_STRING(Separator)
CRYPTOPP_DEFINE_NAME_STRING(Terminator)
CRYPTOPP_DEFINE_NAME_STRING(Uppercase)
CRYPTOPP_DEFINE_NAME_STRING(GroupSize)
CRYPTOPP_DEFINE_NAME_STRING(Pad)
CRYPTOPP_DEFINE_NAME_STRING(PaddingByte)
CRYPTOPP_DEFINE_NAME_STRING(Log2Base)
CRYPTOPP_DEFINE_NAME_STRING(EncodingLookupArray)
CRYPTOPP_DEFINE_NAME_STRING(DecodingLookupArray)
CRYPTOPP_DEFINE_NAME_STRING(InsertLineBreaks)
CRYPTOPP_DEFINE_NAME_STRING(MaxLineLength)
CRYPTOPP_DEFINE_NAME_STRING(DigestSize)
CRYPTOPP_DEFINE_NAME_STRING(L1KeyLength)
<br />
DOCUMENTED_NAMESPACE_END<br />
<br />
NAMESPACE_END<br />
<br />
#endif<br />
aes.h
#ifndef CRYPTOPP_AES_H<br />
#define CRYPTOPP_AES_H<br />
<br />
#include "rijndael.h"<br />
<br />
NAMESPACE_BEGIN(CryptoPP)<br />
<br />
DOCUMENTED_TYPEDEF(Rijndael, AES);<br />
<br />
typedef RijndaelEncryption AESEncryption;<br />
typedef RijndaelDecryption AESDecryption;<br />
<br />
NAMESPACE_END<br />
<br />
#endif
basecode.h
#ifndef CRYPTOPP_BASECODE_H<br />
#define CRYPTOPP_BASECODE_H<br />
<br />
#include "filters.h"<br />
#include "algparam.h"<br />
#include "argnames.h"<br />
<br />
NAMESPACE_BEGIN(CryptoPP)<br />
<br />
class CRYPTOPP_DLL BaseN_Encoder : public Unflushable<Filter><br />
{<br />
public:<br />
BaseN_Encoder(BufferedTransformation *attachment=NULL)<br />
{Detach(attachment);}<br />
<br />
BaseN_Encoder(const byte *alphabet, int log2base, BufferedTransformation *attachment=NULL, int padding=-1)<br />
{<br />
Detach(attachment);<br />
IsolatedInitialize(MakeParameters(Name::EncodingLookupArray(), alphabet)<br />
(Name::Log2Base(), log2base)<br />
(Name::Pad(), padding != -1)<br />
(Name::PaddingByte(), byte(padding)));<br />
}<br />
<br />
void IsolatedInitialize(const NameValuePairs ¶meters);<br />
size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking);<br />
<br />
private:<br />
const byte *m_alphabet;<br />
int m_padding, m_bitsPerChar, m_outputBlockSize;<br />
int m_bytePos, m_bitPos;<br />
SecByteBlock m_outBuf;<br />
};<br />
<br />
class CRYPTOPP_DLL BaseN_Decoder : public Unflushable<Filter><br />
{<br />
public:<br />
BaseN_Decoder(BufferedTransformation *attachment=NULL)<br />
{Detach(attachment);}<br />
<br />
BaseN_Decoder(const int *lookup, int log2base, BufferedTransformation *attachment=NULL)<br />
{<br />
Detach(attachment);<br />
IsolatedInitialize(MakeParameters(Name::DecodingLookupArray(), lookup)(Name::Log2Base(), log2base));<br />
}<br />
<br />
void IsolatedInitialize(const NameValuePairs ¶meters);<br />
size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking);<br />
<br />
static void CRYPTOPP_API InitializeDecodingLookupArray(int *lookup, const byte *alphabet, unsigned int base, bool caseInsensitive);<br />
<br />
private:<br />
const int *m_lookup;<br />
int m_padding, m_bitsPerChar, m_outputBlockSize;<br />
int m_bytePos, m_bitPos;<br />
SecByteBlock m_outBuf;<br />
};<br />
<br />
class CRYPTOPP_DLL Grouper : public Bufferless<Filter><br />
{<br />
public:<br />
Grouper(BufferedTransformation *attachment=NULL)<br />
{Detach(attachment);}<br />
<br />
Grouper(int groupSize, const std::string &separator, const std::string &terminator, BufferedTransformation *attachment=NULL)<br />
{<br />
Detach(attachment);<br />
IsolatedInitialize(MakeParameters(Name::GroupSize(), groupSize)<br />
(Name::Separator(), ConstByteArrayParameter(separator))<br />
(Name::Terminator(), ConstByteArrayParameter(terminator)));<br />
}<br />
<br />
void IsolatedInitialize(const NameValuePairs ¶meters);<br />
size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking);<br />
<br />
private:<br />
SecByteBlock m_separator, m_terminator;<br />
size_t m_groupSize, m_counter;<br />
};<br />
<br />
NAMESPACE_END<br />
<br />
#endif<br />
and a cpp
algparam.cpp
<br />
#include "pch.h"<br />
<br />
#ifndef CRYPTOPP_IMPORTS<br />
<br />
#include "algparam.h"<br />
<br />
NAMESPACE_BEGIN(CryptoPP)<br />
<br />
PAssignIntToInteger g_pAssignIntToInteger = NULL;<br />
<br />
bool CombinedNameValuePairs::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const<br />
{<br />
if (strcmp(name, "ValueNames") == 0)<br />
return m_pairs1.GetVoidValue(name, valueType, pValue) && m_pairs2.GetVoidValue(name, valueType, pValue);<br />
else<br />
return m_pairs1.GetVoidValue(name, valueType, pValue) || m_pairs2.GetVoidValue(name, valueType, pValue);<br />
}<br />
<br />
bool AlgorithmParametersBase::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const<br />
{<br />
if (strcmp(name, "ValueNames") == 0)<br />
{<br />
ThrowIfTypeMismatch(name, typeid(std::string), valueType);<br />
GetParent().GetVoidValue(name, valueType, pValue);<br />
(*reinterpret_cast<std::string *>(pValue) += m_name) += ";";<br />
return true;<br />
}<br />
else if (strcmp(name, m_name) == 0)<br />
{<br />
AssignValue(name, valueType, pValue);<br />
m_used = true;<br />
return true;<br />
}<br />
else<br />
return GetParent().GetVoidValue(name, valueType, pValue);<br />
}<br />
<br />
NAMESPACE_END<br />
<br />
#endif
|
|
|
|
|
pabloraul wrote: include path problem, im gonna research about that.
That's absolutely necessary, since any other problems will be un-fixable until you can successfully include the header files you need.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|