|
Nothing happens then, still no smooth style!
Should I use some king of visual style to get smooth style. Think may read something like that a while ago, and how?
Thanks man for your time.
|
|
|
|
|
josip cagalj wrote: Should I use some king of visual style
I'm not aware of anything of the kind.
MSDN doesn't mention any setting required to enable the smooth progress bar style.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hello friends,
I have created our client server application using WinSock api in VC6.0 using Win32.
I want to create an application which monitors the data flow and user authentication
between client and server.
I want to create a middlewear application which monitors the data security between client and server withought disturbing client and server.
Please give me suggestions.
Waiting for the positive reply
|
|
|
|
|
You could just use something like Ethereal[^] to monitor the traffic.
Otherwise, you could write your own software to act as a proxy for the client, and log everything, but that seems (a) too much work, and (b) a source for bugs that wouldn't even be there without the middleware.
Iain.
|
|
|
|
|
Hi,
I have written a perfect Serializable class "X" with two variables and taken a dialog box with two editboxes. I am updating the information from dialog box into "X" variables and trying to serialize that class object.
Where should I call X.Serialize(ar) ? Is it in Document class? If so, is it mandatory ? I have also tried to do by declaring a global variable"Xobj" in the document class and calling the Xobj.Serialize(ar) in the Document's Serialize(). However I am getting "error C2011: 'X' : 'class' type redefinition".Perhaps may be the header file is getting included twice, I guess. But when I am trying to resolve the problem, it has entered an infinite loop and things have become too worst.
I have gone through many articles since yesterday on "Serializing the objects" where one serializable class is getting serialized in another Serializable class and so on. But my doubt is how and where will the root serializable class's Serialize() get called.
Please some one help me on this topic. I am unable to proceed with my sample application. Any sample application could also help me.
Thanks in advance.
Taruni
|
|
|
|
|
Typically it is done in the Document class (and in a standard SDI project, this is already done for you). This is the most logical place to put it because your document class is supposed to contain all data relevant for the application (but it can also contain other serializable classes).
It is not mandatory but it is a bit akward not to have a serializable document.
|
|
|
|
|
Hi All,
I need to parse the .xml file and i want to get the particular tag value.For example If i give <<book id="">,it should be return "bk101".
I found some example.But it listout the all valus.
Thanks & Regards,
Anitha
|
|
|
|
|
Take a look at TinyXML[^]. It's a simple XML parser and is fairly easy to use.
|
|
|
|
|
|
I saw your message, and couldn't help using a west country accent in my head...
Iain.
|
|
|
|
|
How often do you speak to yourself in your head with foreign accents? Are you seeing a doctor for this?
|
|
|
|
|
Welcome in the THHB [^], [^] Randor!
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
[My articles]
|
|
|
|
|
Wow, I am privileged to be listed with such distinguished members! I think...
-David Delaune
|
|
|
|
|
Thanx i do ve the same question..
kindly let me know the solution if u get it first ...
thanx..
|
|
|
|
|
Hi all,
I am trying to use CreateFile API in VISTA UAC ENABLE case but its returning 5 that is ACCESS_DENIED. I have to create my file at the same position and not anywhere else, now i want to elevate my process to create the file at same position. How can i do this????
Thanks in advance
|
|
|
|
|
See here[^] and here[^]
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
i have implemented like in 1st pane 1 string is displayed, in 2nd pane another string is displayed and in 3rd pane 3rd string is displayed. now i am trying to display 2nd pane's string into 3rd pane. in m_bar.SetPaneInfo(0,ID_INDICATOR_ABC, SBPS_NORMAL|SBPS_STRETCH,0);
m_bar.SetPaneInfo(1,ID_INDICATOR_XYZ, SBPS_NORMAL|SBPS_STRETCH,0);
m_bar.SetPaneInfo(2,ID_INDICATOR_T,SBPS_NORMAL|SBPS_STRETCH ,0);
but it is not getting changed in pane.
thanks in advance.
|
|
|
|
|
My only suggestion is to use your debugger, and follow the code down.
At some point, you'll see the code in CStatusBar return too early, and this will give you your problem.
That said, I'm surprised you're using SBPS_STRETCH for more than one pane. I thought that meant "take up all the rest of the space". And they can't all do that! Maybe the panes are too busy engaged in a tug of war to pay attention to you?
Iain.
|
|
|
|
|
Hi all,
Is there a c++ version of this or at least can a c++ version of this algorithm can be made? Please advise. Can anyone give me a sample on how to use windows crypto api decryption just by inputting an encrypted string?
Thanks,
Jayjay
btw this is made of c#
public static string Decrypt(string cipherString, bool useHashing)
{
byte[] keyArray;
byte[] toEncryptArray = Convert.FromBase64String(cipherString);
System.Configuration.AppSettingsReader settingsReader = new AppSettingsReader();
string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));
if (useHashing)
{
MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();
keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
hashmd5.Clear();
}
else
{
keyArray = UTF8Encoding.UTF8.GetBytes(key);
}
TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
tdes.Key = keyArray;
tdes.Mode = CipherMode.ECB;
tdes.Padding = PaddingMode.PKCS7;
ICryptoTransform cTransform = tdes.CreateDecryptor();
byte[] resultArray = cTransform.TransformFinalBlock
(toEncryptArray, 0, toEncryptArray.Length);
tdes.Clear();
return UTF8Encoding.UTF8.GetString(resultArray);
}
modified on Thursday, November 20, 2008 3:28 AM
|
|
|
|
|
|
Hi Randor,
Thanks btw this is the encrypt code from where the string passed is derived:
public static string Encrypt(string toEncrypt, bool useHashing)
{
byte[] keyArray;
byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(toEncrypt);
System.Configuration.AppSettingsReader settingsReader = new AppSettingsReader();
string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));
if (useHashing)
{
MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();
keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
hashmd5.Clear();
}
else
keyArray = UTF8Encoding.UTF8.GetBytes(key);
TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
tdes.Key = keyArray;
tdes.Mode = CipherMode.ECB;
tdes.Padding = PaddingMode.PKCS7;
ICryptoTransform cTransform = tdes.CreateEncryptor();
byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
tdes.Clear();
return Convert.ToBase64String(resultArray, 0, resultArray.Length);
}
|
|
|
|
|
Randor wrote: Hope it helps!
If it doesn't, it is not your fault, for sure.
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
[My articles]
|
|
|
|
|
Bonjour David,
I am a bit confused should I use CryptBinaryToString or CryptStringtoBinary?
Thanks,
Jayjay
|
|
|
|
|
Use CryptStringToBinary to decode from base64.
Use CryptBinaryToString to encode to base64.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi,
I did a translation test and here it is unfortunately it ends up garbage:
void ThreeDESdecrypt(unsigned char *cyphertext,unsigned long ctlen,unsigned char *passwd,unsigned long pwlen,unsigned char *plaintext,unsigned long *ptlen)
{
HCRYPTPROV hProv = NULL;
HCRYPTHASH hHash = NULL;
HCRYPTKEY hKey = NULL;
BYTE * value2 = {0};
DWORD lul_len, lul_buflen, lul_skip, lul_pflags;
bool lb_rtn;
BLOB lblob_data;
TCHAR convertedStr[13];
convertedStr[0] = ('\0');
BYTE key1[24] = {0};
lul_len = 13;
lul_buflen = (lul_len * 2);
std::string value = "Zed5OmjUWs8=";
hProv = InitializeCrypt();
bool result = CryptStringToBinary(value.c_str(), lul_len, CRYPT_STRING_BASE64, key1, &lul_buflen, &lul_skip, NULL);
result = CryptCreateHash(hProv,CALG_MD5,0,0,&hHash);
result = CryptDeriveKey(hProv,CALG_3DES,hHash,0,&hKey);
memcpy(plaintext,key1,*ptlen);
result = CryptDecrypt(hKey,NULL,1,0,plaintext,&ctlen);
*ptlen=ctlen;
result = CryptDestroyKey(hKey);
result = CryptDestroyHash(hHash);
result = CryptReleaseContext(hProv,0);
}
int main() {
HCRYPTPROV hCryptProv;
HCRYPTHASH hHash = 0;
HCRYPTKEY hKey = 0;
PBYTE pbBuffer = NULL;
DWORD dwCount;
const BYTE * value;
DWORD lul_len, lul_buflen, lul_skip, lul_pflags, ptlen;
bool lb_rtn;
BLOB lblob_data;
std::string key = "h3bmull3r";
const std::string s = "Zed5OmjUWs8=" ;
value = reinterpret_cast<const BYTE *>(s.c_str());
int stringSize = s.size();
TCHAR convertedStr[12];
convertedStr[0] = ('\0');
lul_len = s.size();
lul_buflen = (lul_len * 2);
char CypherText[128]="Zed5OmjUWs8=";
char MyPassword[]="h3bmull3r";
unsigned char MyString[128];
unsigned long len1,len2,len3;
len1=strlen(CypherText);
len2=strlen(MyPassword);
len3=128;
memset(MyString,0,128);
len1=128;
lb_rtn = CryptBinaryToString(value, lul_len, CRYPT_STRING_BASE64, convertedStr, &lul_buflen);
ThreeDESdecrypt((unsigned char *)CypherText,len3,(unsigned char *)MyPassword,len2,(unsigned char *)MyString,&len1);
return 0;
}
The bold part CryptDecrypt returns false and the plaintext is garbage, What I expect the plaintext to contain "test".
The thing is this is the code that encrypts test:
public static string Encrypt(string toEncrypt, bool useHashing)
{
byte[] keyArray;
byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(toEncrypt);
System.Configuration.AppSettingsReader settingsReader = new AppSettingsReader();
string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));
if (useHashing)
{
MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();
keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
hashmd5.Clear();
}
else
keyArray = UTF8Encoding.UTF8.GetBytes(key);
TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
tdes.Key = keyArray;
tdes.Mode = CipherMode.ECB;
tdes.Padding = PaddingMode.PKCS7;
ICryptoTransform cTransform = tdes.CreateEncryptor();
byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
tdes.Clear();
return Convert.ToBase64String(resultArray, 0, resultArray.Length);
}
That is the service that sends me the encrypted string which i need to decrypt I tested "test" as my string and I get "Zed5OmjUWs8=" as the encrypted string. also the key being used as the security key is "h3bmull3r"
Please advise.
merci,
Jayjay
modified on Friday, November 21, 2008 4:59 AM
|
|
|
|
|