|
I asked a number of weeks ago about a way to remove links from the start menu in Windows CE. The response was:
enumerate the .lnk files in \windows\start menu with findfirst/findnext and then move the ones you dont want there to \windows\start menu\programs
Which seems helpful, but I don't know how to go about doing this using InstallScript. Could someone give me an example of how to do this using InstallScript? Also any other method would be appreciated.
Thanks!
Kelly Ryan
|
|
|
|
|
I am working on an application for the Intermec 740 (PocketPC 2002), written in C# under .NET Compact Framework. I want to establish a GPRS connection to the internet via a bluetooth mobilephone using "ConnectionManager".
I need to make a call to "ConnectionManager" in the dll "cellcore.dll", i.e. a call to unmanaged code which need marshaling of the data structures.
I have included the code below.
When I run the code, I loose the connection to the Intermec completely, so it is pretty difficult for me to debug this code.
But I think the problem is around the marshaling of the data structures used as parameters to the functions in "cellcore.dll".
Have anyone successfully used the ConnectionManager from .NET Compact Framework (C#) ?
Does anyone have ideas how to proceed from here, e.g. experience with calls to unmanaged code and marshaling of structs from C# ?
using System;using System.Collections;<br />
using System.Runtime.InteropServices;<br />
<br />
namespace Mobile.ConnectionManager<br />
{<br />
public class ConnMgr<br />
{<br />
private const int CONNMGR_PARAM_GUIDDESTNET = 0x1;<br />
private const int CONNMGR_PARAM_MAXCOST = 0x2;<br />
private const int CONNMGR_PARAM_MINRCVBW = 0x4;<br />
private const int CONNMGR_PARAM_MAXCONNLATENCY = 0x8;<br />
<br />
private const int CONNMGR_PRIORITY_USERINTERACTIVE = 0x08000;<br />
<br />
<br />
public unsafe class CONNMGR_DESTINATION_INFO<br />
{<br />
public Guid guid = Guid.Empty;<br />
public char* szDescription = null;<br />
}<br />
<br />
<br />
public unsafe class CONNMGR_CONNECTIONINFO<br />
{<br />
public int cbSize;<br />
public int dwParams;<br />
public int dwFlags;<br />
public int dwPriority;<br />
public bool bExclusive;<br />
public bool bDisabled;<br />
public Guid guidDestNet;<br />
public IntPtr hWnd;<br />
public int uMsg;<br />
public int lParam;<br />
public int ulMaxCost;<br />
public int ulMinRcvBw;<br />
public int ulMaxConnLatency;<br />
}<br />
<br />
[DllImport("cellcore.dll", SetLastError=true)]<br />
private unsafe static extern int ConnMgrEnumDestinations(<br />
int nIndex,<br />
CONNMGR_DESTINATION_INFO destinationInfo<br />
);<br />
<br />
[DllImport("cellcore.dll", SetLastError=true)]<br />
private unsafe static extern IntPtr ConnMgrEstablishConnection(<br />
CONNMGR_CONNECTIONINFO pConnInfo<br />
);<br />
<br />
public ConnMgr()<br />
{<br />
}<br />
<br />
public static unsafe bool EnumDestinations(int nIndex, out Guid guid, out string description, out int error)<br />
{<br />
int result;<br />
<br />
CONNMGR_DESTINATION_INFO connMgrDestinationInfo = new CONNMGR_DESTINATION_INFO();<br />
<br />
fixed (char* pDescription = new char[129])<br />
{<br />
connMgrDestinationInfo.guid = Guid.Empty;<br />
connMgrDestinationInfo.szDescription = pDescription;<br />
<br />
result = ConnMgrEnumDestinations(nIndex, connMgrDestinationInfo);<br />
<br />
error = Marshal.GetLastWin32Error();<br />
<br />
if (result == 0)<br />
{<br />
guid = new Guid(connMgrDestinationInfo.guid.ToString());<br />
description = new string(pDescription);<br />
}<br />
else<br />
{<br />
guid = Guid.Empty;<br />
description = "";<br />
}<br />
}<br />
<br />
return (result == 0) ? true : false;<br />
}<br />
<br />
public static unsafe IntPtr EstablishConnection (Guid guid)<br />
{<br />
CONNMGR_CONNECTIONINFO connectionInfo = new CONNMGR_CONNECTIONINFO();<br />
<br />
connectionInfo.cbSize = Marshal.SizeOf(connectionInfo);<br />
connectionInfo.dwParams = CONNMGR_PARAM_GUIDDESTNET;<br />
connectionInfo.dwFlags = 0;<br />
connectionInfo.dwPriority = CONNMGR_PRIORITY_USERINTERACTIVE;<br />
connectionInfo.bExclusive = false;<br />
connectionInfo.bDisabled = false;<br />
connectionInfo.guidDestNet = guid;<br />
connectionInfo.hWnd = IntPtr.Zero;<br />
connectionInfo.uMsg = 0;<br />
connectionInfo.lParam = 0;<br />
connectionInfo.ulMaxCost = 0;<br />
connectionInfo.ulMinRcvBw = 0;<br />
connectionInfo.ulMaxConnLatency = 0;<br />
<br />
return ConnMgrEstablishConnection(connectionInfo);
}<br />
}<br />
}
Test function:
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
int nIndex = 0;<br />
Guid guid = new Guid();<br />
string description = "";<br />
int error = 0;<br />
bool result = true;<br />
<br />
textBox1.Text = "";<br />
<br />
while (result == true)<br />
{<br />
result = ConnMgr.EnumDestinations(nIndex, out guid, out description, out error);<br />
<br />
textBox1.Text += "Win32Error = " + string.Format("{0:X}", error) + "\r\n" +<br />
guid.ToString() + "\r\n" +<br />
description + "\r\n";<br />
<br />
if ((result == true) && (nIndex == 4))<br />
{<br />
ConnMgr.EstablishConnection(guid);<br />
}<br />
<br />
nIndex++;<br />
}<br />
}
|
|
|
|
|
Hi,
1) In my MFC application,i have implemented OnDraw() function to display controls in a view.But i see that OnDraw() function is called manytimes by default.Is this s bug in MFC?.
How to avoid OnDraw()?
2)When i avoid OnDraw(),when i try to manually load and unload accelarator(soft keyboard in PPC) the view is not redrawn.The view moves up.
Pls help..
I really apprecite the help?...
Thnks in advance
Ram
|
|
|
|
|
As the subject line indicates, I'm having problems implementing tooltips on toolbars other than the one default bar in an eVC4 MFC app for the PPC2003. I've tried every means I can think of, from raw TB_SETTOOLTIPS messages to resource string table strings. Nothing seems to work - instead of a tooltip, I get the tap-and-hold animation. Oddly, it does work in WTL, with no trouble.
Does anyone have a solution, or know of a documented bug that would explain this (mis)behavior?
Thanks for your time.
|
|
|
|
|
To disable the tap-and-hold animation, handle the WM_LBUTTONDOWN message this way:
void CMyToolbar::OnLButtonDown(UINT nFlags, CPoint point)
{
Default();
}
This will allow your toolbar to handle stylus taps without running the flawed logic of MFC's default handler.
Regards,
João Paulo
|
|
|
|
|
Works like a champ.
You da man, João.
|
|
|
|
|
I developed a small app for my PDA with EVC++3. It runs perfectly on my PocketPC, which runs on PPC 3.0 (that what "info" says, it is usually called PocketPC 2002, right?).
Now i wonder if I can run this programm on another PDA that runs on PPC 4.2 (that's called PocketPC 2003, right?).
Is that possible??
I copied the .exe on the PPC03 and i could even start it. however, my app reads pictures from files and those were not shown on PPC03 while there were no problems on PPC02.
Then I wanted to change some code and let EVC++ copy the programm on the PPC02. This wasn't possible (Platform Manager problems).
Would this be possible at all?
thx, Daniel
|
|
|
|
|
The answer to the first question is yes: you can run on a Pocket PC 2003 application that were developed for the Pocket PC 2002.
As for the second question, everything should be working correctly, unless you are using an API that behaves differently (!?!?). How are you loading the images?
Regards,
João Paulo
|
|
|
|
|
I AM using some APIs and Libs and those are probably the reason, but I have no idea what to do.
I read html-files and jpg-files and display HTML on the screen.
I use
- ReadFile() to read the html-file,
- VOImage to read the jpg-files (http://www.pocketpcdn.com/libraries/voimage.html / http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k/html/ppc_viewer.asp ), and
- CSTHtmlDialog to show the HTML (http://www.codeproject.com/ce/sthtmldialog.asp).
Do I need to copy or register anything on the PPC Device? For PPC02 I always used EVC to upload my app to the device, but on PPC03 I had to copy the .exe manually. Is that the problem?
(By the way: If I copy the exe out of ARMDbg instead of ARMRel, my app won't even start on the device).
What is also strange: If I start the app and a HTML-page with some images is shown, the images are shown for about 0.1 secs and then they are replaced by the typical red [x] symbol.
??
thx, Daniel
|
|
|
|
|
I added WM_CLOSE handler via class wizard in CMainFrame. It deleted other two afx_msg handlers from mainframe.h
Although I pasted the two handlers declarations again, just wondering what is the reason behind this...
Any ideas?
|
|
|
|
|
What handlers did it delete?
Regards,
João Paulo
|
|
|
|
|
Hi,
I have a problem with the AppWizard-generated code of eVC4 and I have no idea what's wrong with it. Any help is appreciated.
I generate a new application "Test" with the AppWizard:
- Single document with DocList
- Windows Sockets, ActiveX Controls and Shared New disabled
- Basic MenuBar
- Source File Comments enabled
- Statically linked MFC Library
- Base class "CFormView" for my view class "CTestView"
After building the project I run the application. Now I would expect my view to show the contents of the associated dialog ressource (some static content generated by AppWizard like "TODO: Add controls"). But the only thing I get is a white, empty window.
What am I supposed to do?
(You can find the files at http://www.ralf-limbacher.de/eVC4/Test.zip.)
Thanks in advance
Ralf
|
|
|
|
|
I just have a XML document which is generated by my ASP script.
Now I want to download it and tranform it to the PDB format.
It must be done absolutely automatic by my ASP script from download to transform.
Now I have a problem,how can I tranform it from the XML format(it is just like a plain txt) to the PDB format.
I'm a freshman in this area.I used to refer to this page
http://www.palmos.com/dev/support/docs/fileformats/front.html
for the information of the PDB format.
All I know is the PDB format have a PDB header and the list of the records' entry.
Please help me,every tips will be appreciated.
|
|
|
|
|
Hello !
I have a really strange problem:
I write a string to a file:
<br />
FILE* pFile = fopen("profile.tmp","w");<br />
....<br />
...<br />
...<br />
char Buff[256];<br />
sprintf(Buff,"\n[%s]\n",mainkey);<br />
fputs(Buff,newfile);<br />
The instruction fputs fire an exception: "First chance excepetion: access violation"
I checked the string, it's perfectly correct and the file handle is valid. I cannot find any solution to this problem !!
Please give me some clues....
Thanks
|
|
|
|
|
What is the platform?
Regards,
João Paulo
|
|
|
|
|
|
Does the value of mainkey fit into the buffer?
By the way, why are you using ASCII text instead of Unicode?
Regards,
João Paulo
|
|
|
|
|
Yes everything is correct.
I use ASCII instead of unicode because it has to be compatible with my library that has been developped for the desktop computer. I cannot write everything again.
But the bug is solvedf but I don't have an explanation. I was using _wfopen instead of fopen (with TCHAR string). So I changed it and now that works
|
|
|
|
|
Hello !
Has anyone here yet ventured into the world of Symbian or Series 60 development ? What tools do you use ? As far as I know, the Series 60 SDK and it's tools are a piece of crap: a bunch of script-driven gcc-tools.
I've heard about the Borland Mobile Studio but it doesn't seem to be available for purchase yet.. Is it even released yet ?
Any other options you would recommend ? I do have the Visual Studio solution already with the script-driven tools, but like I said, they are an abomination to application development: even a crude Unix hack looks smoother than this package..
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Antti Keskinen wrote:
Has anyone here yet ventured into the world of Symbian or Series 60 development ?
Yes!
Antti Keskinen wrote:
What tools do you use ?
The Visual Studio 6 setup.
Antti Keskinen wrote:
As far as I know, the Series 60 SDK and it's tools are a piece of crap: a bunch of script-driven gcc-tools.
They look worse when you start using them. After a while... Well, integration is not their forte...
The tools are a bit crude, as you say. But if you look under the covers you will find some gems thet will make your life less miserable. Anyway, it's a sizeable learning curve...
Good luck!
Regards,
João Paulo
|
|
|
|
|
Hello !
This may be a stupid question, but how can I reinstall my PocketPC (like formating it...) ?
I need to know exactly wich ressources I need for my applications to run and so I must start on a 'new' Pocket PC.
Thanks
|
|
|
|
|
You can't, but what you can do is clear the memory.
Look up 'hard reset' or 'cold reset' in the device's manual. If you really can't find it, try doing it in code[^].
|
|
|
|
|
hello,
I need to use the function CoCreateFreeThreadedMarshaler in my Application for Pocket PC 2003 (eVC++ 4.0) but despite the MSDN site mentionned that ole32.lib exports it since winCE 3.0, this function not appears in my ole32 (SDK for PPC).
So anyone has an idea of what I can do with it ?
thx for help !
|
|
|
|
|
Hi All,
Are there any free printer libraries for Windows CE?
Mahesh
|
|
|
|
|
You could try the HP mobile printing SDK:
http://www.hpdevelopersolutions.com/mobile/index.cfm
|
|
|
|