Search found 15 matches

by Marmis
Wed Nov 29, 2006 5:45 pm
Forum: Open Discussion
Topic: Building a lookup table
Replies: 2
Views: 1204

Building a lookup table

I have been studying an CRC-algorithm that uses table lookups to speed itself up. I'm working with 8 chunks of data at one point and I should have 8 tables with 256 cells each. Here's how the tables are described: Each chunk is used for accessing a separate lookup table. The lookup tables used by th...
by Marmis
Thu Jun 01, 2006 5:01 pm
Forum: General Development
Topic: Converting "hex string" to int
Replies: 13
Views: 4812

It seems you have crossed the 0x7fffffff boundary on your example. I guess this means if strtol converts to a signed word, you actually get the value you commented behind it. Maybe if you put (unsigned long) in front of the first one, you get the proper casting to std::cout and it will show the sam...
by Marmis
Tue May 30, 2006 9:21 pm
Forum: General Development
Topic: Converting "hex string" to int
Replies: 13
Views: 4812

I gave the strtol()-function a go too: #include <iostream> #include <cstdlib> int main() { std::cout << strtol("0xe765cfd7", NULL, 16) << std::endl; // 2147483647 std::cout << 0xe765cfd7 << std::endl; // 3882209239 return 0; } The lower one should be the correct value. Am I missing something or isn'...
by Marmis
Tue May 30, 2006 6:32 pm
Forum: General Development
Topic: Converting "hex string" to int
Replies: 13
Views: 4812

Thanks for your answer.

However I was mostly after non-wxWidgets-solution, something I could achieve by using standard C++ and/or Boost. (My bad, forgot to mention that.)
by Marmis
Tue May 30, 2006 5:33 pm
Forum: General Development
Topic: Converting "hex string" to int
Replies: 13
Views: 4812

Converting "hex string" to int

I have a hex value stored in a std::string, say: std::string str = "0xE765CFD7"; How could the value be converted into an int? I thought I had the answer in boost::lexical_cast with the following quick try: boost::lexical_cast<int, string>("0xE765CFD7") But apparently the function couldn't handle he...
by Marmis
Tue Aug 09, 2005 1:54 pm
Forum: C++ Development
Topic: wxTextCtrl and ascii-art
Replies: 3
Views: 920

Thank you, it seems to be working fine. Had to try out a few encodings there, but got it working. Cheers :)
by Marmis
Tue Aug 09, 2005 12:35 pm
Forum: C++ Development
Topic: wxTextCtrl and ascii-art
Replies: 3
Views: 920

wxTextCtrl and ascii-art

How can I set the wxTextCtrl to show the text in it as "ascii-art"? For example, if I have set something like this:

Code: Select all

char block = 219;
How do I get it to show this as a "block", instead of "
by Marmis
Mon Jul 11, 2005 8:42 am
Forum: C++ Development
Topic: How to lower the disk space taken by my programs!
Replies: 26
Views: 4052

lowjoel's UPX with GUI can be found on his website: joelsplace.sg/studyroom/index.php

I'm not sure whether or not it's working at the moment, I for one couldn't access it. Hope it works for you though.
by Marmis
Wed Jul 06, 2005 5:33 pm
Forum: C++ Development
Topic: wxString and wxArrayString problem
Replies: 17
Views: 3058

Oh yes, it was quite a simple one, there must have been something wrong with my eyes and brains :) No worries about the language, that was clear enough for me.
by Marmis
Wed Jul 06, 2005 5:15 pm
Forum: C++ Development
Topic: wxString and wxArrayString problem
Replies: 17
Views: 3058

Whoa, that did it, thanks. Mind telling me why that worked and mine didn't? Just that I could learn from my mistakes.
by Marmis
Wed Jul 06, 2005 5:07 pm
Forum: C++ Development
Topic: wxString and wxArrayString problem
Replies: 17
Views: 3058

Alright, I spoke too soon. I thought the getfilelist-code was okay, no whine from the compiler either. But when the program is running and I try to connect to an FTP, I get the basic "x.exe has encountered a problem and needs to close, blabla." So here's a short clip of my current code: wxArrayStrin...
by Marmis
Wed Jul 06, 2005 3:37 pm
Forum: C++ Development
Topic: wxString and wxArrayString problem
Replies: 17
Views: 3058

Ah, thanks for mentioning upCASE. Seems like that fixed it. I was a bit unsure about the array, didn't find anything about it in the documentation. (Or well, didn't know where to look).

Anyway, I think I'm good now. Thanks to you and to everyone else spending their time helping me out.
by Marmis
Wed Jul 06, 2005 3:10 pm
Forum: C++ Development
Topic: wxString and wxArrayString problem
Replies: 17
Views: 3058

Yes, I did do that. It should work with something like this, wxArrayString TestA[5]; wxString TestB = TestA[0]; ...right? I guess that's what you meant. Well, for me, it doesn't. I believe it should work, because it wouldn't make no sense not to. Surely there has to be some way to get the informatio...
by Marmis
Wed Jul 06, 2005 2:41 pm
Forum: C++ Development
Topic: wxString and wxArrayString problem
Replies: 17
Views: 3058

Not sure if it does use an old/broken compiler. Anyway, tried what you said: no matching function for call to 'wxString::wxString(wxArrayString&)' candidates are: wxString::wxString(const void*, const void*) ... list of candidates here, 13 ones I think... [Build Error] [base.o] Error 1 Anything else...
by Marmis
Wed Jul 06, 2005 1:52 pm
Forum: C++ Development
Topic: wxString and wxArrayString problem
Replies: 17
Views: 3058

I too stumbled upon this same problem. The loop is a good idea, but I think it has some errors. Isn't this one illegal: wxString myFileList = myFileListArray[0]; Tried it too, got "conversion from 'wxArrayString' to non-scalar type 'wxString' requested" on Dev-C++. Is that code snippet non-working o...