|
the asci code für 'ü' on my Pocket PC should be -4
No, -4 is only equivalent to 252 only if casting to a 8bit unsigned char . I guess your problem is that you're reading characters from the device into a (signed) char variable and converting them into 16bit Unicode characters, which won't get 252 for ü. Try reading into unsigned char s.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello...
Was wondering if anyone knows how to programmatically set the Visual C++ paths for .NET. In the old days of VC6, you could update the registry settings in "HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Build System\Components\Platforms\Win32 (x86)\Directories" which worked just fine. However I could not locate this key for VC7, any help would be greatly appreciated.
- Scott
|
|
|
|
|
HKLM\Software\Microsoft\VisualStudio\7.0\Vc\VC_OBJECTS_PLATFORM_INFO\Win32\Directories
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Hi PJ,
Thanks for the answer, however I have tried that already with no success, sorry I should have mentioned that. It seems that when you insert a path using the registry editor, lets say:
Include Dirs - C:\My Company\My Code\Include;
And open VisualStudio.NET and choose "Tools", "Options", "Projects", "VC++ Directories" and select Include Files, you will not see the path you just added. Additionally, if you add this path from within VisualStudio, you will not see the registry entry update either.
It appears that this registry entry is not really used, or used for another purpose and there is an external file that VS.NET is using to store and read this information from.
Any help in solving this mystery would be greatly appreciated
Cheers, Scott
|
|
|
|
|
Have a look at the file "VCComponents.dat" found in the folder "C:\Documents and settings\<your user name>\Local Settings\Application Data\Microsoft\Visual Studio\7.0\"
I found that by entering a bogus name in one of the directory fields in vs7, and then doing a search for all files containing that bogus name. This was the file that came up.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Thank you, that did the trick!
|
|
|
|
|
hi i am trying to use a hashtable in Visual C++. is there any class in VC++ to create hashtables ?
in some programs i saw that the hashtables is Sizable, for example a hash table with 2 mb Size (i think 2 mb of RAM) is it possible in VC++ to set a size of hashtable ?
thanx a lot
|
|
|
|
|
-=Ehsan-de-Burge=- wrote:
hi i am trying to use a hashtable in Visual C++. is there any class in VC++ to create hashtables ?
MFC CMap etc. uses hash tables. If you don't want to be locked intp VC++/MFC then look at STL, in particular STLPort.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
He'd have to look in pretty much every STL other than the one shipped with VC++/VS.NET. hasmap<> is a proposed container, not a standard one I believe (I think it comes from SGI, maybe as old as HP).
--
Eventhough the forrest is full of trees, there's still no tree between the trees.
|
|
|
|
|
Jörgen Sigvardsson wrote:
He'd have to look in pretty much every STL other than the one shipped with VC++/VS.NET. hasmap<> is a proposed container, not a standard one I believe (I think it comes from SGI, maybe as old as HP).
Yep, maybe one day the VC++ STL implementation will be brought up to date. STLPort http://www.stlport.com[^]seems to be one of the more popular STL's for VC++ developers and does include hashed containers: hash_set, hash_multiset, hash_map, hash_multimap. See the original SGI Documentation at: http://www.sgi.com/tech/stl/table_of_contents.html[^] for details.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Need some help in porting a Windows C++ program which uses STL to Solaris..I just need to know the Makefile options that I need to set..i am getting tons of errors when I COMPILE the program in solaris. Does anyone have any good links that can help ??
thanks
There are no failures; there are only extended learning opportunities.
|
|
|
|
|
You say you get errors when you run the program... does this mean you have compiled it? If you haven't compiled it, what are the errors like? Also, what compiler are you using?
|
|
|
|
|
thanks for answering..
i am sorry my question is wrongly worded..i meant to say that I get errors when I compile the program..the compiler is not able to find the usual STL headers like string, vector etc etc..
thanks
There are no failures; there are only extended learning opportunities.
|
|
|
|
|
If you're compiling using Sun's Workshop, then all the STL headers should be automatically included for you - theres no compile options needed. There is an option for when compiling templates in library files, but that should be detailed in the man page. If you're compiling with gcc then you may need to add in the STL part - go to STLport, and you can download a full STL implementation. There should be docs there on how to link it in with your program
|
|
|
|
|
i am compiling using Sun's workshop (CC)..
and this is a sample of the error messages that i get..
( i tried with .h extensions too ie list.h,string.h etc etc )
"keymatch.cpp", line 4: Error: Could not open include file list.
"keymatch.cpp", line 5: Error: Could not open include file string.
"keymatch.cpp", line 6: Error: Could not open include file deque.
"keymatch.cpp", line 8: Error: Could not open include file fstream.
There are no failures; there are only extended learning opportunities.
|
|
|
|
|
What version of workshop? Workshop < 5 does not have any STL, in which case you'll need the stlport mentioned above. If you have Workshop 5+ then STL is bundled with this, and your installation must be screwed. I dont have access to a sparc at the moment, but from memory the STL files are located somewhere within the workshop directory (/opt/SUNWspro is likely), and they dont have .h extensions either!
|
|
|
|
|
yes i was using 4.2 and it did not work..I tried the same on a box with 6.0 and yippeeee!!!! it is working like crazy !! thanks a lot anonymous..thanks a ton..
There are no failures; there are only extended learning opportunities.
|
|
|
|
|
Hi,
I'm looking for some help in developing a PIN generation algorithm for scratch cards. What I would like to do is take a range of "control numbers" (a sequential number representing a batch of PINs) and generate a 10-14 digit PIN based on that. I'm not looking for a random number generation, but something that will generate a pseduo-random number based on the control number. To further complicate the issue, the PINs would need to be unique over a large range control numbers (1M+).
I've experimented with different operations like MOD and shifting and I get a nice range of random PINs. But I cannot seem to figure out how to make the number unique over the range I'm looking for. I know it can be done but the math to develop / prove it is beyond me.
And suggestions or references would be appreciated. I understand that something like this is very propriety to a business so I'm not necessary looking for a complete solution, just a point in the right direction.
Below is an example of what I'm trying to do. Thanks in advance for the help,
David
Control # PIN
00000001 123.456.789.123
00000002 638.098.270.748
00000003 472.309.327.732
0000nnnn 852.382.127.034
|
|
|
|
|
you could just encrypt the control # with a cipher of some kind (there are a few here on CP). the output of a cipher is guaranteed to be unique - it has to be, if it can decrypt the encrypted data back to the correct input. personally, i would use a stream cipher (of which i don't see any on CP), since it eliminates the need for input padding. but, a block cipher will work, too.
so:
PIN = Encrypt(Control#)
where the control # has at least as many bits as the PIN.
-c
Zzzzz...
|
|
|
|
|
Interesting solution, I'll definitely take a look into it. Thanks for the quick reply.
D
|
|
|
|
|
Actually, it sounds like what you want is more of a one-way hash. I'm guessing that you don't need to be able to determine the control number from the PIN?
If you don't, check out one-way hashes. The one that comes to mind is MD5, but I know there are other more modern ones.
J
May the bear never have cause to eat you.
|
|
|
|
|
You are correct, another excellent suggestion.
|
|
|
|
|
a hash function doesn't guarantee that Hash(X) != Hash(Y), only that it's hard to find another input whos hash is the same as Hash(X).
-c
Zzzzz...
|
|
|
|
|
note that a one way hash doesn't fulfill his requirement that the PIN is unique. there can be hash collisions.
a hash only makes it difficult to find a second stream M' whos hash is the same as the first stream, M. the goal of a good hash function is to make the computation of M' based on the hash computationally infeasible.
-c
Zzzzz...
|
|
|
|
|
Chris Losinger wrote:
note that a one way hash doesn't fulfill his requirement that the PIN is unique. there can be hash collisions
Granted... Hmmm. I guess it depends on what the application is, because in a secure situation, I wouldn't want there to be an algorithm that would take a PIN and generate the control ID.
Can't even use a PRNG with period 1 million... because it would repeat numbers.
I guess what you need is a collision-less hash for your specific input size (1 million) - that is, an algorithm guaranteed (sp?) not to repeat itself within the first N inputs...
J
May the bear never have cause to eat you.
|
|
|
|