|
No does not work, get another error which is what i should get
since the set contains _bstr_t and not _bstr_t *.
/Magnus
|
|
|
|
|
And when you simply remove the &s in the
bool operator ()(const _bstr_t &r1, const _bstr_t &r2)
declaration?
|
|
|
|
|
nevermind, the () operator have to be
bool operator ()(const _bstr_t &r1, const _bstr_t &r2) const
Really crappy error msg i think.....but thats STL it seems
/Magnus
|
|
|
|
|
You have another bug in that stricmp() is the wrong function to use. BSTRs are Unicode strings, you need to use _wcsicmp().
--Mike--
"Jobs that don't allow you to visit the Lounge 25 times a day at the minimum are not worth having anyway."
-- Nish, 3/28/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
I store _bstr_t not BSTR
and _bstr_t have a (char *) operator so it should work just fine.
(maybe not the most efficient way)
/Magnus
|
|
|
|
|
hi,
My question could be a stupid question, but i don't find the solution.
It's simple I have a managed function like that:
bool GetValorBinary(LONG lVarId, String & pCadena, int length)
- inside code i create a new String, where pcadena2 is a TCHAR.
String * prue(pcadena2);
- now i want to do something like to back the value in pCadena
pCadena=pcadena2;
- but at build i recived the next error:
error C2582: 'operator =' function is unavailable in 'System::String'
Any suggestion? thanks in advance.
Salamanca 2002 Capital Cultural Europea, Visitala
|
|
|
|
|
Perhaps
strcpy(pCadena, pcadena2);
helps?
|
|
|
|
|
thanks, but not, it doesn't work, i had try yet.
anymore ideas?
Salamanca 2002 Capital Cultural Europea, Visitala
|
|
|
|
|
This structure is not a true C-language structure because it contains variable-length members. This structure was created solely to depict the organization of data in a version resource and does not appear in any of the header files shipped with the Microsoft
Platform Software Development Kit (SDK).
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
First of, are you sure that:
String *pru(pcadena2);
works?
In the System::String class, there is a Copy() function that would do what you want.
Michel
If I am wrong or said something stupid, I apologize in advance
|
|
|
|
|
hi,
Yes i'm sure. that's works, but Copy() fuction doesn't works, doesn't generate any errors but not copy the string.
Salamanca 2002 Capital Cultural Europea, Visitala
|
|
|
|
|
Just curious...it seem most encryption (ciphers...?) use 128, 192 and 256 bit encryption strength.
What i'd like to know is why stop there...?
Why not make your encryption 134217728bit strength...this would take a millenia on even a cray super computer, which would be pretty hard to beat...Is it because of time required to encrypt/decrypt...? Or is it an actual limitation on the size of data the ciphers can accept...?
Just curious...
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
There are legal limitations. You can see how they look in your country here.
/moliate
|
|
|
|
|
Seriously...?
Thats the only reason why...that sux...
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Not the only reason... Different methods act differently on a longer key. Some might take considerable time to encrypy/decrypt. Others might not benefit at all. Take the simplest kind of crypto for example - the Ceasar crypto. This means shifting characters a specified number of places in the alphabeth, like "hello" -> C(2) -> "ignnq". There would be no benefit if you shifted 3 or 1188139 places (1188139%26 = 3). Many more complex cryptos act like this...
/moliate
|
|
|
|
|
It is largely encrypt/decrypt time.
Even with something like a 512 bit key, an RSA style cipher is slow. This is qhy PGP was created... it's a quick hack...
PGP uses an encryption algorithm called IDEA. it's not a public key algorithm, and therefore the single encrypt/decrypt key must be sent with the message. The traits of IDEA are such that it is secure provided the key is kept secret. IDEA is much quicker to compute than RSA.
PGP generates an IDEA key dynamically, and encrypts the message with that. It then uses RSA to encrypt the IDEA key, and that is sent along with the IDEA-encrypted body. This way, you get a Pretty Good security implementation that is relatively quick to process.
One of the less obvious problems is time taken to generate prime numbers for use in long key lengths. Generating prime numbers is one of the most computationally expensive things you can do.
Also, key length being binary, the relative difficulty to break a key is based on 2 raised to the power of the key length. Therefore, if a 64 bit key could be broken by brute force in 24 hours, a 65 bit key would theoretically take 48 hours. Things get somewhat exponential.
The encryption key length used for various applications is based on expense of using that key (processing power required to make solution easy to use) weighed up against the consequence of the information getting out.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
It is a matter of speed also...
I had an idea that at first seemed great, but later noticed a serious flaw...in that 128 bit encryption actually only encrypts at (i think) half the strength, maybe less.
The algorithm would have been fast encrypting/decrypting because it was basically bit shifting, but in a much fancier way than normal. Only generating a key would have been tricky if not impossible...because the implementation required each char in the key to be unique...
Nonetheless...it was only a semi-failed attempt...I did leanr quite a bit about encryption.
Anyways...thanx Jon
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Okay, TransparentBlt is an unresolved external symbol!!
Do I have to include a specific .LIB?????
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
What you're looking for is probably the function defined in msimg32.dll
|
|
|
|
|
I've tried include msimg32.lib to my project and then it worked!
But now this wont work anyway:
BOOL CTransparentBltDlg::OnEraseBkgnd(CDC* pDC)
{
CDialog::OnEraseBkgnd(pDC);
// TODO: Add your message handler code here and/or call default
CBitmap bmpLogo;
bmpLogo.LoadBitmap(IDB_BITMAP1);
BITMAP bm;
bmpLogo.GetObject(sizeof(BITMAP),&bm);
CDC dcMem;
dcMem.CreateCompatibleDC(pDC);
CBitmap* pbmpOld = dcMem.SelectObject(&bmpLogo);
::TransparentBlt(pDC->GetSafeHdc(), 10, 10, bm.bmWidth, bm.bmHeight, dcMem.GetSafeHdc(), 10, 10, bm.bmWidth, bm.bmHeight, RGB(255,255,255));
//pDC->BitBlt(10,10,bm.bmWidth, bm.bmHeight, &dcMem, 0 , 0, SRCCOPY);
dcMem.SelectObject(&pbmpOld);
return TRUE;
}
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
I use this code:
ULONG size = finder.GetLength();
afile = fopen( strpath, "r+" );
char *list1 =(char *) malloc(size);
fread( list1 , sizeof( char ), size, afile );
CString str1=(CString )(list1);
str1.Format(str1 );
AfxMessageBox(str1);
Size of my file is something about 1.97Mb,but in message box it only 10 charachter(also when I debug and 'Watch' list1).Any suggestion?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Just a suggestion: Test parameter size, it could be 10.
Or there could be a '\0' character in the file you read.
Oh, and you could also test if afile is actually opened, just in case...
Jan
"It could have been worse, it could have been ME!"
|
|
|
|
|
jan larsen wrote:
there could be a '\0' character in the file you read.
I think this is the reason but how can I solve it?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
You can't if you're trying to print/treat it as a C style string.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
As Christian is saying in this thread you cant't do anything about it if you want to print the raw char *.
But if the IO task went well then the pointer points to an array of size length and is an image of the data in the file.
If the file data are meant to be binary then you are misusing your pointer when you treat it as a string, i think that is one of the reasons why MS created the BYTE typedef so that you wont get confused.
If on the other hand the data is an array of zero terminated strings, then you could do something like this:
#include "stdio.h"
#include "string.h"
void PrintStrings(char * szString, int size)
{
int i;
char * pTmp;
i = 0;
pTmp = szString;
while (i < size)
{
printf(pTmp);
printf("\n");
i += strlen(pTmp) + 1;
pTmp = &szString[i];
}
}
Jan
"It could have been worse, it could have been ME!"
|
|
|
|