Re: Migrating to PODS

2005-05-16 Thread Jerome Chapdelaine
Has anyone tried to modify the PODS makefile (either in managed or non-managed mode) to use Multilink? I have not tried it, but it looks like it could help the segmentation problem. Jerome Erico Franco wrote: Stephen Johnson wrote: 1. Segments in gcc are specified on a per function level. We ha

Re: RTTI option and dynamic_cast

2005-05-17 Thread Jerome Chapdelaine
Hi! The only disadvantages is a bit larger code size and data segment. Some hidden virtual methods are added to all your classes, with a bit of constant data. Be very careful when your app runs without globals. Besides that it works perfectly. Jerome Salvador Buendia wrote: First of all, thank

Re: displaying a text string that is longer then the screen is wide

2005-05-20 Thread Jerome Chapdelaine
Use FrmCustomAlert with the ^1, ^2 and ^3 replacement placeholders. -or- Build a custom modal dialog box with a multi-line read-only text field. The dotted "underline" of text fields can also be removed in the resource editor. If you want to resize your dialog box to fit, you can compute the fie

Re: Num lock issues

2005-06-02 Thread Jerome Chapdelaine
Hi What I did (that works on T-W and T-C) is trap the fldEnter event and if the currently focused field has the numeric attribute set, I post a custom "SetNumLock" event . In response to that event I set the graffiti state. I had to post the extra event because setting the graffiti state in t

How to lock the code segment

2005-06-02 Thread Jerome Chapdelaine
Hi! What is the best way to lock the code resource? I have a background app with callbacks... I've been using this piece of code that seems to work ok. -- MemHandle res1 = DmGetResource('code', 1); UInt16 lockCount = MemHandleLockCount(res1); MemHandleLock(res1); ... DmProtectDatabase() t

Re: How to lock the code segment

2005-06-02 Thread Jerome Chapdelaine
I thought that protecting the database with DmDatabaseProtect would only prevent the database from beeing deleted (and broadcast a sysNotifyDeleteProtectedEvent notification). This does not mean that the code resource will be kept locked if I leave my application and launch another one. I need

Re: HTML

