Recent Posts

Pages: [1] 2 3 ... 10
1
Easy Code IDE 32/64-bit / Raw data and files
« Last post by rsala on Today at 06:52:50 PM »
Raw data and files

The Easy Code resource editor has been made to allow the user to create all kind of resources and, at the same time, make it as easy as possible, but being limited for the syntax of the resource compiler (RC.EXE). As a result, you can add accelerators, menus, images (icon, cursor or bitmap), strings, a version resource and Raw Data.

A raw data resource permits the inclusion of binary data directly in the executable file and it specifies one or more integers or strings of characters. Integers can be specified in decimal, octal or hexadecimal format. RC compiler does not automatically append a terminating null character to a string. The string is a sequence of the specified ANSI (byte) characters unless explicitly qualified as a wide-character string with the L prefix (Unicode).

The block of data begins on a DWord boundary and RC performs no padding or alignment of data within the raw-data block. It is the programmer's responsibility to ensure the proper alignment of data within the block.

The following are some examples of raw data:

10,20,30,40                     Four integer (16-bit) values.
"A","B","C","D"               Four byte (8-bit) values.
"Readme.txt\0"              Double-quoted text to specify it is a string (null-terminated).

L"Readme.txt\0"            Unicode null-terminated string (L means Unicode, otherwise it is ANSI)
"\r"                                   A control character (8-bit) correspondig to ASCII 13 (<Carriage Return>).
0x40                                 A Hex integer (16-bit) value corresponding to 64 decimal.


This raw data has to be typed exactly the same in the Easy Code Raw Data resources window so that RC does not generate any error at compile time. In fact, raw data resources are usually used for binary data or, eventually, for ANSI strings, as strings defined in a String table are always Unicode.

In some cases, it would be interesting to add a whole file as a resource. As the RC compiler has no way to do that, Easy Code has a user-defined resource to accomplish this task. User-defined resources must have a value greater than 255, so Easy Code has the RT_FILEDATA reserved word (value 256). In the resource editor, adding a file is done in the Raw Data resources window. So, how does Easy Code know if it is raw data or a file name? It just looks in the Res folder for a file having the typed name. If it exists, an RT_FILEDATA resource will be created. To find it at run time, you will have to specify RT_FILEDATA in the 'ResourceType' parameter of the FindResource function. On the other hand, if there is no file in Res folder having the typed name, a normal RCDATA resource will be created and it will be found as RCDATA type.

Note that a file name could be treated as normal raw data if the file it specifies is not found in Res folder, but if it was entered without double quotes, the RC compiler will generate an error. On the other hand, if the file name is double-quoted, it will be treated as a Raw data string (RCDATA type).

Ramon
2
Miscellaneous Projects / Re: Ascii chart
« Last post by jj2007 on Today at 05:14:06 PM »
Works fine, and there is nothing wrong with your coding style :t
3
MASM64 SDK / Re: MASM 64 Desktop mini app.
« Last post by caballero on Today at 04:56:24 PM »
Hello. Works well on W7 64 bit. It creates a window without frames with WS_VISIBLE+WS_POPUP and paints the desktop with PaintDesktop and the WinExec for the menu entries.
4
Miscellaneous Projects / Ascii chart
« Last post by jimg on Today at 12:57:36 PM »
With the last update to windows 10, the graphic ascii chart I've used for years as a quick reference is all fuzzy.  Rather than try to fix the problem, I just made a quickie out of an old program to show an ascii chart in a toolwindow.   Released to the public domain for all uses public and private.
All menus are in the right-click context menu.  Maybe you can get some use out of it, even if it's only a laugh at my coding style :)
5
MASM64 SDK / MASM 64 Desktop mini app.
« Last post by hutch-- on Today at 12:31:01 PM »
The attached zip file contains a small working app that functions as a simple desktop that has programmable menus that can be set in a plain text file. I have used this app as a test piece to develop the 64 bit version of the programmable menus that I use in my editors and it seems to be working well at the moment. It splits the calling of programs between the old but well behaved "WinExec()" and the newer but limited "ShellEcecute()". WinExec handles command lines for exe/bat files with no problems where "ShellExecute()" will run non executable files. It supports HLP, CHM and PDF extensions.

The 9k icon blew the size out to 21k but I doubt it will break any hard disks in terms of storage space.  :P

Tested only on Win10 64 but it should run on Win7/8 64 as well.
6
The Soap Box / MOVED: Data Structure Choice
« Last post by hutch-- on Today at 03:14:26 AM »
7
The Workshop / Re: Data Structure Choice
« Last post by cman on Today at 02:13:52 AM »
I think I'm just going to store my structs in an array and then store the array index or struct address in a hash table so that I can match multiple keys to a single data set while using minimum memory. I've seen solutions using multiple hash tables , but I think using a data structure to store the unordered data and a table to find the data items would be easiest ...
8
The Campus / Re: Viewing Animated GIF files
« Last post by caballero on May 27, 2017, 11:53:43 PM »
> I have noticed that it size increases with no reason when the gif is changed.
For that, it is convenient to erase the objects before loading the new gif, as we have done in the resize section. With that it gets quite accurate. I left it to the good reader :t
9
The Campus / Re: Viewing Animated GIF files
« Last post by jj2007 on May 27, 2017, 10:28:13 PM »
Well, it is good to read the docs :lol: better use "GdipDisposeImage"

Yes, RTFM is always a good idea. But it's much easier if you know that the culprit is GdipDeleteGraphics in line 301 :P

You still have 3*InvalidParameter to solve, but these calls are apparently not necessary.
10
The Campus / Re: Viewing Animated GIF files
« Last post by caballero on May 27, 2017, 10:21:48 PM »
No, I'm not able to change the f**cking file. Well, it is good to read the docs :lol: better use "GdipDisposeImage" for delete the gdi+ bitmap than "GdipDeleteGraphics" :greenclp:

Well, here it is the new working version. Now the mem size decreases when the window is aminorated. Nevertheless I have noticed that it size increases with no reason when the gif is changed. :icon_rolleyes:
Pages: [1] 2 3 ... 10