Guest sharpstuff Posted April 17, 2005 Report Posted April 17, 2005 I'm trying to write an application in .NetCF that's like "CellTrack" (available for Series 60 phones). I want to be able to get the current CellID, and switch my phone to silent if I'm at work etc. etc. I've read a few articles that mention the use of TAPI for this purpose, but have not managed to find any specific information. Also, I'm not sure if this is the right way to go. Does anyone know where I could find example code in either C# or VB.Net? Cheers
Guest chucky.egg Posted April 17, 2005 Report Posted April 17, 2005 You could check http://celltrack.censored That promises to do the same thing, and the code is in either VC or C# I think
Guest chucky.egg Posted April 17, 2005 Report Posted April 17, 2005 That's odd "spv - developers.com" got converted to "censored" Why was that, is there anything dodgy going on that I might not want to get caught up in? Anyway, see my sig for their web address
Guest sharpstuff Posted April 17, 2005 Report Posted April 17, 2005 (edited) Thanks for replying, I had a look at that site and managed to download the source, once I'd installed tortoise cvs (?!?!?!). Source is in C++ and indeed uses TAPI. I'm determined to crack this in C# so looks like I have to bite the bullet and call windows libraries direct from C#. :-( Cheers! Edited April 17, 2005 by sharpstuff
Guest zamo_x Posted April 18, 2005 Report Posted April 18, 2005 you should check http://www.opennetcf.org/ there i saw some wrappers for tapi..
Guest sharpstuff Posted April 18, 2005 Report Posted April 18, 2005 Thanks for the tips... I think zamo_x is right in saying that a wrapper is the way forward... I wrote these DLL imports... [DllImport("coredll.dll")] private static extern IntPtr GetModuleHandle( IntPtr name ); [DllImport("cellcore.dll")] private static extern IntPtr LineInitialize( out int lphLineApp, IntPtr hInstance, LineCallback lpfnCallBack, IntPtr lpszAppName , out int lpdwNumDevs ); ..followed by these calls... int lineApp = 0; int numDevs = 0; IntPtr handle = GetModuleHandle( IntPtr.Zero ); LineInitialize( out lineApp, handle, new LineCallback( lineCall ), IntPtr.Zero, out numDevs ); Am no expert on this stuff, so might have messed it up... But consistently got "Not supported" exceptions.. :-(
Guest zamo_x Posted April 19, 2005 Report Posted April 19, 2005 i found lineInitializeEx in "coredll". [StructLayout(LayoutKind.Sequential)] public struct lineinitializeexparams { public uint dwTotalSize; public uint dwNeededSize; public uint dwUsedSize; public uint dwOptions; public System.IntPtr hEvent; public uint dwCompletionKey; } [DllImport("coredll")] public static extern uint lineInitializeEx( out IntPtr lphLineApp, IntPtr hInstance, IntPtr lCalllBack, string lpszFriendlyAppName, out System.UInt32 lpdwNumDevs, ref System.UInt32 lpdwAPIVersion, ref lineinitializeexparams lpLineInitializeExParams);
Guest Zone-MR Posted April 19, 2005 Report Posted April 19, 2005 I think you understood the source wrong. The relevant file is cellget.cpp http://cvs.sourceforge.net/viewcvs.py/nbft...1.4&view=markup The CellID info is retrieved directly from the GSM memory. CCellGet::GetCellInfo(CELL_NEAREST, CELL_ID) will retrieve the nearest cell's ID. I don't think there's any easy was of accessing memory directly in .NET. You'd either have to call the CopyMemory API, or write a eVC++ DLL for getting the Cell info.
Guest sharpstuff Posted April 23, 2005 Report Posted April 23, 2005 Ah! Thanks for your help, I'll have a look into that J
Guest sharpstuff Posted April 24, 2005 Report Posted April 24, 2005 I bit the bullet and wrote a C++ DLL that does the same as the GetCellInfo method of CellTrack, and called this from C#. Unfortunately, it threw an exception. I'm assuming this is because the GSM Memory is mapped out differently on my phone. Cheers for your help guys
Guest pai Posted April 28, 2005 Report Posted April 28, 2005 sharpstuff, can you tell me how to call a DLL in C#? I built a c++ DLL, but by using in C# an error says: This is not a .NET assembly. Thanks
Guest sharpstuff Posted April 29, 2005 Report Posted April 29, 2005 I use DLLImport in my class to create a .NET declaration for each of the methods in my C++ DLL. Like this: - [DllImport("mydll.dll")] public static extern int DoStuff(string myParam1,long myParam2, int myParam3 ); Then, just call your DoStuff method from your C#. Here's an article that explains it quite well http://csharpcomputing.com/Tutorials/Lesson21.htm You could also take a look at the source for the smart device framework at www.opennetcf.org, there are some good examples here Hope this helps
Guest pai Posted May 4, 2005 Report Posted May 4, 2005 I use DLLImport in my class to create a .NET declaration for each of the methods in my C++ DLL. Like this: - [DllImport("mydll.dll")] public static extern int DoStuff(string myParam1,long myParam2, int myParam3 ); Then, just call your DoStuff method from your C#. Here's an article that explains it quite well http://csharpcomputing.com/Tutorials/Lesson21.htm You could also take a look at the source for the smart device framework at www.opennetcf.org, there are some good examples here Hope this helps <{POST_SNAPBACK}> Thanks, i got it working now.
Guest damylen Posted May 19, 2005 Report Posted May 19, 2005 Thanks, i got it working now. <{POST_SNAPBACK}> Pai, could you explain us a little bit more how you got things working? Can you access the cellid information from within the compact framework using the dll? I would be interested in knowing how to get this working. Greetings
Guest pai Posted August 10, 2005 Report Posted August 10, 2005 Pai, could you explain us a little bit more how you got things working? Can you access the cellid information from within the compact framework using the dll? I would be interested in knowing how to get this working. Greetings <{POST_SNAPBACK}> First I wrote a c++ DLL, then write a .NET DLL by using the first DLL. At the end i use the .NET DLL in my .NET application. sorry for so late response.
Guest NoneUser Posted September 13, 2005 Report Posted September 13, 2005 Is it possible to use the cellid information your getting to automatically update the time zone? I can't believe they don't have this built in already. Pai, could you explain us a little bit more how you got things working? Can you access the cellid information from within the compact framework using the dll? I would be interested in knowing how to get this working. Greetings <{POST_SNAPBACK}>
Guest pai Posted September 13, 2005 Report Posted September 13, 2005 http://develop.ipeng.de/mdaat/index.php
Guest bobgeorge Posted October 12, 2005 Report Posted October 12, 2005 Hello, I am trying to do the same with java, to make a library that I can use in a java midlet. Does anyone know if this is possible and where I might find some information?
Guest potter Posted December 23, 2005 Report Posted December 23, 2005 can anyone give a celltrack.dll can get cell info in SDA?
Guest Carty Posted February 20, 2006 Report Posted February 20, 2006 First I wrote a c++ DLL, then write a .NET DLL by using the first DLL. At the end i use the .NET DLL in my .NET application. sorry for so late response. <{POST_SNAPBACK}> Man, i was searching this for a real looong time.. Great you guys made it.. I need this too but the thing is I know VB.net only. So is there a way to call the dll made by you to my application using VB.net.. If so, can i get your dll file pleassseee.. Thanx a million in advance.. Regards Carty..
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now