copying and pasting in c# (visual studio) - Windows Mobile Development and Hacking General

hi,
i have a problem with visualstudio .net framework 1.1
in my application, i define a context menu and a copy and paste menuitems.
in the correspondent function, i access to the Clipboard object
but the system generates a compilation error: The clipboard object is not defined.
the help contains a reference to the Clipboard class, and the examples of the msdn uses them !!
help me, please.
thank's

I have read that you need cpf 2.0 to access the clipboard idataobject. I have not tried it because I have had too many other problems with the compact framework and now only do win32. It seems to me that there is something funny going on with the clipboard and that mcrosoft have been trying to make it look like its implemented properly when in fact it is not. Look at real software like resco file explorer and see that even they could not find a way to access it. You cannot copy from file explorer to resco file explorer. There is also no help from drop files structure that a pc windows program may use to get the data object. If you do get the clipboard to work properly in cpf2.0 I would love to know if the data object can be used to access the information about the location of files or if it is only useful for framework related purposes.

hi,
if i install the cpf2 and i compile my application with them,
the application works in a pocket with cpf1 or not ?
thank's

It would not work unless the ppc had the 2.0 redistibutable. Its free so you clould just include it in your instalation.

Related

Genius 0.19

Dear All,
I have developed my first PocketPC game (see attached). It is similar to Master Mind but using numbers. This is the way we play it in Iraq
I would like some help in making an installation that automatically create a shortcut in Windows\Start Menu\Programs\Games. I am planning to publish the game as a freeware.
I am using VB .NET 2005 (.NET FX 2.0) so if I can include the re-distribution libraries that would make it easier for users, else I may need to point them at a link.
I used 2 different installtion builders but both only copy the CAB file to the Program Files but not make a shortcut for it. I have an *.inf file and haven't used the command line setup builder yet unless I have to.
Any easier way please?
ThanQ.

Hook winsock API calls in WM5