2005-06-09 Thread Jerome Chapdelaine
A while ago I looked at the "help widget" of FLTK. It can render basic html and it would be very easy to port (only the font handling + box rendering if you don't need bitmaps). But it would probably not handle full web pages very well... I would use it only for formatted text. Jerome Domin

Re: RctPtInRectangle returning true incorrectly

2005-06-20 Thread Jerome Chapdelaine
Because in a Palm rectangle you must give the topLeft x-y coord, and the extents (size) of your rectangle, not the bottomRight x-y coords like you seem to be doing. Jerome Pete Dempsey wrote: Hi, I have a list with a custom draw function where I draw a checkbox for each item. I am trying to

Re: PRC that autoupdates iteself

2005-06-23 Thread Jerome Chapdelaine
What we do here is store the database image in a File Stream database, and then use ExgDBRead (to wich we provide a reader function to read the stream) to import it. Jerome Russell Cagle wrote: You can call DmCreateDatabaseFromImage(). The problem with that function is you need the entire P

Re: Re-arranging functions in a code segment

2005-06-30 Thread Jerome Chapdelaine
I am not aware of a such a tool. With careful trial an error re-ordering you can fit everything within a single segment with all calls <32k, but then a slight modification in the source will break everything. So I would suggest that switch to multi-segment instead of spending to much time on t

How to close a resource database with locked segment

2005-07-05 Thread Jerome Chapdelaine
Hello everyone, I have an application that sends a custom launch code to another one as a subroutine with SysAppLaunch. The subroutine is a bluetooth applications that opens the bluetooth stacks, create some sockets, _locks its code segment_ (because it has callbacks) and returns. When a get

Re: How to close a resource database with locked segment

2005-07-05 Thread Jerome Chapdelaine
Ok, my other post may be a bit confusing... here's a more specific example. I want to display my application name (ainRsc) and version (verRsc) in my about dialog. I use DmGetResource to get those. It works correctly. If I open the Palm bluetooth library on a Tungsten E2, with the same code

Re: "memory leak" reported by emulator

2005-07-18 Thread Jerome Chapdelaine
Hello Jeff, I don't know how many small blocks of memory you are talking about, but I've worked on applications with tons of small new/delete, arrays of objects containing dynamically allocated stuff, etc... and never got into any kind of limits. Each and every time I got a memory leaked repo

Re: DmWrite() is not writing the correct string???

2005-07-18 Thread Jerome Chapdelaine
Are you using a string ":" or a char ':'? In CodeWarrior there's an option "PC-Relative Strings" that must be used to make sure that your strings constants are stored in the code segment instead of the data segment. That's what I had to to a while ago because I needed to access a database by

Re: "memory leak" reported by emulator

2005-07-18 Thread Jerome Chapdelaine
I am, it's in a place where none of my other environments have noticed a problem. I'm using CodeWarrior. I'll check into Palm Reporter and see if it helps. Thanks, Jeff Jerome Chapdelaine wrote: Hello Jeff, I don't know how many small blocks of memory you are talking abou

Re: ZLib questions

2005-07-21 Thread Jerome Chapdelaine
Hello Vladan, 1- Zlib deflate/inflate does not store the file information... it is used only to compress a stream of data. The gzip file format uses the zlib deflate/inflate and adds a header to store the file info. 2- No... that's why in the unix world people typically use tar + gzip. But of c

Re: [Help]why Simple SMS repeat crash?

2005-07-21 Thread Jerome Chapdelaine
You can set an alarm (AlmSetAlarm...) that will call your application with a launch code after a few seconds... Jerome Evan wrote: Maybe I can do SMSRegister when 3 seconds after system reset. Then, how to let my app wake up after 3 seconds? Anyone knows? -- For information on using the Pa

Re: simple "Please wait" box

2005-07-28 Thread Jerome Chapdelaine
If you only need a string message / bitmap then drawing manually is by far the simplest solution. If you want to use a real form and the progress manager does not suit you, then you can display it from the resource yourself... call FrmSaveActiveState, FrmInitForm, FrmSetActiveForm, FrmDrawForm

Meaning of EventToArmDataNotProcessed exception?

2005-08-08 Thread Jerome Chapdelaine
Hi everyone, One of my clients got a « Event 68k.c, line 1057 EventToArmDataNotProcessed, event :12337 » exception on a Tungsten E2. I have not been able to reproduce it, of course... The event "12337" (0x3031) is not part of my code. I do have a bluetooth connection active in a shared lib t

Re: Data segment exceeds 64K

2005-08-16 Thread Jerome Chapdelaine
Exception handling really consumes a lot of data segment (with the zero overhead technique used in CodeWarrior)... If you don't need to throw complex objects and don't need to have the stack objects destructors called, then you might consider switching to palm native exceptions. That's what I d

Re: OS 5 is messing up certain numbers

2005-08-17 Thread Jerome Chapdelaine
Casting to integer truncates the fraction part and almost never gives the expected result. If you want to "isolate" the digits you can round with something like: long y = (long)(x*1 + 0.5); For positive integer it will usually gives the expected result. Like others said, it is all related

Re: How to accomplish a background application on palm platform

2005-08-19 Thread Jerome Chapdelaine
I would add this depends on what kind of background processing you need. If you need a simple task to be done from times to times you can use alarms. But if you think about setting the alarm every 30sec, verify that it does not turn on the screen or this would kill your battery life. Jerome

Re: Table Column Resizable

2005-08-22 Thread Jerome Chapdelaine
Catch the penDown event in your form event handler and detect if it is in the rectangle of the table and on one of your column divisions. If so, do all your drag / resize processing and return true (event handled). If penDown is not on a column division, return false from your event handler an

Re: Threads -> Protothreads

2005-10-07 Thread Jerome Chapdelaine
Hi, Having multiple threads in an application is not that difficult using a modified event loop. We don't really need help from the OS for that (although OS services for waiting for a signal or event is helpful for power consumption, compared to active polling/looping). The most difficult ta

Re: GMT convertion

2005-11-14 Thread Jerome Chapdelaine
hi! Logan is correct. This is the piece of code I use to convert local time to UTC using the API. Good luck. Jerome . ::DateTimeType dt; UInt32 seconds = TimGetSeconds(); if(PrefGetPreference(prefVersion) >= 9) { Int16 tz = PrefGetPreference(prefTimeZone) & 0x;

Problems using FrmNewLabel in a notification handler

2005-01-21 Thread Jerome Chapdelaine
Hello everybody, I'm trying to dynamically create controls in a notification handler. I have an application that display a standard form, then broadcast a custom notification to tell all registered app to create their controls (like a plugins mecanism). I'm stuck because FrmNewLabel does not w

Re: Problems using FrmNewLabel in a notification handler

2005-01-21 Thread Jerome Chapdelaine
Precision: It works on PalmOS 4 (Tungsten-W Emulator) It does not work PalmOS 5 (tried on 5 and 5.2 Simulator). hum... Jerome Jerome Chapdelaine wrote: Hello everybody, I'm trying to dynamically create controls in a notification handler. I have an application that display a standard form,

Re: DbCache on TX extremaly low

2006-02-10 Thread Jerome Chapdelaine
My observation is that although the DBCache would drop to <100kB free it was like you said very stable. We had to use a lot of tricks to make our app works on the E2 but on the TX it is rock solid. Jerome Jan Slodicka wrote: Another observation - this time more funny than dangerous. The lo

Re: 1-bit bitmaps and backgrounds

2006-02-27 Thread Jerome Chapdelaine
Hi! 1-bit bitmaps are not black and white... they are "foreground and background" colors. Here's a quote from the WinSetDrawMode() / WinDrawModes enumeration taken from PalmOS Reference: -- 1-bit sources (bitmap, text, and patterns) that don’t have a color table are given a color table where e

Re: Changing name of VFS-stored DB

2006-03-02 Thread Jerome Chapdelaine
If you want to change it on the fly, use ExgDBRead and provide your own callback that will read the file from the VFS. In that callback alter the first 32 bytes to the dbname you want. You can of course modify the creator / type / everything you want. Jerome Douglas Handy wrote: Luc Le Bl

Re: saving events and playback later

2006-03-02 Thread Jerome Chapdelaine
Maybe because many controls only use the pendown event, and then loop and poll the pen position with PenGetPoint function. If you only simulate the events, then the PenGetPoint will say the pen is not down and possibly never activate the control. Jerome PalmDev wrote: I'm trying to save t

Re: Colored Text

2006-03-24 Thread Jerome Chapdelaine
Are there any 2bit (4 gray level) or 4bit (16 gray level or 16 indexed color) devices? If not, then maybe inColor = (depth > 1); (or >2, or >4)... Jerome -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Re: Querying a database

2006-04-03 Thread Jerome Chapdelaine
Hi! I would suggest packing in larger records (like others have suggested), and then use your own binary search to find your record (assuming of course they are pre-sorted). If your data is read-only and all records have the same size this is not difficult to implement. good luck. Jerome

Re: sending '\x00' over a udp socket

2006-04-03 Thread Jerome Chapdelaine
Do not use zero-terminated strings... ! Use a buffer and keep track of the number of bytes in a separate variable (like a good old Pascal string!). Jerome Troy Lokitz wrote: When I try to create a string with the '\x00' hex value, it treats it as a null, so when I try to create the follow

Re: I need to know what type of UI element versamail uses

2006-04-07 Thread Jerome Chapdelaine
Hi, If you can extract a copy of the .PRC to your computer, use PRCExplorer to browse its resource. good luck Jerome Andrew wrote: hello, I am curious as to what UI element type VersaMail uses in its mail display. Is it a list or a table, or neither? It looks exactly like what I want to

Re: I need to know what type of UI element versamail uses

2006-04-07 Thread Jerome Chapdelaine
The MultiMail.prc that comes with the T-W simulator uses a table in the main form resource. Here's part of the PilRC code generated by PRCExplorer for tFRM - 1000. TABLE ID 1013 AT (0 18 160 122) ROWS 11 COLUMNS 3 COLUMNWIDTHS 8 9 144 TABLE ID 1014 AT (0 18 160 122) ROWS 8 COLUMNS 3 COLUMNWI

Re: Converting graphics for Palm devices

2006-04-18 Thread Jerome Chapdelaine
Is your palm running with screen depth 8bit (with palette) or 16bits? In my app I check the screen depth and if it is 8bit or less, I try to switch it to 16bits. The WinScreenMode function will help you with that. Jerome marcbolh wrote: I have applicantions/graphics for several devices t

Re: overriding operators in c++

2006-04-19 Thread Jerome Chapdelaine
Also make sure that your copy constructor and operator= are properly implemented if you want to use your class like a native type. Jerome Ben Combee wrote: Don't return a reference to myclass, just return a myclass. You usually only return references when you are returning one of the origi

Re: "Offset passed out of block" on TblSetLoadDataProcedure

2006-05-02 Thread Jerome Chapdelaine
Hi. From the PalmOS4 source, this error is in FldSetText method when the 'offset' param is greated than the size of the 'textHandle' memory block. Do you call FldSetText somewhere in your code? Or FldSetTextHandle? Jerome [EMAIL PROTECTED] wrote: I'm attempting to create a LoadDataProcedu

Re: decompressing gzip over http using zlib

2006-05-02 Thread Jerome Chapdelaine
Hi. This is the code I use to decompress a memory buffer that contains a gzip-encoded buffer. You have to skip the gzip header, and use a negative value for windowsize (something about bypassing expected zlib header). zs.next_in = static_cast(pRecord) + 10;// skip gzip header zs.avail_in

Re: Programatically disabling "Write Anywhere on-screen"?

2006-05-04 Thread Jerome Chapdelaine
Here's another one: on the Tungsten-W, how to change the "Automatically let the network update the time" setting in the Date & Time panel? I must keep this one disabled because a cell network provider here sometimes sends the wrong timezone, Thanks! Jerome Luc Le Blanc wrote: [EMAIL PR

Re: Help needed regarding HTML Viewer for Palm

2006-05-05 Thread Jerome Chapdelaine
For very simple html I've been doing some tests in the past with a port of the FLTK Fl_Help_View code and it was working well. Jerome Kishor Bhushan wrote: Hi I want to know is there any facility for HTML viewer in palm. If yes how If no then alternatively how can i view the HTML pag

Re: Errtry and ErrCatch

2006-09-01 Thread Jerome Chapdelaine
As far as I know, no function in Palm SDK will ever throw exceptions... all errors are signaled by special return values. After that, feel free to throw / catch exceptions based on those return values. Jerome Bharathi Kumaraswamy wrote: But when can I use ErrTry and ErrCatch statements? Can I

USB debugging on Treo650 and TX

2006-11-02 Thread Jerome Chapdelaine
Hi! Is USB debugging on the Treo650 and TX supposed to work using CodeWarrior 9.3? I've used USB debugging with success in the past (with T-W and E2 devices) but now with the Treo and TX I always get a "Connection attempt failed. Please try again" from CW. I can hotsync with USB so cable / co

Re: USB debugging on Treo650 and TX

2006-11-02 Thread Jerome Chapdelaine
Thanks! It works! I know remember installing the Palm Desktop from a Treo650 CD this summer... ;-) Jerome Ben Combee wrote: On 11/2/06, Jerome Chapdelaine <[EMAIL PROTECTED]> wrote: Hi! Is USB debugging on the Treo650 and TX supposed to work using CodeWarrior 9.3? I've used US

Re: Howto: Proper sequence of calls to iterate thru .pdb records?

2006-11-30 Thread Jerome Chapdelaine
The only thing I would check is if you have around 32k records, and your CW is set for 16bit integers, then your loop counter 'rec' will probably not behave correctly when you get to the 32k'th record. Jerome Lynn Allan wrote: I've got a 4mb .pdb file comprised of about 31,100+ records. I

Any known bugs in TimGetSeconds() or TimSecondsToDateTime()?

2007-04-17 Thread Jerome Chapdelaine
Hi, we have an custom app used on Tungsten-W and Treos that logs the current date/time using TimGetSeconds() followed by TimSecondsToDateTime() to extract the date and time components. Sometimes we get a wrong result (off by as much as a couple of days, but not totally corrupted). Of course

fnav resource in overlay databases

2007-11-27 Thread Jerome Chapdelaine
Hi, I've been using fnav resources with good results so far, except with overlay databases for multi-language support. The fnav resources are copied in the overlays with their corresponding forms (verified with PRCExplorer) but although I get the correctly translated form, no focus ring appea