Hi,
I have a very very strange problem with eVC++ 4.0, 2003se sdk..
I use the following code to retrieve the text of a column in a CListView, and it works... when I copy and paste the code to another function in the same class, it just doesnt work!!! copy and paste and it doesnt work and for no reason!!!
Code:
LVCOLUMN col;
USHORT buffer[40];
col.cchTextMax=39;
col.pszText=buffer;
m_lstFiles.GetListCtrl().GetColumn(iColumn,&col);
Ok, you might say that there is something wrong with my code, so I ran the program on the emulator, and the code works perfectly!!! :evil:
what a strange problem!! I have been trying to solve this for 4 hours and it didnt work with me!!!
any ideas??????????????anybody a similar problem????
:?: :?: :?:
Mohammad :roll:
Re:
Your problem might be that you do not set the .mask membert of the structure and because it's allocated in the stack, the value is random and depends of the current contents of the stack.
You can try to add this line before the call to GetColumn() :
col.mask = LVCF_TEXT;
Related
Hi,
I'm currently doing a project and i'm using a xdaII.
Platform: PocketPC xdaII Intel(R) PXA263 400Mhz
Memory: 128 MB
ROM version: 1.60.00WWE
Protocol version: 1337.18
ExtROM version: 1.60.44
Connection: USB ActiveSync Version 3.7 (Build 3083)
Host PC: Microsoft Window XP Professional 2002 With Service Pack 1
What I have done so far:
I have create a application using VB.NET for the xdaII fone. the application is suppose to send and receive sms. I have successfully sent sms out of the phone,
Problem/Question:
1.
However, I am stuck at the interception of the received sms. I've read through the MSDN website but some of the API functions have been depreciated and further more there isn't any samples or good VB.NET reference on reading SMS.
Where is the location of the sms messages that is stored (from what I know/read, the sms is from the inbox), but how do I retrieve it from it and display it on the VB.NET application?
2.
Is it that I have used the wrong language? I've tried using j2me midlet to send/receive sms. But I need to know how to use the push registry and the sms port number.
3.
Upon receiving a message from a certain sender, how do i auto-acknowledge it?
----
Hope somebody can help. I'm rushing for time. Your help will be greatly appreciated.
I am not sure if this is the answer you want as you are talking about VB.NET. However I have sent and received SMS using Embedded C
The send sms is easy, as you have found out.
Receiving SMS is slightly harder as it seems that only one sms receive program can be active, normally that is the Inbox program. If you do a warm reset and then you can create a handle to a SmsRead. This action blocks Inbox. Inbox also blocks SmsRead getting a handle, that is why a warm reset is required.
The SmsRead function must be run as a seperate thread since it blocks waiting for an Sms Message. All the main thread does is it checks if ReceiveSmsMessage.SmsFlag is set true, if it is then it checks what the message was, does any necessary action and finally sets the SmsFlag to False again.
The SendSms function is used like
SendSMS( TEXT("+44123456789"),TEXT("Message Text") )
The Read function just works in a seperate thread and populates it's ReceiveSmsMessage structure
I would of thought you could translate the ideas here into VB.NET most of the functionality is with API functions anyway.
As to auto-acknowledge all you do there is send an sms message when the main thead finds one has been received, the telephone number to send back to is already in ReceiveSmsMessage.SmsPhone, so you simply do
SendSMS( ReceiveSmsMessage.SmsPhone, TEXT("Received") )
Isit that i have to apply both
#include <sms.h>
#include <tapi.h>
to activate ReadSms?
Is there anyway that I can translate it to VB.NET language?
No, you don't need Tapi.h, Tapi was for another function in the code that I cut these procedures out of.
Sorry I should of not included that when I copy and pasted from my code.
I have edited my attachment above and removed tapi.h. The code would of still compiled OK, it was simply a header file present that was unnecessary.
You only need sms.h, but thinking about it that would only be for the code when in C.
I can't help you with translating this into VB.NET. I have only used normal VB6 and to be truthfull I have never understood how to apply .NET, The important question is can VB.NET run a seperate thead as that is crucial due to the blocking function to wait for an Sms Message. I don't think multithreaded applications sharing data are possible under VB, but I am sure that has been added under .NET.
Assuming threads are possible then I would of thought you could compare my SendSms routine to your VB method to see how C API calls translate into VB.NET.
If anybody sorts the translation into VB.NET then please copy the answer back to this message thread as I would like to see how it is done.
Did you manage to read sms on a QTek 1010 / pocket PC 2002 ?
When I tried it, it said that the function is not supported.
I read somewhere that you have to use cemapi to be able to read
sms on PPC 2002, is that true?
thanks
awni
The code was written and run on an XDA, that is PPC2002 and is the same Original Wallaby device as yours.
When you compile the SMS functions you need to include sms.lib in the linking. Maybe that is your problem, check under Project -> Settings -> Link in eMVC that you sms.lib included in the object/library modules.
I was using it in a .NET environment(C#), there aren't any .h files in C#
and I was able to use SmsOpen in SEND mode without a problem. When I try to use SmsOpen in RECEIVE mode, I get an "Invalid argument" error.
I tried typecasting, and I got "Not supported error".
I've never used eVC, I just downloaded it yesterday. I've used VC++ 6.0
and 7.0, so I still need to figure out how to get eVC working..
awni
I think my problem is with the last argument to SmsOpen, I was sending
NULL/0 instead of using CreateEvent like you're doing.
HANDLE hRead = CreateEvent (NULL, FALSE, FALSE, NULL);
// Open an SMS Handle
HRESULT hr = SmsOpen (SMS_MSGTYPE_TEXT, SMS_MODE_RECEIVE,
&smshHandle, &hRead);
I'll try it as soon as I figure out how to create the thread...
thank for the code.
awni
Has someone got the reading SMS working ??? I checked the sample code out however i always get the error message to do warm reset !!! I read that this is due to the handle that is already used.
Any solutions here ??
Hi
I have a few question
--is it possible that i replace my application with the default dial applciation when the start call key is pressed . i read the post that by replacing /windows/cprog.exe this can be achieved temporarily. i want it for permanent.
--secondly is it possible to stop any default voice call when number is pressed on touch screen or through dialer application..........by intercepting the internal message mechanism .
--How XDA2s make a voice call ....is it through tapi ...i m talking about the normal phone calls ....if its tapi i will b help ful if a detail is provieded whether a seperate TSP is required for that ?
Thanks in advance ...any help will b highly appreciated .....
Regards,
Tabish
Replace cprog.exe with custom phone app
Hi hsibat,
I have almost the same problem. I want to replace the original phone application with my custom phone app. In this custom app I want to control which phone numbers are allowed to dial, and which numbers to accept a phone call from.
My results untill now are:
- My app works well when it runs besides the originale cprog.exe, using tapi calls like lineInitialize ... tapiRequestMakeCall etc.
- When I overwrite \Windows\cprog.exe with my app (now also named cprog.exe) I cannot dial or receive calls anymore. Building up a line and selecting a provider in the end results in "No service" in the connection dialog. Despite the fact that i'm seeing when debugging that the registration with my provider results in the correct provider (lineRegister) "NL KPN".
Obvisouly cprog has some more coding in it to setup a good connection.
- After this I tried to analyze the disassembled cprog.exe, but I didn't succeed until now to reveil which extra coded I needed in my app. Reading and interpreting the disassembled code is not easy for me, because I'm not experienced in assembly.
The disassembling I did in the following way:
1. Extract the pda os into a rom file using the OSImage tool (which you can download from http://cuba.calyx.nl/~jsummers/XDA/XDAtools-Jeff.exe).
2. Extracted all files from the romfile on my pc with the tool dumprom from itsme (which you can download from http://www.xs4all.nl/~itsme/projects/xda/dumprom.html).
3. Disassembled cprog.exe with IDA Pro 4.17.
- Now I'm trying to get my app working by replacing the original cprog.exe with my app and renaming the original cprog.exe and store the file somewhere outside /Windows, and starting the renamed cprog.exe from within my app. This Worked!!!! BUT my purpose to block "screened" outgoing calls can be bypassed. When an incoming call is missed you still are able to view missed calls (icon in the taskbar), and if you selected a missed call the original cprog phone app is started (dispite the renaming). And you are free to make any call.
So I'm searching for a solution for this "leak". A solution could be by intercepting ALL outgoing call by receiving a message in my customized app. But like you I didn't figure out how to do this, yet. Or an even better solution would be to get the missing coding I need to be able to exclude the original cprog.exe completly.
You problem to make your overwritte of the cprog permanent can be solved I thing by making your own rom file with your own cprog.exe included and upload that to your pda. Using the tool makerom.
I hope you can extract some tips from my quest, and I hope someone has some tips for me.
greetings
Re: Replace cprog.exe with custom phone app
i'd recommend you to use completely different method. As you know OS communicates with GSM device through a COM-port. It sends normal AT-commands. You can hook the COM-port, parse ATDxxx and modem's responces and hide unneeded commands.
Replace cprog.exe with custom phone app
Thanks Mamaich (famous celebrity in France),
I think your solution is neater, do you perhaps also have an example of how this should be done ? I searched the whole bb, but couldn't find more then cproghook. Learning by example works perfect for me.
Compliments for this great app by the way. I wonder how you come to these kind of ideas of hooking ?
tai
Re: Replace cprog.exe with custom phone app
http://mamaich.kasone.com/rover/IrCOMM.rar
archive contains a wrapper driver around one of COM-ports. It has no comments and was written to a different device.
Hooking COM
Thanks again Mamaich,
I'll start trying to make this work for my purposes. As soon as I have some results I 'll update my findings to the BB.
Greetings
Replacing the default Dialer App by hook or by Crook ..HELP!
Thanks a lot guys for so much suggestions.
What i m doing is trying a different options now mostly based on your suggestions....listed follows
-- I downloaded the WINCE source code provided by Microsoft under shared source code .Under there faq they said them selves that the source given is very different what runs on a pocket pc ..contains custom applications as well ....secondly i ddidnt find any thing related to GSM in the code but did find about Tapi which is used by a number of applications . i didnt find any thing like cprog.exe as well.....i m stuck what should i do ...i m unable to find even the dial button event handler ........i dont know how to put the dialing application do i need to build a custom one and if so ..how can it b possible to call it when the dial button is pressed ....
-- it might be an idea that intercepting the com port might help...but when there is nothing insied the availabe source code abt the GSM ....what i want to ask is is that are u talking about some external GSM device connected to com port .....if that so how the pocket pc makes the call
sorry if the questions are too childish but i m very new to this ..
Any help will be highly appreciated ..
Regards,
Tabish
Re: Replacing the default Dialer App by hook or by Crook ..H
hsibat said:
-- it might be an idea that intercepting the com port might help...but when there is nothing insied the availabe source code abt the GSM ....what i want to ask is is that are u talking about some external GSM device connected to com port .....if that so how the pocket pc makes the call
Click to expand...
Click to collapse
The code provided by MS does not have the code for RIL and other stuff.
Our devices contain 2 parts - a GSM modem and a Windows part that works with it via TAPI and RIL interfaces. They internally use COM2 to communicate with modem device (also COM9 is used during data session, but this can be ignored in your case). You can intercept all commands going through COM2 and filter out unnecessary ones.
MS shared source code would provide a little help. Most info can be obtained by decompiling DLLs/EXEs with IDA (www.datarescue.com).
Intercepting the COM2 port for GSM
Thanks for the reply,
i m into writing an application that will intercept the commands destined for COM2 as its a gsm port right ....i hope this will work for me .
Is there are good starting article for writing hooks for COM ports and is there any detail available for WinCE what port is for what purpose ?or u can say WinCE internals .
Any extra advice or information will also be highly appreciated in this regard.
Regards
Tabish
Re: Intercepting the COM2 port for GSM
i don't know such articles
Hi
Now i m trying to get into details and trying to write a GSM port interceptor .
A few problems that i have that ....i wanna create a seperate rom iamage i mean my little application will be a part of OS . but unfortunately i dont have the RIL module code in the shared source code ...there is no TSP ( not remember the exact name )avaialble that Tapi uses to make the call.
Secondly if i dont make it a part of OS then will it b possible to make it background process that will run every time OS starts and will not disappear even after a hard reset.
I will be needing guidance to achieve this .....
ideas matters alot .....
Thanks in advance ..
Tabish
to add files to ROM you can use itsme's romtools, or you can make a CAB and place it to extended ROM so that it would be installed after each hardreset
Oks ...
making the cab file is the second part ....
firstly i tried to extract the rilgsm.dll and ril.dll from my device , i was succedded in getting rilgsm.dll but was unable to get ril.dll....infact i wanted to have a look at the functions provided there ....
i m not sure where to start from .....i check the forum ther i found a very complex solution for hooking the dll in this link
http://forum.xda-developers.com/viewtopic.php?t=19558
and i will have to hook the dll in ordert to intercept what even command goes to the port .....
Correct Me if my direction is wrong ....
Regards
Tabish
I have followed many posts on how to establish data call and am still having problems.
1) When collecting data from TAPI shall i createfile through COM 1 ? because when i try to, i get an error message. Maybe shall i get rid of CProg.exe ? However in my program i'm only requesting a connection to recieve data from a remote module.
2) When connecting through COM 2 with AT Commands i get normal AT responses. However with my ATD i have more difficulties. I dial ATD"0123456789"; and i get an OK then NO CARRIER response. Anyone got an idea ?
thanks for your helps.
I am having a problem with saving settings/preferences within TomTom5 on my XDA2. It says that it saves ok but as soon as I exit the application and re-open it, the settings have been lost.
Is there a patch or software update that I need or is it more fundamental that this on the XDA2?
Any help would be great, I will try anything!
Sorted
After I deleted all the software and re-installed it all is ok.
hi Dave
u can save setting by deleting one file which is in your map folder
and that is called
"Great-Britain-Map.cfg" or "Great_Britain.pna"
i got confussed now which file
----"Great_Britain" is the country name whose map you have installed----
but u can try to change the file name instead deleting them first try PNA file and try to save setting the exit your program then see the result
i done this i thik three four mounths ago and its working the deleting the file i got with software
Regards
Gugi
Hi, i'm from Spain (I don't speak english very well) and i've got a problem with my Imate Jam. After a Hard Reset, Smart dialing and other aplications didnt install. Then i tried to install Smart Dialing with a .cab file but i get the following error: The file \windows\iacontacts.dll are used or in ROM.
I tried to install it at the begining, but i get the same error.
can anybody help me please?
Thank you
nobody? I need to do a hard reset?
thanks
Hi, the messega that "\windows\iacontacts.dll is in use" indicates that the program is already installed and running. If not you can try the following:
- download memmaid (http://www.pocketgear.com/software_detail.asp?id=14279)
- install it, it offers control of autostart programs and services
- find and disable the entry that corresponds too iacontacts.dll
- soft reset and install
Or you can do (prolly easier):
- use a file manager to go into the windows dir and find that iacontacts.dll (prolly hidden so use something like Resco Explorer to see hidden files)
- you wont be able to delete it and you should not do it anyway
- but you can rename it to something like iacontactsold.dll
- softreset and install the cab file, it will not bother you now because the dll has not been loaded because it has not been found (you renamed it)
- you can then go into the win dir and should find your renamed dll as well as a new iacontacts.dll, delete your renamed one now
By the way: May I ask what Smart Dialling does anyway? I've not figured that out yet. Its installed on my S110 and I have options for that in the phone tool but no idea what it actually does or how it behaves when it is not installed.
Thank u very much! I followed the second way and i get it
With Smart Dialing for example: To call "Churri" (my girlfriend) you can write 248774 instead of 222-44-88-777-777-444. To find a number for example 99565856, you write 995 and Smart dialing find it automatically.
Thank you very much
Ah ok so you can use fragments of numbers until the right ones are picked out. Pretty neat. I'm happy it worked for you.
I just got my new Wizard ([email protected]).
As I used Magician ([email protected]) before, there is a smart dial option for the phone.
I can make a call with "ONE Finger" but in my Wizard..I have to scroll all contacts to make a call.
Is Smart Dial option available in others e.g. Qtek, i-Mate...etc?
Can please help to extract this for me???
Many thanks
If you go in the ftp under uploads\kjam you can find the extended rom of this device (imate kjam) that support smart dialing. Inside the extended rom there is a file named Default_SmartDialing_enable_0915_signed.cab. Perhaps this help you.
thanks
BTW, what's the username and password for login ftp.xda-developers.com?
Or....would anyone can help to extract the files for me?
Thanks!!!!!!!!!!!!
Copy the files to your ppc and run then from within the ppc exporer,
then it will be installed, you don't need to extract anything.
I will send you the files tonight ;o)
Thanks guys!!!
I final got the files "Default_SmartDialing_enable_0915_signed.CAB" and install into my Wizard Chinese Version.
But there are no different and no way to enable SmartDialing.
Would anyone can have a screen capture on it or show me how to enable it.
I still need to search thru the whole contact to start a call.
Thanks
Could you please post the file cause i have the same problem on my i-mate k-jam
Thanks
If you have a KJAM you already have smart dial.
To enable smart dial you have to open the dialer (press green button) and then press right softkey to open the menu, the bottom selection is SMART DIALING OPTIONS that enable/disable the function.
Here is the smartdialing cab...I have installed in chinese Dopod 838 (K-Jam) and no effect
I just think the files seems too small...do anyone know is it enough for installing SmartDialing????
Hey, I'm also using Dopod838 Chinese... The quick dial is enabled by default... no need to do anything in addition. When you're in the phone applet, press your right softkey and select "快速撥號 (I)" can setup speed dial numbers. 8)
He's refering to Smart Dialing, not Speed Dial Tse... The file size is correct miko... How did you install it? Did you copy the cab file to your storage card or whatever and run it from there?
One thing I missed, is the O2 Dial Wizard on my IIs.. It let you edit the number before dialing and set carding card prefix etc.. Too bad it doesn't seem to work on WM5 or my Exec
I recommend on using Phoneplus which I realized is suitable for WM5.
I have tried the CAB file and it is not working, too.
Anyone successfully run Smart Dialing on Dopod 838? I miss this application very much! :roll:
I found the CAB file actually only activate the smart dialing, which does not contain any program file. The program files should already installed in the K-Jam default ROM.
So I think the smart dialing will be able to run in Dopod 838 by copying the following files from K-Jam devices:
- \windows\phcanhtc.dll
- DPadMenu.dll
Anyone can help? :wink:
This is the Smartdialing program i used for XDAIIs before, u can try to install it into the 838, please give result after try.
Thanks Vincentfung for the file. :wink:
I have tried to install the cab. However it doesn't work nor have any change to the dialer. I think it is for WM2003SE. So... we need the WM5 version of Smart Dialing that found in English K-Jam or English Dopod 838, or maybe Universal...
This one is on my device, and it should work ?
qtek9100 / Vario