My goal is to get the TCP data from a TCP application on the pocket pc
like data from internet explorer or active sync. I want to write a proxy
that forwards all TCP data to the application server (Web server,...).
So I have tried to replace the ws2.dll with a wrapper dll that forwards all
winsock API calls to the original ws2.dll. But when I replace the ws2.dll file
with my own and make a softreset the device hangs in boot screen and
I must do a hardreset. Could not get this to work on WM5 but it works great
on WM2003 devices.
So I have tried another thing. Have heard about API hooking and want to
try this with winsock API functions (connect, WSAConnect, send, recv,...).
After several days of investigation in some forums I have found many
informations about API hooking and API sets win WM5. But when I look
deeper there is no server process for winsock API calls. So I cannot
change the method adresses.
Another idea was to hook LoadLibrary() API function and when ws2.dll is
loaded from an application I will load my own dll and forward all calls to
the original ws2.dll. But LoadLibrary() has also no server process.
Has anybody another idea how to do this?
Thanks for any information on this.
Houser
Hi Houser!
I think the reason your original method failed on WM5 is because all system DLLs must be signed or the system will not load them.
There are several threads on this forum (sorry, can't remember precise link right now) that explain how to create\use certificates, and sign files, so just search for that.
Good luck.
Thanks levenum for your reply.
I also have thought about signing the dll but I have disabled certificate
check on the WM5 device with the Cert_SPCS.CAB file and now
my system loads every dll without asking the user.
I have written some test applications that explicite load my ws2.dll with
a different name (ws2xx.dll) and then in my ws2xx.dll I load
the org ws2.dll from \windows dir and all worked fine. I can use
any winsock function and can make TCP connects and so on.
So I think signing is not the problem, only when I do not use
the Cert_SPCS.CAB file to disable it?
Or are system file always checked at boot phase?
That would then explain the problem maybe.
Regards
Houser
I am pretty sure system files are treated separately. I once used a device with no cert ROM, which ran all programs and loaded DLLs without asking for certificate, but refused to do so for system files (MUIs).
I think you should give certificates a chance before moving on to more complicated solutions.
So I should try to sign my wrapper dll with a certificate.
So I will try to sign with the Visual Studio 2005 developer
certificate. And then I must install this certificate on my device
so that the system trusted the dll file with this certificate?
Houser
Another thing: What do you mean with MUIs?
That's correct.
There are provisioning CABs in the 2005 SDK. You just run them on your device and they insert all the test certificates.
SDK also shows how to provision devices through RAPI, but most WM5 ROMs block that option.
Also you should use the 'privileged' execution certificate to make sure you have maximum access to the system.
MUIs are duplicate system DLLs that contain resources for other languages. For example: coredll.dll.0409.mui will contain English resources for coredll.dll (409 is hex for English code page). They are used to switch interface languages both on PC windows and mobile. (Metalanguage User Interface).
P.S.
If you want, there are XML templates for provisioning CABs in the SDK, and makecert.exe that let you create your own certificate and put it on the device.
Another thing: What do you mean with MUIs?
So I have tried this:
1) Installed the SdkCerts.cab certificates on the device (copied the file on
the ppc and tap in explorer on it) A success message was displayed from
the setup process.
2) In VS2005 I have set in the project settings the cert signing to "Sample
Privileged Root for windows mobile SDK" certificate and rebuild my dll.
In the dll file properties I can see the certificate.
3) Have copied my ws2.dll file to \windows and replaced the org ws2.dll file
there, my dll loads a copy of the org ws2.dll (ws2copy.dll) that is also
in the \windows dir
4) Then the big moment: Soft reset and..... hanging again in boot screen
The installed certificates did not appear in the pocket pc certificate manager.
Do you know if they should appear there or not?
Maybe the SDK certificates are not imported correctly?
Thanks for you help!
Houser
I'm sorry my solution didn't help.
The test certificates do not show in the list (don't know why).
The way I see it there are two possibilities:
1. I was wrong about the certificates. (Though I think you may still need them)
2. There might be a problem with the copy DLL you try to load (ws2copy.dll). Is it from a good dump? Have you tried loading it from a test app? Is it signed? I think it needs to be signed to.
Sorry I can't give you advice on an alternate way. Insufficient knowledge...
It is very frustrating, I do not knwo how many
hard resets I have made in the last few weeks. :?
I have written a test app that loads my winsock dll file and
then my dll loads the copy ws2.dll file. The copy ws2.dll file
is from a platform builder 5.0 build.
These tests with my test app all worked fine, I can make TCP connects
and do all the winsock stuff like I load the org ws2.dll file directly.
I have even disabled certificate check on the device and tested
with unsigned dll and it works too.
The copy dll from PB 5.0 is not signed. may be this could
be a problem when my dll is loaded in boot time.
Do you know a way to sign the copy PB dll with the SDK certificate?
Thanks man!
Houser
Signing files (DLL, EXE, CAB) is very easy. In the SDK, there is a file called signcode.exe. It will give you a step by step wizard to sign the file. The only additional thing you will need is the certificate files themselves which should also be in the SDK.
Got it to work with signing the copy dll file and
now after soft reset my device does NOT hang. :lol:
Many thanks for your support levenum!
That is very good but now I have figured out that
I cannot make a localhost connect on a local tcp port
on the device. That has something to do with WM5
because it was working under Wm2003. Strange..very
strange.
Houser

Java Midlet Question

I really want to use a name picker (randomly picks a name from a pre-defined list)
Google reveals this java version is exactly what I need for a desktop
Is there any way I can use it on the pocket pc (does not work in midlet manager)
http://www.davebsoft.com/jaws/apps/namepicker.jnlp
You normally need a jar version of the program to work with midlet manager - best you do a search for a jar version.
The author kindly sent me his JAR file for this app. I have placed it onto my device but cannot open it
Is it incompatable or am I making a silly mistake
Thanks
Hays
Is that the zip he sent you or did you send you a jar file? Even when i rename it namepicker.jar it wont install, i am sure there is something wrong with the file.
Is that the zip he sent you or did he send you a jar file? Even when i rename it namepicker.jar it wont install, i am sure there is something wrong with the file.
he sent this text in his email
The jar file is here, but it probably isn't set up the way you need it:
http://davebsoft.com/jaws/apps/lib/namepicker.jar
I downloaded it but can't get it working
yep - still says invalid - contact the author again he must have a valid jar that works
will do
thanks for your help
the author replied
"invalid" in what context? It's valid in the context in which you've been
running it on your PC or whatever. Maybe it lacks a manifest file or
something. There are free tool to extract and rebuild jar files.
The message it gives is that it has an 'invalid java application desciptor' i.e. the jad part of the jar is wrong.
just a guess, but its probably made for jave for desktops, not j2me.
OMG. The Java that is written is for PC (or eqv) Java not for Java for phone (eg. midlet). That's why it doesn't run. Midlet is a very small subset of the real Java, the code is different, and there isn't much function in midlet version of java, and it is a pain to program in midlet-java (whatever you call it). Hence the JAR is not working. Try running it on your PC, it will work.
No, you can't extract it and run it on your midlet-enabled phone. No, even if you have the source, you can't do that either, unless you translate the code manually. I don't think there is a converter for that matter, especially it involved GUI.
That explains it
Anyone up for the challenge of writing a good pocket pc version ??
Hays
Try this one...
This is an OSS JVM that's meant to be J2SE compliant so it might just run. Try your luck.

Mobile file paths in MS Visual Studio 2005

Hi all,
my father got MS Visual Studio 2005 some time ago and I just discovered that it's capable of creating mobile applications as well so I'm playing with it, trying to do some cool stuff (program for recording my marks at school atm ). The fact is, that I'm not extremely experienced in C# (in which I'm working in the MSVS2005) so I have to look up syntaxes or parts of code in help database every now and then. I have always succeeded so far, but now I have a problem I need someone to help me with.
I just started working with files, everything is fine, I think i quite understand the syntax and stuff, but I can't figure out how file paths under Windows Mobile work. In help file, they say that this should work:
string path = @"c:\temp\MyTest.txt";
but i think this is for desktop Windows only. If I try to use this in my programme, "Catch (Exception Ex)" command returns error saying: System.IO.DirectoryNotFoundException.
I tried various variants of the file path and the only one working was just plain name of file, for example
string path = @"MyTest.txt"
This way, I managed to write into the file and read the input back..but I couldn't find the file anywhere in my phone's memory :S
So if there was someone who would be so kind and told me how to specify file paths under WM correctly, I would really appreciate it. btw if the "someone" gave me his MSN/ICQ too, and was willing to give me real-time help once a time, it would be absolutely perfect
The root of the Windows Mobile filesystem is "\". If you want to place the file in the temp dir of the root, use this:
string path = @"\temp\MyTest.txt";
Øystein

SlimServer Client developement - HELP NEEDED with XML

Hi there...
I have embarked upon the developement of a slimserver client for the pocket pc using c#. There is no decent one around that I know of!
Anyway, it is going to be open sourced, and I have already implemented the use of the CLI interface. however, I am a bit stuck with the XML one. I have attached the relevant sources! The problem is that when it runs through the emulator, it is unable to deserialise a slimserver xml file and returns a NotSupported Exception (I have attached a sample xml file). I generated a c# class library for slimserver's xml schema using xsd.exe.
The funny thing is that when I run the compiled .exe file in windows (without the emulator), it runs smoothly, and deserialises it perfectly! It also works when compiled for a normal desktop application!
Could someone help please?

Categories

Resources