|
I am attempting to access these functions through a .NET wrapper. I am using P/Invoke, but I am having very little success. Does anyone out there have an example of how to do this? When I can get it compiled and the call made, I get a NotSupportedException returned with very little explanation. Other times, I can't get it to compile because I have been unable to fill the Long variable (acting as a LPWIN32_FIND_DATA object) I am passing to the function call properly prior to use.
Any thoughts on this?
Thanks
Dan
|
|
|
|
|
Hi,
FindFirstFlashCard and FindNextFlashCard would be very difficult to P/Invoke in the .NET Compact Framework.
But there is an answer on this here:
http://www.cjcraft.com/DesktopDefault.aspx?tabid=38
Q. How do I find any removable storage devices that may be installed on the Pocket PC device in the .NET Compact Framework.
DirectoryInfo rootDir = new DirectoryInfo(@"\");
FileAttributes attrStorageCard = FileAttributes.Directory |
FileAttributes.Temporary;
foreach( FileSystemInfo fsi in rootDir.GetFileSystemInfos() )
if ( (fsi.Attributes & attrStorageCard) == attrStorageCard )
//Found storage card
|
|
|
|
|
THANK YOU, THANK YOU, THANK YOU! I couldn't understand why there wasn't a way implemented in managed code to find them.
Thanks again
Dan
|
|
|
|
|
Can anyone shade some light, in simple language....what is Symbian OS? Plase also let me know where the potential of Symbian is.
I am a programmer in VB.NET (still on the learning curve). I have read a short article saying VB.NET can be used as a front-End for Symbian. that's where my curiousity comes from.
all your additional comments will be well appreciated.
Ben
|
|
|
|
|
|
Thank you for you reply. Well, to me it appears that CrossFire may be having jobs for VB.NET programmers in the very near future. Working as a programmer in Mobile phone platforms. Is that so?
|
|
|
|
|
This is really strange. I am using Vis. Studio, compact framework, and C#. When I am connected to my network, the emulator comes up, the program starts and Vis studio goes into debug mode, stopping at appropriate break points.
If I disconnect my network (Home LAN), the emulator pops up, the program is loaded, and Vis Studio does not go into debug mode. I can go to the emulator and start the program (by opening file explorer and working my way to the appropriate program file).
I have no idea where to begin looking. Any suggestions???
Thank you
Martin.
camasmartin
hobby programmer
|
|
|
|
|
Try installing the Microsoft Loopback Adapter. This way you wil always have an active TCP/IP connection, even if you unplug the network cable.
Regards,
João Paulo
|
|
|
|
|
THANK YOU. IT WORKED.
I'd still like to figure out what is really happening, but it did work. It took me a while to (1) read your suggestion, (2) unsuccessfully find a loopback adapter, (3) find instructions on the web for making one (Simple!!), and testing it.
Thanks again. I just went on a trip and was able to work detached.
camasmartin
hobby programmer
|
|
|
|
|
I would like to know the java VM for Microcontrollers ?
regards,
karthik bala guru
|
|
|
|
|
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
|
|
|
|