Re: Debugging over USB
I think I remember USB debugging not working in CW8. It works fine in CW9. Brad Jake Wobbrock wrote: Hi all, I'm trying to debug on a Tungsten T3 while it sits in its native USB cradle. I'm using CodeWarrior for Palm OS 8.3 and I have Palm desktop (hotsync, etc.) version 4.1 installed. I've seen on Google groups that a lot of people have trouble debugging from CodeWarrior on the device itself over USB, but most of those posts were from 2002 and 2003. I'm wondering if Metrowerks has made any progress since then on supporting debugging on devices over USB. I hope the answer isn't that I need CodeWarrior 9 instead of 8... The problem I keep getting is that CodeWarrior cannot connect to my device. This only happens for a USB device, not a serial one. Also, I copied the USBPort.dll from the Palm\Bin directory into the CodeWarrior\Bin directory, since this was recommended in another post. The one I copied was a newer one, version 4.4.0.0, instead of 4.1.0.0 which was already in the CodeWarrior\Bin directory. Until I did this, I couldn't ever connect at all. Once I did, I was able to connect, but only once in a great while. Thanks in advance. Jake -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Arrays/Pointer in Palm OS!
Your array is 300K in size. PalmOS only supports memory blocks 64K unless you use feature pointers or such. Keyur Patwa wrote: Hi guys, Actually I am trying to declare an array like UInt8 grayedPixel[307200]; And I am getting the following linking errors, Link Error : __RuntimeModule__: Near data segment is bigger than 64k. Link Error : __RuntimeModule__: Near data segment is bigger than 64k. Link Error : PalmOS_Startup.cpp: 'MTWK::__LoadAndRelocate__(unsigned char,_opaque*)' 16-bit data reference to '__segtable__' is out of range. I think I should use pointer but I don't know how to iniitlize a pointer in Palm os! Its very urgent, can someone please reply soon? Thanks, Keyur -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: What's best: MemMove or struct = struct ??
I would imagine that struct = struct would be a bit more efficient. MemMove has to handle overlapping memory addresses, so there is going to be a little bit of overhead for that. Also, MemMove is a system trap and calling OS functions consists of setting up the environment (for the stack frame, return address, giving control to the OS, etc...). That is why I think it would be more efficient just copying your structure in a loop (i.e. struct = struct ). Brad Regis St-Gelais wrote: This is a repost from March 10, I did not get any answer, maybe this time I will be lucky. With CW 9.3 in C, Let say I have a typedef of a struct (fooStruct) I declare 2 structs: fooStruct udsStructA; fooStruct udsStructB; I can copy the struct content with this: udsStructA=udsStructB; the assembly looks like: 0068: 41ED lea udsStructB,a0 006C: 43ED lea udsStructA,a1 0070: 303C 0359 move.w#857,d0 0074: 22D8 move.l(a0)+,(a1)+ 0076: 51C8 FFFC dbra d0,*-2 ; 0x0074 and with that: MemMove(udsStructA,udsStructB,sizeof(fooStruct)); the assembly looks like: 007A: 4878 0D68 pea 0x0d68 007E: 486D pea udsStructB 0082: 486D pea udsStructA 0086: 4E4F trap #15 0088: A026 sysTrapMemMove My assembly knowleage date from the 8080, 6802 days so I am a bit out of date on 68K assembly ;-) Which way is the best way to do this? Thanks -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Unknown error code of VFSFileOpen
Sounds to me like you have a memory leak somewhere. Decimal error 259 is memErrInvalidParam (invalid param or requested size is too big). Brad DongDong wrote: I have an application with a list of images read from VFS memory card. There are 12 images available on a screen. There are two buttons Go to top and Go to bottom to jump to first 12 images or last 12 images. It works properly at first. But after I click Go to bottom and Go to top alternatively continuously, An error occurs at eighth click on Go to top. I've checked the error code returned, just after calling VFSFileOpen, is 259. I tried to check what's the error but not any of the following. It happeneds at both my Zire71 and Simuator 5.2 at same location (i.e. the eighth click on Go to top). expErrCardReadOnly: expErrNotOpen: vfsErrBadName: vfsErrFileNotFound: vfsErrFilePermissionDenied: vfsModeExclusive: vfsErrVolumeBadRef: expErrUnsupportedOperation: expErrNotEnoughPower: expErrCardNotPresent: expErrInvalidSlotRefNum: expErrSlotDeallocated: expErrCardNoSectorReadWrite: expErrCardBadSector: expErrCardProtectedSector: expErrStillOpen: expErrUnimplemented: expErrEnumerationEmpty: expErrIncompatibleAPIVer: vfsErrBufferOverflow: vfsErrFileGeneric: vfsErrFileBadRef: vfsErrFileStillOpen: vfsErrFileAlreadyExists: vfsErrFileEOF: vfsErrVolumeStillMounted: vfsErrNoFileSystem: vfsErrBadData: vfsErrDirNotEmpty: vfsErrVolumeFull: vfsErrUnimplemented: vfsErrNotADirectory: vfsErrIsADirectory: vfsErrDirectoryNotFound: vfsErrNameShortened: Any advice and suggestion. Looking forwards to any help. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Cobalt Question
Is the data manager memory still write protected? If yes (which I think it is), is there anyway to lock down a section of it for direct write access (analogous to a memory mapped file in windows)? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
PODS with existing eclipse
This has probably already been asked, but can PODS exist on a system that already has eclipse installed with the standard JAVA and JAVA debug perspectives? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Cobalt porting: No longer single prc for all OS versions
But in my line of work, who cares if meet some ideal of expert? I need to develop solutions, not impress my users with my OS knowledge. I can get down and dirty with the best of them, but I prefer to have the development tool/environment do it for me. Anyways the .Net Framework is basically just another OS you program for, the same way you program for the JVM. You need to understand it to develop quality applications for it. Jamie I agree that using a tool to make your life easier and your time to market faster is a good idea. However, I don't think you can compare a framework that wraps an operating system to an operating system (i.e CF .NET to PalmOS 6). It has been my experience, and I imagine yours too, that when a developer gets stumped on a problem (in any framework) and they don't understand the inner workings of the OS (or whatever is being wrapped), they struggle to come up with an acceptable solution. Situations like this lead to hacks and bugs and usually a break down in design. My original point is this. PalmOS, at an operating system level, is easier to understand than Windows (whether it be PPC or XP). Palm did a good job of keeping simple. Kudos to MS for their .NET framework. It makes things easier, but, it is not an excuse to not understand how the OS works. Trust me, I love the fact that I can bang out two million lines of code by writing 6 function calls in VB.NET! Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Private structType in Cobalt
Ben Combee wrote: I fully expect the in-memory structures for forms and their objects to change a lot in the future on Palm OS Cobalt. For example, PalmSource has indicated that there would be some kind of user interface refresh in a future release. To do that, it's likely that a lot of the internal state of a form would need to have a different format. I have not delved deeply in to the new OS (yet). However, I hope that PalmSource does a better job of providing functions to get at some of the attributes of their private structures. I don't know how many times I have wanted to see if an attribute was set in field (such as right align or left align) and would actually have to break the best practices to check the flag. Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Private structType in Cobalt
Ben Combee wrote: You could always do that using FldGetAttributes/FldSetAttributes -- the FieldAttrType structure isn't part of the protected set. According to the OS 5.0 documentation that I have installed on my machine, FieldAttrType is part of the protected set. At least the warning is at the top of the page describing the struct. May just be a documentation error. Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Cobalt porting: No longer single prc for all OS versions
Keith Rollin wrote: In what way are we not being open? I thought that we were very open about our direction and upcoming releases at the PalmSource conference, which has continued through to answering questions on this and other forums. Microsoft will throw a beta of an operating system/SDK/Framework (.Net being my example) out to the development community years before it is actually officially released. I remember playing with .NET when it was in it's infancy. It wasn't very stable, but we got familiar with it long before we ever used it. That is the type of openness that a development community expects. Hell, we couldn't even squeeze a data out of PalmSource for when the new tool chain was going to be downloadable. Luckily, there are a million people on this forum and they continually checked the website for the link to become available. Should those of us that did not make the conference be left in the dark? Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Cobalt porting: No longer single prc for all OS versions
Richard Coutts wrote: There's been many a company that's been squashed like a bug by Microsoft by releasing their technology before they had to, or by not protecting their property sufficiently -- Microsoft is an *extremely* preditory company. I really don't know why Palm is so protective with their releases, or if Microsoft has anything to do with it. But with an 800-pound gorilla like Microsoft around, that likes to steal bananas from others, I don't blame them. Pre-Releasing a development environment and protecting intellectual property are two completely different animals. You are right by saying that a company should not release thiner product in to the market if it is not protected properly by copyrights and patents, etc... However, PPC already does most of the things that PalmOS does. PalmOS is playing catchup in this aspect. This fact alone should motivate them to entice developers by throwing them a bone every now and then. I would have been happy with some preliminary documentation to help understand we would need to do to take advantage of the new OS. Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Cobalt porting: No longer single prc for all OS versions
Keith Rollin wrote: At 5:36 PM -0700 3/1/04, Brad Figler wrote: Keith Rollin wrote: One advantage that Microsoft has over lots of other companies is that it can afford a higher level of support. It has its hosted newsgroups, MSDN subscriptions with incidents levels that allow you to submit questions, MSDN magazine, several conferences per year, outside consultants like Wintellect, authors like Jeffrey Richter, etc. With all of that, it can provide support for early releases. For us, while a leader in operating systems an applications for mobile devices, providing that level of support is not yet reachable. And unless we can support a pre-release, I don't think it would be responsible for us to provide a pre-release. Don't get me wrong. I am not saying that you guys should be just like Microsoft. God knows we don't need another one of them running around here. They just do a good job of taking care of their developers. Plain and simple! If you feel you're being left in the dark, it's safer to assume that it's a mistake, an oversight, or that information will be coming soon and that you need to be more patient. :-) Engineers are usually very patient, however, all that goes out the door when waiting to get our greedy little hands on a new toy to play with and master. We hate the word soon :-) Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Cobalt porting: No longer single prc for all OS versions
Alex wrote: Just reading the overview of Cobalt makes me wonder whether it is a good time to port to PPC. If one needs to change that much, might as well picking up a new platform. And I thought OS 4 to OS 5 was painful. The only thing would make this worse is that if I paid for attending DevCon to find this out. PPC is still a more complicated Operating System than PalmOS. The guys at PalmSource have done a good job in keeping it simple. Jumping to the PPC platform is probably ten fold the work than porting to the NEW OS. Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Cobalt porting: No longer single prc for all OS versions
Jamie Macleod wrote: It depends. If your targeting the CF .Net it is pretty easy, especially if you use VS .Net already. If you want to target PPC natively it is a little more difficult. Yes, Microsoft did a good job with the Compact Framework which makes it much easier to get things done. However, programming using the framework hides a lot of the operating system details. Just like MFC. I can't count on my fingers and toes how many people I have met that claim to be expert windows programmers and don't even know what RegisterClass() or RegisterClassEx() is used for. But they certainly know to put their initialization code in CMyApp::OnInitInstance(). Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Palm OS Developer Sute - Now Available ?
palmsource *will* attempt to hide the command line interface from you within their developer suite - so, stupid windows users should be happy. (stupid as in dont want to think for themselves a bit) Funny, I am a windows user, and I have used ANT to build some of my Java programs (and TiniAnt for that matter). I also wrote an automated build environment using CW COM interface that allows our QA department to submit build requests through a web interface. So, why am I not thinking for myself? Actually, being a windows user makes you think all of the time. Everyday, when my XP box simply forgets how to resolve host names, I think to myself Why does this happen to me every day?. Then I reboot and continue to read these religious debates about development tools! So, uh, how about the new developer suite. Is it available yet? Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: What are you using to create/edit bitmaps and icons?
Paintshop Pro (Jasc Software) is a decent graphics package. I don't think it is that expensive either. The old version I have was about 50 bones! Brad RVRoadie wrote: Tried MS Paint. left me wanting. Any suggestions for low cost alternatives? Thanks -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: MemHandleResize
This is taken directly from the Palm OS Programmer's Companion (volume 1) size field (3 bytes). This three-byte value describes the size of the chunk, which is larger than the size requested by the application and includes the size of the chunk header itself. The maximum data size for a chunk is slightly less than 64KB. There are ways around this size limitation. You can download the limited OS source (from PalmSource) and see for yourself just how to get around it. However, it will cause problems with syncing on most devices. Brad Fruber Malcome wrote: Why does MemHandleResize fail when passing a number larger than 65K, eventhough the parameter supports a UInt32. I assume this only because, instead of getting a memErrNotEnoughSpace, I get an error saying memErrInvalidParam. I know that the handle is ok, since I use it with smaller numbers with no problem. I also only see this error when using a number larger than 65535. Any Ideas? thanks - bill -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: LIST Object and Setting font
In your list drawing callback, use FntSetFont then draw what you need to using WinDrawChars or some variant of that. That should use the current font. Alternatively, you could call LstGlueSetFont(), but I think that only works in OS 5 and up. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: LIST Object and Setting font
Fruber Malcome wrote: Well the LstGlueSetFont worked great - thanks, I'm not sure why the other method didn't work. It is very possible that the internal list code set the font ID to the font configured in the resource and then restored it after your callback. I normally do what you suggested yourself, and set the ID in the callback. thanks - bill -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: FrmPopupForm - FrmReturnToForm/FrmGotoForm
I believe the problem that you are having is due to the fact that the field destroys the attached memory handle when the form is closed. To solve the problem, when the user selects apply, call FieldSetTextHandle( fieldPtr, NULL ) to un-associate the field memory with the memory handle you had passed in originally. This will keep the form from destroying your memory handles during its destruction. Brad Gerda Shank wrote: I am an experienced C Programmer, but not on the PalmOS platform. Right now I am having trouble with a modal form that I am displaying with FrmPopupForm ( savebehind). I set a number of fields on the popup form to the values that already exist. The user can modify them and apply the changes or cancel. When the popup form returns to the previous form with FrmReturnToForm, the values that were written in the fields before display are now garbage on the underlying display. I tried doing FrmEraseForm, FrmDeleteForm on the popup form with no effect. I also tried doing a FrmUpdateForm to the underlying form with no luck. The memory for the fields is being released, there are no memory leaks detected. I tried FrmEraseFld with no effect. If I switch to doing FrmGotoForm instead of FrmReturnToForm, the garbage on the underlying form is cleared, but with a noticeable flicker (in POSE). The garbage also occurs on real hardware. Is there something that I'm missing? Gerda Shank -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Memory Fragmentation
Regis St-Gelais wrote: Second, you can defragment the memory using the api call: MemHeapCompact(MemHeapID(0,0)); MemHeapCompact(MemHeapID(0,1)); According to the documentation (API docs) MemHandleNew() and MemPtrNew() call MemHeapCompact() and you should not have to do it yourself. However, I am not sure if BmpCreate() calls MemPtrNew() or MemHandleNew() but I imagine that the underlying memory management would infact call this if the heap was fragmented. Just a thought! Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Newbie
If you have experience programming in C/C++ then start with the programmers volume 1 and possibly 2. Programmers volume 1 gives you a great overview of how the O.S. works. Volume 2 tackles communications. You can get them from palmsource.com (I think you need to register first ). If you don't have any experience with C/C++ then you might find volume 1 and 2 interesting, but you will probably struggle just copying a string in to a record and storing it in a database (just search this newsgroup archives for Char * and you will see what I am talking about =) ). Brad J. Sanders wrote: I am new to palm developing and am unsure of where to start. Does anyone have any suggestions or is there someone whom I can fire questions to without using the forums? Please reply to me directly and not the forums. J. Sanders -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Pilrc question
All, I have multiple form resources. I want to include bitmaps for buttons that are common to all of the forms. Is there a way for me to share the bitmaps across all of the resources without having to add the same bitmaps to each? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: 40k in one record
To be honest, you can stick 64K chunks in a Palm OS database. However, it requires undocumented techniques, and it's safe to HotSync on most devices. Ben, care to elaborate, or direct *us* to one of your papers =)? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: A bit off topic: Win2K vs. XP professional with Palm dev. tools
My personal opinion is that in general Win2K is a better OS than WinXP. I have numerous goofy issues with windows XP. I have used codewarrior on both OS's and it seems to perform equal on each (actually, I have it running on a build machine that has Windows NT and it works fine). I have also not had any issues with running the emulators/simulators on either OS. Brad Al Gelders [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm planning on replacing my Win2K professional system with a new box. I've got a choice of either OS. Which should I get? Are there any tools that won't work on one or the other? I'm presently using CW 9.2 on Win2K and noted that at least one of the included simulator read.me's does not list XP as a supported system. Are there any advantages to XP? I've not used it before so I don't know much about it. I'm not trying to start a flame war or the like but could really use the advice since this purchase is imminent. Sorry for the off-topic question. Thanks in advance. -- al gelders [EMAIL PROTECTED] -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
CW producing weird numbers
I have very recently started having problems with the code that codewarrior is generating. The project is a fairly large POL/C++/extend project. I write the following line of code: UInt32 test = 1024 * 1024; and it gets assembled in to the following. 0007400C: 7600moveq#0,d5 This is obviously wrong be casue 1024 * 1024 should be 1MB, not 0. This is happening in the DEBUG and RELEASE versions of the build. The debug version has optimizations turned completely off. One last thing. I put this line as the very first line in PilotMain and I commented everything else out accept for the expanded mode call. Here is the exact code from pilot main UInt32 test = 1024 * 1024; Err error = (wLaunchFlags 0x04) == 0 ? _CW_SetupExpandedMode() : errNone; return error; Test is always zero. Any suggestions? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: CW producing weird numbers
Oh, I should mention, this is CW version 9.2. Thanks, Brad Brad Figler wrote: I have very recently started having problems with the code that codewarrior is generating. The project is a fairly large POL/C++/extend project. I write the following line of code: UInt32 test = 1024 * 1024; and it gets assembled in to the following. 0007400C: 7600moveq#0,d5 This is obviously wrong be casue 1024 * 1024 should be 1MB, not 0. This is happening in the DEBUG and RELEASE versions of the build. The debug version has optimizations turned completely off. One last thing. I put this line as the very first line in PilotMain and I commented everything else out accept for the expanded mode call. Here is the exact code from pilot main UInt32 test = 1024 * 1024; Err error = (wLaunchFlags 0x04) == 0 ? _CW_SetupExpandedMode() : errNone; return error; Test is always zero. Any suggestions? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: CW producing weird numbers
UInt32 test = 1024 * 1024; means UInt32 test = (UInt32)((Int16) 1024 * (Int16)1024); Very interesting. The things you are not privy to when you grow up using microsoft products. Thanks for the information, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
CRC table lookup function
I notice that the palm OS has the following function: Crc16CalcBlock() Anyone know what poly they are using as the divisor? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
TungstenC Serial port disabling itself.
All, I am posting this to both the comm-dev-forum and to palm-dev because it has relevant issues both relating to the operating system in general and to the serial communications, specifically on the TungstenC. PROBLEM: Our software communicates with a our own proprietary hardware device via the serial port on the unit. Our hardware is an RF receiver that operates at ~433mhz. When the palm unit is on, it creates a lot of noise, which makes our receiver much less sensitive (with regards to range). To alleviate this, I programmatically turn the unit off for X number of seconds and then I turn it back on, poll our device, and then turn the palm unit back off. This allows our receiver to pick up any transmissions from our outlying RF transmitters while the palm unit is off. The problem is that by doing this, I am agitating the UART in the Tungsten C and it disables itself. Once this happens, I must leave my app (closing the serial port) and renter it (opening the serial port). Eventually, the problem will get so bad that hard resetting the device is the only way to get the serial port to act properly again. [For the software guys] To accomplish shutting the down the palm unit and turning it on. I do the following: Waking up: I register for the sysNotifySleepNotifyEvent. Whenever I receive this notification, I set an alarm for X number of seconds later than the current time. I also register for the sysNotifyLateWakeupEvent. In this event, I simply check to see if the current timestamp is before the next alarm is scheduled. If this is the case, I tell my code to NOT go back to sleep. If the current timestamp is greater than or equal to my last set alarm time, then I assume that the device wakeup based on the alarm and tell it to go back to sleep. Going to sleep: I put the device to sleep using the following line of code. EvtEnqueueKey( vchrPowerOff, 0, commandKeyMask ); My understanding is that by posting this key, the system has a chance to go to sleep properly. After I finish querying our device, I check the flag that I set in my sysNotifyLateWakeupEvent handler, and if it is set, I put the device back to sleep, which causes the cycle to repeats (i.e. I receive the sleep notification, ...). Please let me know if you see something in this logic that would cause the system to go to sleep or to wakeup in an invalid state. [For the hardware guys]: The problem that I am about to explain happens on a TungstenC, but not on an m515. I only open the serial port when the app starts and I close it when the application has exited. In normal operation, if the Tungsten C goes to sleep based on the timeout period set in the preferences and I turn it back on by pressing the power button, my applications starts back up and there is no problem. However, if I put the device to sleep (as explained above) when the device wakes up the serial port works properly for about a half of a second and then seems to disable itself. This is an interesting problem because the time it takes for the palm unit to wakeup, me to poll our device, and to put the unit back to sleep, it appears that everything works fine (the serial port does not have time to display the problem). However, if I programatically put the device to sleep and then manually wake it up by physically pressing the on button, the serial port wakes up for a half seconds (long enough for me to send a couple of requests to our device) and then it disables itself. The reason I say that it is disabled is because the TX line from the unit falls from 5V (idle) to 0V indefinitely. Once this happens, I must exit our application and reenter it (which causes the serial port to close and reopen). I did a lot of testing trying to narrow down the issue, and here is what I found. First, I thought that maybe I was waking the device up and putting it to sleep too quickly. I put a SysTaskDelay( 2 seconds ) in to the code once the device has woken up. This did not fix anything. I also tried closing the serial port when the device goes to sleep and opening it back up when the device wakes up. This did not solve the problem either. I noticed on the m515 that even if I set the alarm to go off 20 seconds after it goes to sleep, the device does not wakeup for about a minute (or on a minute boundary on its internal clock). The TungstenC wakes up immediately. So, I set the tungsten to wakeup after a minute and that also did not fix the problem So, my very long winded question is. Has anyone encountered this problem? And, am I doing something obvious that would cause the TungstenC's UART to freak out? Thanks for taking the time to read this post! Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
CW build order
Is there anyway to have CW build the resource files before compiling the code? I don't like to check in the auto generated header files in to our source tree because they change every time I do a local build. However, I have an automated build script that fails because of this. The build fails stating that it cannot find the defines for all of my resources, but if I build again everything will be fine because the previous build generated the header files for the .rcp files. Anyway around this? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Pilrc question (bug?)
All, I have Pilrc version 2.1.3.0. When I try to open up an RCP that has a font definition in it, I get the following error message. Unable to load [PRC FILENAME] : is not a valid integer value. I removed the font definition, then re-added it, saved the file and tried to open it. I got the same error. Anyone else have this anomaly? Also, I noticed that the splash screen turned from Black to White. Meaning, when I used to open up Pilrc it used to have an inverted bitmap as the splash screen (only on my dev machine. On other machines here in the office it was white). Magically, mine has become white and I have developed this font error. Might have something to do with CW 9.2 beta 2 recently installed. Very confused. Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Indexing in to arrays with code warrior.
Is there some setting in CW to disable arithmetic conversion warnings when indexing in to arrays with unsigned shorts vs. signed shorts? If I write the following code. UInt16 index = 3; UInt32 myArray[ 500 ]; myArray[ index ] = 10; I get a warning message about arithmetic conversion from unsigned short to short. It would seem to me that it would be better practice to allow unsigned indexes vs. signed indexes. Now, all my code looks like this. myArray[ ( Int16 )index ] = 10; I imagine there is no way to disable the warning for just this scenario. Maybe this is more a gripe post than anything else. ~Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Pilrc question (bug?)
Ben Combee wrote: No, you have PilRC Designer 2.1.3.0. PilRC is the compiler, PilRC Designer is the editor. Yes. I have PilRC Designer 2.1.3.0. I really meant to write that. Fingers got ahead of my brain (or other way around). Move your FONT definition to a separate RCP file and add that to the project. PilRC Designer doesn't handle them well in this version, it appears. Is there any problem with going back a rev of the designer instead? -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: bool support in CW.
Layne Lund wrote: Well, MWERKS should be defined as I am using CW. I have option(bool) turned on, so the #define true and #define false should never be 'defined'. I am using c++, so the enum false, true should be skipped (even if MWERKS is not defined). From what I can tell, the intrinsic c++ values for true and false should not be tampered with (atleast not by this code). - Original Message - From: Brad Figler [EMAIL PROTECTED] Date: Monday, September 22, 2003 1:15 pm Subject: Re: bool support in CW. Ben, The only thing I could find came from palmtypes.h // Include the following typedefs if types.h wasn't read. #if __DEFINE_TYPES_ #ifdef __MWERKS__ #if !__option(bool) #ifndef true #define true1 #endif #ifndef false #define false 0 #endif #endif #else #ifndef __cplusplus #ifndef true enum {false, true}; #endif #endif #endif #endif /* __TYPES__ */ I imagine this works as expected. How do you expect the above to work, exactly? The #defines or maybe the enum could be causing the error/warning that sparked your question. Layne -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: bool support in CW.
Ben, The only thing I could find came from palmtypes.h // Include the following typedefs if types.h wasn't read. #if __DEFINE_TYPES_ #ifdef __MWERKS__ #if !__option(bool) #ifndef true #define true1 #endif #ifndef false #define false 0 #endif #endif #else #ifndef __cplusplus #ifndef true enum {false, true}; #endif #endif #endif #endif /* __TYPES__ */ I imagine this works as expected. Do you know if POL defines true and false anywhere? Brad Ben Combee wrote: At 12:12 AM 9/20/2003, Brad Figler wrote: How come I get an implicit arithmetic conversion warning from 'int' to 'bool' for the followoing line of code? bool result = ( 1 == 1 ) ? true:false; I have bool support enabled in the preferences panel. Verify that you aren't using a header file that #define's true and false to integer values. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
bool support in CW.
How come I get an implicit arithmetic conversion warning from 'int' to 'bool' for the followoing line of code? bool result = ( 1 == 1 ) ? true:false; I have bool support enabled in the preferences panel. Thanks, Brad BTW, the line of code could be optimized to bool result = true; Which does not give a warning about implicit conversions. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: serial port simulation
You can tell the simulator and emulator to simulate a serial connection over TCP/IP. I do this to test my software, but I have found it very flaky on the emulator. I don't see any problems on the simulator. ~Brad Dhanashri K wrote: Hello , I want to test my serial application on a new Sony CLIE device running Palm OS 5.0 but I don't have the serial cable with me . Is there anyway by which I can simulate the serial port within the device so that I don't actually need to connect the external device for testing my application ? Thanks regards , Dhanashri . _ Meet Virgo. Fall in love. http://server1.msn.co.in/features/virgo03/ With perfection! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
CW/PiLRC automatic build number?
All, Is there a way to setup an auto incremented build number in pilrc or CW? Any suggestions on managing builds using the CW development IDE? Basically, what I want to do is automatically increment a label/number somewhere in the project that will brand the version of code that gets shipped to our QA team. Preferably accessable by the QA team. Thanks in advance, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
[OT] PrintBoy question
This is a bit off topic, but due to the overwhelming amount of knowledge possessed by the people who monitor this NG I figured I would throw this question in to the mix. We use the printboy SDK to do IR printing in our product. PrintBoy has been pretty responsive to us and has made improvements to the SDK to allow seamless printing (and configuration) without ever leaving our app. With the popularity of WI-FI we decided to do some testing using printboy's own software to print a memo from the palmos memo app. We have had zero luck getting a single page out of our printer. We have combed their website and NG for info and it seems that everyone is having zero success actually printing via a TCP/IP connection. My question is, has anyone actually seen this work? I wonder if anyone knows what the underlying protocol printboy is using to talk to the printer. We have a printer here that has a JetDirect card in it as well as print servers that support LPR (on another printer). Does anyone know how printboy is attempting to connect to the printers? We see our print server's busy light flash very quickly and printboy acts as if it successfully printed the job, however, nothing happens. Again, my apologies for posting this here, but printboy's NG has not responses on posts that are very similar to this one. Thanks, Brad Figler -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Application Icon Sizes
What are the correct icon sizes for ICONFAMILYEX and SMALLICONFAMILYEX? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Application Icon Sizes
Ben/Keith, Thanks, that would explain the new warning about icon sizes that CW 9.2 beta! Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Application Icon Sizes
Ben Combee wrote: At 12:38 PM 8/22/2003, Brad Figler wrote: Ben/Keith, Thanks, that would explain the new warning about icon sizes that CW 9.2 beta! That warnings in PilRC 3.0... my original wizard in V9 got the bitmap sizes wrong, but that should be fixed for new wizard-generated project in 9.2. Where your sizes 25x22 and 50x44 by chance? I am trying to figure out where I got those numbers from. PilRC reported the correct warning becuase my bitmaps are the wrong size. Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Strings and databases
A simple fix would be to declare your struct as follows: typedef struct { char note[ 300 ]; enum ErrorLevel level; Boolean read; } ErrNote; The way you have it, you only allocated 4 bytes for your structure member note. Brad Yogesh Saletore wrote: Hello, I'm fairly new at C for Palm and Palm programming. I need some help with recording strings in databases. Right now I just want it to work, and don't really want to deal with any packing until later. I have an error message I want to store, and it is part of a larger struct: typedef struct { char *note; enum ErrorLevel level; Boolean read; } ErrNote; As you can see, note is a string pointer. Now I have all of my error messages as string literals: lasdkf. I copy them one by one, depending upon which are needed, into a tempory string array: noteText[300]. My problem is getting the data from noteText into ErrNote note.note. In order to use StrCopy, I must reference the *note pointer to some memory block. The initial copying appears to work fine. I then copy ErrNote note to the database using DmWrite, and then the string as well, using DmStrCopy. The error results when I attempt to read back that same string from the database. It seems that it wants to use the same memory block I had first referenced it to, which now no longer exists. Therefore, I receive many memory errors of it attempting to access memory incorrectly. If I leave the memory block as is, locked and don't free it, it works fine, but I then have a memory leak. Can anyone please help me find a way to copy the contents of noteText into ErrNote note.note? Thanks, Yogesh Saletore -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: How to make a socket wait for a conection from a server
You listen if you are the server. You connect if you are the client. I think that you want to connect to an FTP server to initiate connection. Not wait for someone to connect to you. Alexandre Barreto wrote: I'm making a ftp program i saw some exemples of netlib and everthing is going fine untill i got to the datasocket i need to make it listen...so the ftp server can conect on it. after a i send a PORT command but when i call NetLibSocketListen i get a -1 and errP says the erro is netErrParamErr can anyone help me on this? thnx here is the source NetSocketAddrINType A; Err errP; long timeout = SysTicksPerSecond()*25; char *novaopcao; char ip[16]; DataSock=NetLibSocketOpen(libRefnum,netSocketAddrINET, netSocketTypeStream,netSocketProtoIPTCP, timeout, errP); if(DataSock -1){ if(errP == netErrParamErr) WinDrawChars(Erro 2,6,5,135); if(errP == netErrNotOpen) WinDrawChars(Erro 3,6,5,135); if(errP == netErrNoMoreSockets) WinDrawChars(Erro 4,6,5,135); if(errP == netErrOutOfCmdBlocks) WinDrawChars(Erro 5,6,5,135); if(errP == netErrOutOfMemory) WinDrawChars(Erro 6,6,5,135); } if(NetLibSocketOptionSet (libRefnum,DataSock, netSocketOptLevelSocket, netSocketOptSockKeepAlive,novaopcao, sizeof(novaopcao),timeout, errP)-1){ WinDrawChars(Erro SetSocket,14,5,135); } A.family = netSocketAddrINET; A.port = NetHToNS(1024);//_pda_float_to_sdword(porta)); A.addr = NetLibAddrAToIN(libRefnum, 192.168.10.118); //WinDrawChars(porta,sizeof(porta),5,140); if(NetLibSocketBind(libRefnum,DataSock,(NetSocketAddrType*)A,sizeof(A),timeout,errP) 0){ //WinDrawChars(Erro SockBind,13,5,135); if(errP == netErrParamErr) WinDrawChars(SockBind - ParamErr,19,3,125); } errP = NULL; if(NetLibSocketListen (libRefnum,DataSock, 1,timeout, errP)0){ //WinDrawChars(Erro SockListen,15,5,135); if(errP == netErrParamErr) WinDrawChars(SockListen - ParamErr,21,3,125); } _ MSN Hotmail, o maior webmail do Brasil. http://www.hotmail.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Could this code be causing heap memory loss?
Heriberto Delgado Vásquez wrote: Hi! I have an PalmOS C++ application with code like the following: //- void TPrinterUtil::ReadConfiguration() { TPrinterData Data = * new TPrinterData(*dbName); // do something with Data delete Data; } //- I think that actually works, however, normally it is written as follows TPrinterData *Data = new TPrinterData( *dbName ); // Now when you access data you must do Data-memberVariable vs. Data.memberVariable. delete Data; I know that these two lines seem somewhat strange, but the fact is, they compile and run and, apparently, do their work as they should. However, one of my coworkers pointed to me it was easier, and safer, to write that code like this: //- void TPrinterUtil::ReadConfiguration() { TPrinterData Data(*dbName); // do something with Data // Data need not be explicitly destroyed } //- Writing it this way is better from a maintenance point of view but consumes stack space. In this case it probably does not matter, but in the case of the following unsigned char buffer[ 2048 ]; // 2048 bytes on the stack. vs. unsigned char *buffer = new unsigned char[ 2048 ]; // 2048 bytes from the heap and 4 bytes from the stack. it makes a very big difference. At first, I didn't see what could be the difference, but he (my coworker) told me my original code might not be destroying the memory block pointed to by Data, but something else, like system memory or unallocated space. Obviously, that freaked me out completely. I need your opinion on this. Does this code do what my coworker says? If it does, I'm afraid I will need to rewrite most of the code in my application, and that scares me a lot! I think your code works, but it will be very confusing for anyone who comes in after you to change the code. IMHO, you should re-write all of your code where you access memory in this fashion. - Heriberto Delgado ([EMAIL PROTECTED], [EMAIL PROTECTED]) -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Screen Flash???
Are you showing Form A as a modal form? If so, you need to keep the form below it from updating when form A closes? If not, then for some reason form C is still loaded or being loaded and unloaded very quickly. ~Brad [EMAIL PROTECTED] wrote: When navigating between my form A and form B, I get a flash view form C in between the closing of form A and the drawing of form B. Am I supposed to clean this up somewhere? What did I miss? -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Faking relational databases with PDBs
Jeff Ishaq wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brad Figler Sent: Wednesday, August 20, 2003 9:19 AM To: Palm Developer Forum Subject: Re: Faking relational databases with PDBs Jeff, I was using a method similar to yours, but I had the requirement of populating a multi-column list (custom, of course) with data from two different databases. The code was easy to write, but searching for unique ID's must do a linear search because there is no way for the data manager to know if the unique ID's are in any type of order. Hey Brad. From what I gather, you can get much better efficienty than DmFindRecordByID() does when seeking out the record corresponding to a UID, and possibly this would prevent you from having to keep indices as you described in your message. This is one of the possible optimizations I noted in a previous response. Note: This is all information that you can get from reading http://www.palmos.com/dev/support/docs/palmos/FilesAndDatabases.html#998 472 -- but you really want to sign the Palm OS NDAs to get access to DataPrv.h and DataMgr.c, if you haven't already done so. The database header has a record list full of record entry structures. Note that this list may be fragmented across multiple local IDs, as indicated by the numRecords and nextRecordListID elements. Now each record entry contains the UID and attributes of the record to which it corresponds, and from what I've always assumed (though I've never seen this explicitly documented), the record entries are a parallel array to actual records. In other words, record entry #5173 contains the UID and attributes of the record at index 5173 (both are 0-based). So if you are looking for the record index corresponding to a particular UID, you can do better than a linear search of the record list with the information above. DmFindRecordByID() does a linear search. For example, you can do a binary search of the record list (accounting for its fragmentation across multiple LocalIDs, of course) for your UID. Once you've found it, you need to compute how far into the record list your search took you by doing some pointer math, and that will give you the index of the record corresponding to the UID in question. Of course, a binary search isn't always the best choice: for a small # of records, I would probably call through to DmFindRecordByID(), and for a larger # I would then enlist in the help of a binary search. For simplicity, lets just say there is an array of 10,000 entries, each of which has a unique ID, some status bits, and an offset/address to the physical chunk of memory (local ID). Palms documentation states: Each record entry has the local ID of the record, 8 attribute bits, and a 3-byte unique ID for the record. Furthermore, lets say that every time you add a record the UID that is associated with the record is incrmentally higher than the one before it (altough, I do not think this is the case). At this point in time you could perform a binary search and compare UID's. However, when a sort is performed on the database via the data manager sort functions, the array is what is sorted and therefore, the unique ID's move making them out of order. Now, your only option for searching is linear (or sorting then searching). By storing the indices of the record (and sorting via index tables) you can easily and quickly find the record you need. DmFindRecordByID() is sufficient for small amounts of data. It all depends on the application! Hope this helps! -Jeff Ishaq -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Executing code from a 'DATA' type database.
This might sound a little weird, but is it possible to copy code from my PRC in to a database as a record and then execute the code stored in the record? I read something similar to this but using feature pointers instead. Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Act as a USB memory stick?
Why not just build it in to the Palm Desktop? Then it would be comparable to PocketPC active sync which allows you to do just what you described when the device is attached to the cradle. Brad John wrote: Imagine a Palm application controlling the USB port in such a way so that it announce itself as a USB memory to the PC (instead of as a Palm HotSync something). The user would be able to browse/add/delete files on the Palm through Windows Explorer just as any other hard disk. Wouldn't that be a cool application? Anybody on this forum know if the Palm hardware and/or OS will allow such a USB controlling application? /John -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Sorting Records Question (Newbie)
Read the palmOS API reference! Under Data and Resource Manager you will find a list of functions that you can use to operate on palm databases. Look at DmInsertionSort and DmQuickSort for two sorting options. No tutorial required! ~Brad Julio Sejtman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi All. I'm looking for some information like a tutorial where I can have some information about sorting records in a PDB file (on the palm) I'm using PRC-Tools (SDK-4.0) Thanks Julio -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: OS5.2: has SysNotifyBroadcastFromInterrupt WakeupHandler beenfixed ?
Steve Mason wrote: Hi all. I'm stumped by a problem with OS 5.0 where the PACE environment in that OS does not support SysNotifyBroadcastFromInterrupt() and is inconsistent with a serial wakeup handler (set by SrmSetWakeupHandler). (See copy below of an FAQ taken from the PalmSource KnowledgeBase that details this problem.) As far as I can see I need both these functions for my application to function properly. My question is: Does anyone know if the SysNotifyBroadcastFromInterrupt() is supported in OS 5.2? It is not supported in any 5.x release. Also can someone confirm that the interrupt-driven wakeup handler is fully functional in OS 5.2 as claimed in the FAQ. It works on the device, but you cannot test it in the simulator. The simulator is not interrupt safe. I'd appreciate any help on this at all since I don't want to invest in a OS5.2 device if it's not going to work. Thanx Steve PS. Do you know if the latest version of the OS 5 Simulator for Windows can now handle interrupt-driven wakeup handlers? No, not to my knowledge. --- PalmSource Knowledge Base search result Answer ID: 413 Answer Type: FAQ Category: Operating System PACE Serial Manager Date Created:01/31/2003 02:18 PM Date Updated:02/19/2003 12:15 PM Question: Palm OS 5 applications may have trouble running at interrupt time Answer The Palm Application Compatibility Environment (PACE) is not interrupt safe so 68K applications running through PACE may experience problems if they attempt to run during an interrupt. A couple of ramifications of this are: 1) SysNotifyBroadcastFromInterrupt is non existent through PACE in Palm OS 5. Developers should check the OS version before they attempt to make this call. 2) Serial Wakeup Handlers set with SrmSetWakeupHandler may work inconsistently under different versions of OS 5 and will not work at all via the Palm OS 5 Simulator. In general, developers should avoid using serial wakeup handlers in OS 5. **If you do attempt to use wakeup handlers in an OS 5.0 environment note that they will only work while the application that set the wakeup handler is still active. This is fixed in OS 5.2, but the wakeup handler itself should be stored in a memory location separate from the application (such as copying the function into a FtrPtr and setting the wakeup handler to this FtrPtr). For example: //The size of the handler function can be calculated by subtracting the memory location //of the handler function from the next function in your code resource. sizeOfPatch = (UInt32)((UInt32)FunctionAfterHandler- (UInt32)HandlerFunction); //allocate a FtrPtr the size of our handler and then copy it in. FtrPtrNew(appFileCreator, ourFuncFeature, sizeOfPatch, funcP); if (funcP) { //copy callback function to the above address. DmWrite(funcP, 0, (MemPtr)HandlerFunction, sizeOfPatch); } -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Question about DmWrite
Does DmWrite handle overlapping memory? I have an array stored in a record and I want to move half of it to insert an item in the middle. I do not want to move each element one at a time because of the overhead to check the bounds. Can I use DmWrite to move memory or do I need to make a copy of it and then write it back offset by 2 (the size of my array elements)? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: C++ virtual functions
I am pretty sure that a vtable entry for this function will be created. This is due to the fact that once a function is declared virtual, it is always virtual in all derived classes. I don't think there is an exception for pure virtual function declarations, but I am not completely positive. I compiled a quick little test using visual studio and derived a second class from DerivedClass and add() is definitely treated as a virtual function. This may differ from GCC. A vtable in general won't be that large unless you have many virtual functions. The table only stores the addresses for each virtual function and they are probably 4 bytes each. CodeWarrior seems to have another 8 bytes per vtable that store other information as well. So, if your base class has 10 virtual functions and you derive 4 classes from your base class you are consuming right around 160 + 32 = 192 bytes. That is not that much overhead. I have a project that uses classes and a fair amount of virtual function and it runs fine on an m500 with 8mb of memory. ~Brad L.M. Fridael [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Are there any hidden costs to using virtual functions in C++ classes using the PRC tools? (I know about the GCC compiler and linker switches to disable exceptions and RTTI.) I know that polymorphism requires an in-memory table to ensure that the correct functions get called at run-time (late binding) and that this eats into the available heap size. However, I want to use pure virtual functions in my classes solely to specify a contract that subclasses must abide to. I will not use base class pointers, only pointers to non-abstract classes. Example: --- class BaseClass { protected: int a; public: virtual void add(int a) = 0; // Pure virtual function }; class DerivedClass: public BaseClass { public: DerivedClass(int a) { this-a = a; } void add(int a); // Implementation omitted }; BaseClass* a = new DerivedClass(1); a-add(1); // Polymorphism, late binding DerivedClass* b = new DerivedClass(1); b-add(1); // No polymorphism(?), early binding(?) --- I have a gut feeling that the GCC compiler is smart enough to resolve the function call for b at compile-time, hence no need for a function table at run-time, but I'm not sure. (It's been years since I last used C/C++ for a large project.) Also, how much memory does polymorphism actually require? Should you really avoid it at all costs on Palm OS? My target is OS 3.5+ running on 4Mb+ devices. Thanks -Laurens -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Soft Reset Application Launch
I had the same problem. To get around this, during the sysAppLaunchCmdSystemReset, I set my app to the default application (see system preference - prefDefaultAppCreator ) and then reset it back to the default during the normal launch. The reason I set it back to the default is that I only want my app to launch automatically if I purposely caused the soft reset. Brad Ken [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I am trying to launch an application after a soft reset. I have added code in PilotMain: case sysAppLaunchCmdSystemReset: AppLaunchWithCommand(appFileCreator, sysAppLaunchCmdNormalLaunch,NULL); break; This did not work. I also tried using SysUIAppSwitch but it did not work. Do you have to used the notify manager? Thanks, Ken -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Redistributing the simulator
I think this is probably best answered by someone at palmsource, but any information would be greatly appreciated. I was wondering if it is legal to redistribute the palm OS 5.2 windows simulator to our resellers. Here is what we are trying to accomplish. Our product is comprised of software that runs on PalmOS units (Palm hardware specifically) and our own proprietary hardware (that connects the universal connector on the Palm device). I wrote a windows simulator for our proprietary hardware that allows me to test the software without actually being connected to our hardware. I would like to send my simulator to our resellers so that they can play with and demo our product running on a PC or laptop. The windows simulator has far superior socket support for serial emulation than the emulator, and is perfect for demoing on laptops that do not have serial ports. We would like to ship a CD to our resellers that contains the OS 5.2 simulator, our PalmOS software, and my windows simulator. Our legal guy told me that he is a bit unclear as to whether or not we are able to do this based on the license agreement shipped with the simulator. Does any one know if it is legal to do this, or have any idea who to contact for more information? Thanks in advance, Brad Figler -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: linking problem in CodeWarrior (how do you read a map?)
Matt, I am running the same configuration that you have, accept that I am using expanded mode. I was able to move POLD1.lib to a different segment entirely. The only thing I have in my first segment is the OS related libs PalmOSRRuntime..., MSL_C++, stater.cpp, and common.h. This made life way easier for me. I run in to linking issues every now and then. I just keep moving files until it goes away! Cannot wait for OS 6. Brad Matthew Henry [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] (note: I am using Codewarrior 9.1, POL, 68k (Standard), no exceptions or RTTI enabled) So I'm trying to take Ben's web page's (http://www.palmoswerks.com/2001/09/09) advice and use the small memory model. But I'm very close to giving up in disgust and going back to smart. The only reason I haven't is it's frustrating the h*ll out of me that I can't figure out this problem. The Link Error I get is Link Error : EditCard.cpp: 'CEditCardForm::RowData::~RowData()' 16-bit code reference to 'POL::CString::~CString()' is out of range. Link Error : EditCard.cpp: 'CEditCardForm::RowData::~RowData()' 16-bit code reference to 'operator delete(void*)' is out of range. Link Error: EditCard.cpp: 'CEditCardForm::RowData::~RowData()' 16-bit code reference to 'POL::CString::CString' is out of range. My segments look like this: Segment 1: PalmOSRuntime_2i_A5.lib MSL_C++_PalmOS_2i_Dbg.lib POLD1.lib some more files here Segments 2-7: ... Segment :8 EditCard.cpp one more file here The class in question is defined in EditCard.cpp class CEditCardForm::RowData { public: CString Label; }; I tried rearranging the .libs in the first segment, or moving EditCard.cpp to a different segment, but to no avail. I have tried reading the map file, but it is utter gibberish to me. I mean, I think I understand what it's saying, it just doesn't seem to tell me anything very useful. a. what is the solution? ... and more importantly... b. how do I read the map file so I can figure these linking problems out for myself? -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Memeoy leak
The log file is in the same directory as the emulator. Zhang Juan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello. Can anybody help me please I met a mistake when I debug my programme: Found 1 memory leak for ***... Information concerning the leak can be found in the log file. Where Can I found the log file. And why memory leak happened.. Thanks in advance Zhang Juan -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Question about launching after a soft reset.
I followed Dave's suggestions and all is well accept for the fact that when I send a SysUIAppSwitch() my program never seems to get a normal launch code. So, now I have a couple of questions. 1. Are you supposed to check for appStopEvent under normal launch conditions only? 2. Am I allowed to call SysUIAppSwitch() from the System Reset launch code? If I setup the emulator (or the device) to receive the System Reset launch code from metrowerks, and watch it in a debugger, it works fine. Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Question about launching after a soft reset.
I would like to cause my application to do a soft reset and then re-launch itself when the soft reset is complete. However, I only want to do this when I cause the soft reset. I know that I can handle sysAppLaunchCmdSystemReset launch code, but I would need to know that I was the one who caused the reset. I am sure that I could store a flag somewhere in a database and check it when I receive this launch code, clear it, and launch my app normally. Is there an easier way of achieving this effect? Thanks in advance, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: debugging on the device CW9
Makes sense, I am running a beta version of CW that helped with projects using expanded mode! I will live with it until the highly anticipated 9.x updated comes out =) Thanks, Brad Ben Combee [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] At 05:09 PM 7/14/2003, Brad Figler wrote: Well, I figured it out. It appears that my drop down for Connect to has 4 options (it previously had 2). The first option is simply blank where blank := Emulator The second option is simply blank where blank := device The third option is Emulator where Emulator := nothing The fourth option is Device where Device := nothing Does anyone know how to fix the drop down? Is there a registry entry that needs to be cleared or something like that? It sounds like you've got a corrupted pref panel DLL. Are you running a pre-release version of the CW tools -- there was a bug in an early 9.2 beta that looked like that :) Try restoring the PalmDebugger.dll in bin\plugins\Preference Panels with one from a virgin V9 installation. -- Ben Combee [EMAIL PROTECTED] CodeWarrior for Palm OS technical lead Palm OS programming help @ www.palmoswerks.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
debugging on the device CW9
I know that I have setup debugging on the device in CW9 before, but I cannot figure out how to do it again. Here is what I am doing (step by step). In codewarrior, I select Edit-Debug Settings... I go to the Palm OS Debugging screen. I notice that the Connect to drop down is blank (very suspicious). I change it to say device. I press OK (apply button does not become enabled, again, very suspicious). I hit F5 and the emulator launches. I go back in to the Palm OS Debugging screen and I notice that the drop down has changed back to a blank selection. Any suggestions? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: debugging on the device CW9
Well, I figured it out. It appears that my drop down for Connect to has 4 options (it previously had 2). The first option is simply blank where blank := Emulator The second option is simply blank where blank := device The third option is Emulator where Emulator := nothing The fourth option is Device where Device := nothing Does anyone know how to fix the drop down? Is there a registry entry that needs to be cleared or something like that? Thanks, Brad Brad Figler [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I know that I have setup debugging on the device in CW9 before, but I cannot figure out how to do it again. Here is what I am doing (step by step). In codewarrior, I select Edit-Debug Settings... I go to the Palm OS Debugging screen. I notice that the Connect to drop down is blank (very suspicious). I change it to say device. I press OK (apply button does not become enabled, again, very suspicious). I hit F5 and the emulator launches. I go back in to the Palm OS Debugging screen and I notice that the drop down has changed back to a blank selection. Any suggestions? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Question about dynamic form objects and POL
In the palm OS documentation they state that if you dynamically add form objects that you must save the new FormType returned from the call because the form may have actually moved in memory. My question is, does this invalidate any pointers to form objects that you might be storing? My guess is yes because of the bug I am seeing in my code. Here is the scenario. I have a form with a list on it. I attached a POL::CSimpleListCtl to it. I then dynamically add a button to the form which changes the form pointer. When I go to re-access the list via GetSelection(), I get weird results such as the wrong selection index or it crashes. I think the issue is due to the fact that when I attach the list control, POL is saving the ListPtr returned from the form when attach was originally called and now the saved list pointer is no longer valid. The problem is that I am adding the dynamic button from a base class and I have no idea what objects are attached on the current form. It would seem that POL should only store the form pointer and then call FrmGetObjectPtr when ever it needs to access an object on it. Has anyone else run in to this problem or are my assumptions incorrect? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: new update CW 9 ????
Ben, I'm currently about 1100 miles from MW headquarters on vacation. :) I think you need to lookup the word vacation Unplug man =) -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: How to save space???
Reading the palm companion guide, there is an 8 byte record entry stored in the record list of the database header. So, for each additional note that you have that is 24 bytes, you automatically gain 8 bytes. The data is stored in a chunk which also has an 8 byte header on it storing lock counts and such, so add another 8 bytes to get you to 16 bytes per extra record. I think that is it for the overhead per record, and I don't think you can easily change this. Brad Ryan Bruner [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I was making updates to my code and decided to attempt to reduce the amount of memory each record takes up. So, after doing some judicial rearranging and more efficient use of fields in my data structure, I reduced what was over 100 bytes to around 65. So, this would seem to be a 35% reduction in space. Now, the catch is that one of the fields, for efficiency sake, is a string of small size. If, however, the size of the data exceeds the size of that field (set to 24 bytes now, previously it was 50 bytes), then I store the data in a data record that ONLY contains the string information. This notes field method allows me to have quick access to most notes (which tend to be small for my application), but allow larger notes as well. The problem is that after all this conversion, my memory usage, after conversion of the data from the old format to the new format is actually no different. It seems that the few additional records added due to some notes being between 24 and 50 bytes in length added enough data to basically eliminate any benefit from reducing the memory footprint of the other 300+ records. This seems to indicate that there is a lot of extraneous data maintained for each record by the PalmOS itself. Is there a way to make a record not take up as much space from the OS side of things??? One might question why I'm not compacting the data for each record. Well, I do some intensive statistical calculations on all of the records at times, and so using a fixed structure prevents the need for parsing and copying the data for each record, which speeds things up dramatically. Ryan -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Too many calls to new?
I believe that the m515 only has 256K of dynamic memory available to the device. Your global memory and your stack space is included in that value, so 200K may very well be the limit. Brad Richard Coutts [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm getting an exception from within new on ROMs for older handhelds, such as the m515, when the number of calls to new exceeds 5000 or so. It's happening when reading a database. My database represents a drawing that has entities, such as lines, circles, etc. When reading a database, I make a call to new for each entity in the database. So, if there are 5000 lines in the database, I make 5000 calls to new, one for each line, and put all of the lines in a graph for rendering. A database that works fine on a Zire 71 is throwing an exception on an m515. Running the database with POSE I'm finding the exception thrown from within a call to new after 5000 or so entities. The entities are only taking up 200Kb or so of memory, so there's plenty of memory left or the m515. Is it possible that I'm running into some other limitation? Thanks, Rich -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Text field with lots of text
All, I am having a problem displaying a text field with lots of text (about 15000 characters). Is there a limit to the number of characters supported in a text field? What about the limit in Pilrc for a single text string? I had to break my text string down to 5 separate resources and then piece them back together in the code. Is there a better way of doing this? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Codewarrior template friend class
Visual studio does not accept it either =). Try template class X class AAA { }; class BBB { friend class AAA; } ...This compiles too. class CCC { friend class AAA int ; } Brad Kristian Penno [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I was under the impression that the following code was legal. Codewarrior gives me a declaration syntax error on the word friend. Any language options I might have wrong? template class X class AAA { }; class BBB { template class X friend class AAA; }; KP -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
NetLib question
All, I am experimenting with sockets and such for the first time (on palmos). I have created a client socket and connected to my own PC via localhost and the emulator. I was able to send a text string from the emulator and print it out in a DOS console (POL made this extremely easy...a little plug for POL!). However, I do not understand how to obtain an IP address on the physical device. The device is a Tungsten C. I obviously need to connect to our wireless network, obtain an IP address, and then attempt to connect my socket. Can someone point me at some documentation on how to do the first two things listed (or explain it to me)? It would be greatly appreciated. Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: NetLib question
Nevermind, I figured it out. There is actually a little blurb in the palm os companion volume 2 that talks about opening a configuration. The example deals specifically with wireless connections. So, if anyone is wondering how to do it, you can open NetLib with the default wireless configuration. This will show the same modal dialog that you see when connecting to the browser or the mail application (at least on the Tungsten C). I could not figure out a way to do this using POL::CNetLib, so I had to derive a class from it and provide a different version of Open() that takes a configuration name and opens the library that way. Brad Brad Figler [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] All, I am experimenting with sockets and such for the first time (on palmos). I have created a client socket and connected to my own PC via localhost and the emulator. I was able to send a text string from the emulator and print it out in a DOS console (POL made this extremely easy...a little plug for POL!). However, I do not understand how to obtain an IP address on the physical device. The device is a Tungsten C. I obviously need to connect to our wireless network, obtain an IP address, and then attempt to connect my socket. Can someone point me at some documentation on how to do the first two things listed (or explain it to me)? It would be greatly appreciated. Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Button size
What resource editor are you using? All of our buttons in our app are 36x20 (makes it easier to use by hand). You can easily change the size in constructor or Pilrc. Brad Michel.P [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there an easy way of changing the default size of a button? One of my forms is composed only of a few buttons with a label of only one character, thus I would like a larger than normal size for those buttons. I guess the buttons could be replaced by gadgets, but before I decide on such a drastic decision I wanted to exhaust the other posibility. __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: POL CGrid class
Maks Pyatkovskiy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've hard-coded 3 because I like rounded corners. That is a great answer!!! But SelectFullRow() is virtual function, so you can completely override the selection. Thanks, I never looked in the header to realize this. I just saw the source code. Thanks again. Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
POL CGrid class
Why does the CGrid class pass a hard coded value of 3 to the function g_SystemInfo.Glue_SelectRectangle() from the call CGrid::SelectFullRow()? When using a selection mode of GM_FULLROWSELECT you get rounded edges in the first column and on the last. It makes the selection have a button shape to it and it leaves unselected pixels in the corners between the border of the table and the selection. Is there a reason this was done? Is there a solution to the problem other than changing POL source code? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Printing Floats
StrPrintF does not support floating point numbers directly. You should use the GetStringFromDouble() that you mentioned. Thomas Sweeney [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a floating point number, such as 3.1234567, which I want to print out as just 3.12. Can I use sprintf or do I need to use one of the various functions (pDouble or GetStringFromDouble) which I've seen on this forum over the last few weeks. Thanks in advance Thomas -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: POL cancelled?
V9 product. It is unlikely that POL will be easily portable to future versions of Palm OS due to a changed programming model, but the current POL works very well for Palm OS versions through the 5.x series. What that basically says to me is that moving from 5.x to *new programming model* is going to be a re-write of just about every palm app out there (kinda like going from DOS to Windows XP). Is this a correct assumption? Are there actual plans for an OS 6 (or greater)? I hope we get our first palm app shipped before that day comes! I won't be allowed to sleep for months =). Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: POL cancelled?
I would expect that Palm OS 6 would continue to include PACE for backward compatibility. If that is the case, then POL would be a great framework to have. It could be upgraded with new classes that support the new OS (and programming model) directly, while leaving the legacy classes that take advantage of PACE for backwards compatability. ~Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: POL cancelled?
I agree. I just converted our project over to use POL. It is a solid framework. If it ever gets converted to a GNU project or such, I will be more than willing to contribute to it. ~Brad Florent Pillet [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I just got an email from TeT saying that POL support is cancelled. This can't be true. This is a nightmare. -- Florent Pillet, Code Segment [EMAIL PROTECTED] Developer tools and end-user products ICQ: 117292463 Palm, Mac, Unix, Windows http://perso.wanadoo.fr/fpillet -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: POL cancelled?
Palm Object Library. It is a collection of C++ classes for palm OS. It provides an Application/Form framework that really simplifies laying out a project. It wraps many of the palm OS managers as well. ~Brad Patrick [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm a newbie, what's POL. Pat... - Original Message - From: Brad Figler [EMAIL PROTECTED] Newsgroups: palm-dev-forum To: Palm Developer Forum [EMAIL PROTECTED] Sent: Tuesday, March 18, 2003 2:33 PM Subject: Re: POL cancelled? I agree. I just converted our project over to use POL. It is a solid framework. If it ever gets converted to a GNU project or such, I will be more than willing to contribute to it. ~Brad Florent Pillet [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I just got an email from TeT saying that POL support is cancelled. This can't be true. This is a nightmare. -- Florent Pillet, Code Segment [EMAIL PROTECTED] Developer tools and end-user products ICQ: 117292463 Palm, Mac, Unix, Windows http://perso.wanadoo.fr/fpillet -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: How do you acces the Sd Card?
See Expansion Manager and Virtual File System Manager in the PalmOS API for details (chapters 29 and 53, respectively). Brad Brandon Sean Fogerty [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What functions can you use to get information on an Sd Card? Like the Name Brandon, memory size, etc? THanks!Brandon Lead Programmer/Graphics/Music [EMAIL PROTECTED] Http://www.DreamCodersRealm.com We Write Tomorrow's Code! GOD Bless you Always my Friend!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Emulator memory leak report
Ben, I have the same problem and Jan reported, so I looked at my project and the debug symbols were turned off. When I received CW9, I recreated my project from scratch. I think the default for the project was to have the symbols turned off. I beleive this was different in CW8 (they were on by default). Just thought I would let you know. BTW, the new project I created was using the POL wizard (expanded mode, no exception support). Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Emulator memory leak report
Be very careful with expanded mode in V9 and V9.1. There are some major codegen issues, and I'd suggest you either stay with 8.3 for expanded mode programs, or join the MPTP program here at Metrowerks (http://www.metrowerks.com/MW/Services/Beta/default.htm) to get the pre-release 9.2 68K compiler/linker that fixes these problems. I am! Macsbug symbols are off by default, since they aren't used by the CodeWarrior debugger, and they add significantly to your code size, especially with C++ programs. I've seen some C++ apps drop 15K to 50K in size when Macsbug symbols were turned off. OK, that is good to know. I will only enable it if I encounter any memory leaks in DEBUG mode! Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: unable to use a local variable
its also horrible programming practice to do it the way you have. its best to declare all the variables you need at the top, and, give them values below. in rare cases, I don't think it is a *horrible* programming practice to declare your variables where you use them (assuming you are using C++ ofcourse). If I had a function that was 150 lines long, and I need a local variable near the end, why would I declare it at the top of the function (or block)? That would require the programmer that comes in after me to remember how the variable was declared at the top of the block, and if he forgot, he would have to scroll back up to see how it was declared. One other point is that it keeps another programmer from coming in and using the variable assuming that it is already setup correctly. For example. void test( void ) { // Non meaningfule value, just an initiailizer. int a = 0; begin lots of lines of code // Maintnance programmer inserts line here. a += 20; // Wants 120, but gets 20. end lots of lines of code // Intial meaningful value a = 100; } The code snippet is meaningless in itself, but the scenario can happen happen. If *a* were declared where it was used, the compiler would throw out an error long before a bug was introduced. So is it so horrible? Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Virtual characters
I don't believe there's any such range defined. Also, since everybody gets a crack at the notification, having a user defined range would create the potential for conflicts unless the range was reserved for the current app, in which case using app defined events would be This is a confusing point to me because I do not understand how everyone gets a chance to handle the notification. It is my understanding that an application must un-register for a notification when it is closed down. It is also my understanding that only one application can be running at any given time, so who else (aside from the OS) is ever going to see the notification? I think I am really mis-understanding something about notifications (or even worse, how the OS works). Any insight would be very helpful. Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Codewarrior Diff program
Does anyone know if the DIFF program shipped with CW is an executable (vs. a .dll). I would like to make it my diff program directly from winCVS if possible. Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
SortInfo block question
I have a quick question about initially setting the sort info block for a database. Are these steps correct? // Assuming an open database 1. Create memory handle using MemHandleNew() 2. Convert memory handle to localID via MemHandleToLocalID 3. Pass localID to DmSetDatabaseInfo(). I think this is correct, but I am a little concerned because doesn't MemHandleNew give me a handle to the dynamic heap? Does passing in the local ID copy the data to the data storage heap? Or does it just set chunks owner to the data storage heap? Or am I completely wrong? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Virtual characters
All, I am using the function EvtEnqueueKey to put a virtual character in the queue. I am also registered for the sysNotifyVirtualCharHandlingEvent (palm OS version 5.0+ only). I was wondering if anyone knows if the OS allocates a user defined range of virtual keys? I looked in the header chars.h, but I did not see anything mentioned (other than licensee ranges). Any suggestions? Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Notification Question
Is it legal to broadcast a user defined notification and handle it in the same application? I assume the answer is yes! However, I tried this one time when broadcasting from an interrupt and handling the notification in the same application and it did bad things to my application. The reason I ask is because I have extended the POL::CDatabase class and I want to know when things happen within my database object throughout the application. Posting one of a couple of notifications would be a nice way to handle these *things* in multiple places when they occur. Thanks in advance, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
pilrc question
Does pilrc have the ability to align the right, left, top, or bottom sides of controls (like in constructor, devstudio, etc..)? I cannot find anything in the docs, and I do not see anything obvious on the interface. Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: typedef problem
You cannot store function pointers to class methods. You must declare your function as static. That will fix the compilation error. Chris Apers [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I have i little problem and perhaps you can help. In the following exemple, i'd like to call func1, func2 or func3 with _func depending of the configuration of the app, so i call setfunc(int) to set the _func value. But i have the following error : --| illegal implicit convertion from 'void (B::*)()' to 'void (*)()'. I know my typedef declaration is wrong but i can find how to declare it. thanks -- class A { ... }; class B : public A { public : void setfunc(int); void funcexec(); ... private: typedef void ExecProc(void) ExecProc *_func; void func1(); void func2(); void func3(); }; void B::setfunc(int what) { switch (what) { case 1: _func = func1; break; case 2: _func = func2; break; case 3: _func = func3; break; } } void B::funcexec() { _func(); } -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Converting doubles to strings
All, A long time ago I posted a question about an algorithm that converts floating point/double values to strings. I got one, but it does not work all to well. I am using the float manager to convert strings to double. That works perfectly. Can someone suggest a recommended method for converting doubles to strings? I don't need the string in exponential format, I just need the string to have 1 or 2 places precision. An example of the problem I am seeing is the following. User enters a number 1.2 I convert that to a double using the float manager. I get 1.2 I multiply that by 1000 to get 1200. I store it in the database. I read it back out. Divide it by 1000 and get 1.2. In my double to string conversion I get the integer portion using the following code. long iValue = ( long )1.2;// Gives me a 1. I then subtract out the 1, i.e 1.2 - 1.0 to get .2 I then multiply that by 10 and get 2.0 (at least that's what the debugger says I have!); I then have the following code. long dValue = ( long )2.0; // Gives me a 1. -- This is the problem I did not write this algorithm, I just used it! Is there a better way to do this? The numbers I will need to convert will be in the following range 0.5 to 999.9. Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Converting doubles to strings
(long) (x + 0.5) I thought everyone learnt this trick in primary school? Or at home, while programming in BASIC as a child? It is funny that you say that, because now that I see that, I cannot believe I did not remember it. Thanks for reminding me. Actually, what I did was re-write it from scratch using the float manager to return the base 10 info (mantissa, sign, and exponent) and constructed the string that way. It works great. ~Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Converting doubles to strings
(long) (x + 0.5) I am going to lose sleep over this one tonight. I am such an [EMAIL PROTECTED]@[EMAIL PROTECTED] -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Notification Clarification
All, I have read the section in the palm os companion a couple of times about launch codes and notifications. I am not to sure that I understand everything I am reading. Sorry if this is a stupid question. From my understanding, you *usually* register for a notification when your application launches. However, I am unclear when to un-register for a notification. If I wanted my application to handle the sysNotifyCardInsertedEvent, would I only be able to do this when my application is the application running? If I un-register for the notification when my app is terminated, then it would seem that I can only get the event while my application is running. Also, what if the user installed my app, but has not run it yet? How would I register for the notification in that case? Thanks in advance, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Custom ROM images
Are there tools to build custom ROMS for PALM devices, specifically m515 and m550? I found Romeo on sourceforge, but it appears to be quite outdated. Would contacting PALM inc. be a better approach? Thanks, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: How to change a string into lowercase??
btw, which manual(s) should I read to get more info?? Read the companion guides for general information about the OS. They are on palmsource.com. I read the first one a couple times when I first started using palmOS. It was time well spent. Other than that, use the API. Everything you need is in there! Look at the String Manager for all your string manipulating needs (except for formatting double precision numbers =) ). ~Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Data backup suggestions
All, I am tossing around some ideas for doing on the fly data backup to an SD/Flash memory card. Our product is going to be hosted on a palm device (m515 or Tungsten). The device is going to be mounted inside of an establishment, that most likely will not have a computer (and the employees most likely won't know how to use one, so hot sync is out). It is going to be collecting data that will be stored in various databases on the palm device. I am thinking about mirroring every piece of data that we collect on an SD card as we collect it. I know that I cannot write to an SD card using the Data Manager, but I can open a file using the VFS Manager. So what I had in mind was creating a binary file large enough to hold a pre-defined maximum number of fixed size records and every time a record gets added to the database on the palm unit (in user storage) I would mirror the binary chunk inside the file on the SD card. I have multiple databases, so I would need to have anywhere from 2 - 5 file handles open at one time. The largest single record being written at any one time will probably be less than 100 bytes, so I am assuming (I know, I know) that the performance hit won't be that bad. Plus, the device is not going to be interacted with, so the user is not going to notice if it takes 100us vs. 10us to add the record. Please give me your thoughts and suggestions on this method or any other method that you can suggest. I have not written any code to write to an expansion card yet, so I am basically on a fact finding mission to see if what I am planning to do is feasible. Thanks in advance, Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: How to modify a record in DB??
DmNewRecord() - Creates new record. DmGetRecord() - Get existing record MemHandleLock() - You need this to lock down the handle and get access to actual memory block you allocated. DmWrite() - Used to write data to a record (requires an offset, see Offset_Of) Oh, you will need DmReleaseRecord() as well. For more information refer to the detailed documentation in the Palm OS reference (Data and Resource Manager). ~Brad Tenchi-Man [EMAIL PROTECTED] wrote in message news:114363@palm-dev-forum... Hi, I ve got problems in modifying a record in DB by Dm struct{ Int16 a; Char b[5]; }DB 1) how can I modify the integer value in existing records??? 2) how can I assign the Char (eg. name[5]=Johny) when creating a new record?? Do u know? pls help thanks a lot Ray -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: using a string with CW9 ??
char buffer[ 15 ]; SysStringByIndex( StringListName, StringListIndex, buffer, 15 ); StringListName-Name of the stringlist resource in Pilrc that you created. StringListIndex-zero based index of the string in the list to extract. ~Brad Rodolphe Bréjaude [EMAIL PROTECTED] wrote in message news:114042@palm-dev-forum... Hello, I create a string and and string list with PILRC with the label xxx How can I get the text of the ressource in a char* or a CString variable? thanks if you have a littel exemple... -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Inconsistent Line Endings
All, I seem to get the following error message couple times a week (CW v9). File has inconsistent line endings. Any idea how I am introducing inconsistent line endings? I searched the archives and got squat. Brad -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/