• Welcome to Jose's Read Only Forum 2023.
 

Address UNICODE 64-bit VS2015

Started by Patrice Terrier, January 18, 2017, 12:35:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Patrice Terrier

James--

Here is the WIP project, to work with UNICODE and 64-bit.
EXE binary size: 24 Kb

Not done yet:
- dynamic array to replace vector. (search for //zizi for the things to do)

Tools.h with my new LTRIM, RTRIM, TRIM (any) functions.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

James C. Fuller

Patrice,
  WOW! 24Kb
There is a LOT of source code in there to produce such a small exe!
Does this mean you are a fan of TCLib :)

James

Patrice Terrier

#2
The problem is:
We have to check thorougly each of the function being used to avoid embedding exta code.

Especially when dealing with strings or any oher facilities like Vector.

We have to write our own, but the result is this tiny piece of code that is back to the origin of C, the time where one single exe could fit on a single floppy disk ;)

Hutch will feel very frustrated when seing 64-bit UNICODE code that is able to create smaller exe file than his belowed PB 32-bit ANSI.  ;D
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Mike Lobanovsky

<OT>

Quote from: Patrice Terrier on January 18, 2017, 04:32:09 PMHutch will feel very frustrated when seing 64-bit UNICODE code that is able to create smaller exe file than his belowed PB 32-bit ANSI.  ;D

Oh, you're exhibiting the competition and sportsmanship egos of your inner character I've never suspected to exist! ;D

</OT>
Mike
(3.6GHz Intel Core i5 w/ 16GB RAM, 2 x GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

James C. Fuller

Patrice,
  I could not find the vector code ??
new/delete are fine for classes as they call the constructor/destructor but for arrays we also need realloc so calloc/realloc/free seem to be more in line.
I have array code from the bcx/bc9 RTL that does DIM,REDIM, and REDIM PRESERVE that should work.
I'll post a c++ demo shortly

James

Patrice Terrier

#5
In order to enable the FindDialog, and avoid
LNK2001 unresolved external symbol __chkstk

add this to Linker, Input, Additional Dependencies
chkstk.obj;Winspool.lib;TCLib.lib;kernel32.lib;user32.lib;gdi32.lib;comctl32.lib

QuoteDIM,REDIM, and REDIM PRESERVE
That would be nice if you have it, because this is the last thing to add to the attachmnent
see:
void Array_Resize(IN long maxenties) {
//zizi        gAddressBook.resize(gP.maxentries);
}

void Array_Erase(IN long entry) {
//zizi        gAddressBook.erase(gAddressBook.begin() + gP.currententry -1);
}
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

James C. Fuller

#6
Patrice,
  Give this a try.
Not commented but you should be able to follow it.

Re:  unresolved external symbol __chkstk
I chased this this too and ended up with a compile or link option I believe.
I do not have it manually added.
Take a look at my batch file.

Have you tested if code not used in an #include file is added to the exe?
I know any code in the main cpp file that's not used  is not added but am not sure on #include's

James


Frederick J. Harris

Quote
We have to write our own, but the result is this tiny piece of code that is back to the origin of C, the time where one single exe could fit on a single floppy disk

One of the most absolute and fundamental goals of my TCLib work was that it be capable of using the capabilities of the C++ language.  I never considered C to be any substitute for a high level language and definitely not a substitute for PowerBASIC.  That's why in my very earliest work on this after I saw I could get both a "Hello, World!" console program and a Windows GUI up and running in 2560 bytes in x64, I immediately started experimenting with my String Class, which uses C++ new and delete in the typical manner, and of course uses C++ Classes.  The final step was in many ways getting my templated Dynamic Multi-Dimensional Array Class working, which was no work at all.  It simply worked as is with no special modifications required by TCLib.

About that whole chkstk thing; I recall running into difficulties with that at some point.  It got some mention in various sources I was using.  I'll have to review that later.  Just now I forget.  Getting old too! :(

James C. Fuller

Fred,
  Do you have a c++  array class for use with TCLib not using any STL (vector)?

James

James C. Fuller

Fred,
  I found it. No redim or redim preserve simulation is probably why I forgot.
James

James C. Fuller

Patrice,
  This might be another vector substitute:
http://www.anyexample.com/programming/cplusplus/cplusplus_dynamic_array_template_class.xml
I needed to remove the throw's as we don't have exception handling with TCLib.

James

Frederick J. Harris

Quote
No redim or redim preserve simulation is probably why I forgot

Right.  I just never bothered coding it.  Its highly doable though.

Patrice Terrier

#12
I have been thinking of something based on hidden.....   LISTBOX(s)
i use it very often, for quick array replacement (PlayList) , very easy to add, sort, remove, erase one line/record or a group of lines/records.
I even use 2 or more // LISTBOX to store extra informations, using a leading one to handle them all.
And the good things with it, is that i do not have to mess with all the memory management, Windows does all the hard work for me.  8)

Can do also the same with a hidden ListView, using a specific column for each of the field.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

James C. Fuller

Patrice,
  While the listbox should work fine for strings how would you use it for arrays of structures?
I really think the aedynarray link I posted minus the throws will do fine as a vector substitute for me.
I have REDIM,REDIM PRESERVE as part of bc9Basic. I can use that for multi-dimensional should I need it.

James

Patrice Terrier

For the purpose of the address demo, ListView makes much sense because it is also very common to display a database in table mode :)
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com