|
how to p/invoke ImageCodecInfo on .net CF 2.0?
i want to change jpeg compresion:
http://www.bobpowell.net/jpeg_compression.htm
maybe there is another solution?
|
|
|
|
|
I have a WM5 .NetCF 2 C# application written in VS2005.
It has alot of menus and at runtime I change which ones are displayed depending on which screen is being shown to the user. After a while the MenuItem.Click event stops working, strangly the MenuItem.Popup event still works. I've trimmed back to test appliction to reproduce the problem:
Create a new application, add a button with the following Click code:
private void button_Click( object sender, EventArgs e )
{
for ( int i = 0; i < 5000; i++ )
{
button1.Text = i.ToString();
Application.DoEvents();
mainMenu1.MenuItems.Clear();
mainMenu1.MenuItems.Add(menuItem1);
}
}
Create a menu structure with 20 items like the following:
MyMenu
|
1--1A
| 1B
| 1C
|
2--2A
2B--2BX
| 2BY
| 2BZ
2C
...
Add the following code to some of the menu items:
private void menuItem_Click( object sender, EventArgs e )
{
MessageBox.Show("Click");
}
Run the application, test the linked up menuItem to check the message is shown, press the button, wait for it to finish, try to press the menuItem, nothing happens. Please help.
Mark
|
|
|
|
|
This has now been added to the MS Connect Portal:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=358752
|
|
|
|
|
Is there a way to make the standard controls (created by CreateWindow) to look transparent (to see the background under them)?
I'm writing in native C++ with VS2005 for WM 5.0.
P.S. Since WM_EX_TRANSPARENT constant is not declared I assume it doesn't work.
(o boy, I'm getting sick of so many things that don't work on WM 5.0)
|
|
|
|
|
Hi,
I have developed a compact framework application with target platform as Windows mobile 6.0, Now I am trying to run the application on Windows Mobile 5.0 too, for that I change the target platform to "Windows Mobile 5.0 Pocket PC SDK" for each of the project in my solution.
When I debug my application from Visual Studio, the application runs fine but when I try to run application from installing using Cab setup project, it shows the "InvalidProgramException". Kindly reply if I am missing some step.
After changing the target Platform, I add the project output again, and also I am using localization resources for multiple language support.
Thanks in advance
|
|
|
|
|
When I use mapirule.dll like this way:http://msdn.microsoft.com/en-us/library/aa446561.aspx[^]
I get a error "Could not find P/Invoke dll 'mapirule.dll' "
Who can help me to resolve this problem?
I'm sure the mapirule.dll is exist both the program's directory and ./Windows directory.
Thanks very much.
|
|
|
|
|
Hi,
unmanaged code DLLs are looked up through the PATH evironment variable, which holds a list of folders.
So they all must reside in folders from that list.
Furthermore if one such DLL calls for another one, the second one must be either in the same folder,
or in a folder DOWN the list (not sure which it is).
It is often a good idea to prefix ".;" to the PATH so the own folder is looked in first.
Hope this helps.
|
|
|
|
|
|
I tried to write a program that involved a file opening, reading, and wrting to a text file in vb.net 2003. It works well in vb.net 2003 but when I use it in vb.net 2003 for my pocket pc application, it does not read, nor write, only opens the file. Can you help me??
Here is the code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sFileName As String = "\Test.txt"
Dim myFileStream As System.IO.FileStream
Try
'We have our variables, lets attempt to open it
myFileStream = New System.IO.FileStream(sFileName, _
FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite)
Catch
'Make sure that it exists, and if it doesn't display an error
MessageBox.Show("Cannot not open the file. Make sure in the location shown.")
Finally
'It works, but we are going to try one last method
If myFileStream.CanRead = True Then
'This is where we would read from the file
Label6.Text = "File opened!"
txtFileDisplay.Text = "File opened!"
'We are done with the file now, so close it
myFileStream.Close()
End If
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Declare those variables!
'Dim sFileName As String = Application.StartupPath & "\VB.txt"
Dim sFileName As String = "\Test.txt"
Dim myFileStream As New System.IO.FileStream(sFileName, _
FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None)
'Create the stream writer
Dim myWriter As New System.IO.StreamWriter(myFileStream)
'Write in what is in the text box
'myWriter.WriteLine("It works, thank God!")
myWriter.WriteLine(txtFileDisplay.Text)
'Flush before we close
myWriter.Flush()
'Close everything
myWriter.Close()
myFileStream.Close()
'Clear the text
Label6.Text = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Declare any variables
Dim sFileName As String = "\Text.txt"
Dim myFileStream As New System.IO.FileStream(sFileName, _
FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read)
'Create the StreamReader and associate the filestream with it
Dim myReader As New System.IO.StreamReader(myFileStream)
'Read the entire text, and set it to a string
Dim sFileContents As String = myReader.ReadToEnd()
'Print it to the textbox
'Label6.Text = sFileContents
txtFileDisplay.Text = sFileContents
'Close everything when you are finished
myReader.Close()
myFileStream.Close()
End Sub
End Class
|
|
|
|
|
hi,
recently i have create file in PockectPc Application in VB2005. I simply paste the function which i used in my application
Private Function createText() As Boolean
Dim LineIn As String
Dim NoOfTime As Integer
LineIn = ""
If File.Exists("\Windows\28081980-ef") Then
Dim oFile As System.IO.File
Dim oRead As System.IO.StreamReader
oRead = oFile.OpenText("\Windows\28081980-ef")
While oRead.Peek <> -1
LineIn = LineIn & oRead.ReadLine()
End While
oRead.Close()
'MsgBox(LineIn)
NoOfTime = CInt(LineIn)
If NoOfTime > 4 Then
Return True
Me.Close()
Else
NoOfTime = NoOfTime + 1
Dim oWrite As System.IO.StreamWriter
oWrite = oFile.CreateText("\Windows\28081980-ef")
oWrite.Write(NoOfTime)
oWrite.Close()
End If
Else
Dim oFile As System.IO.File
Dim oWrite As System.IO.StreamWriter
oWrite = oFile.CreateText("\Windows\28081980-ef")
oWrite.Write(NoOfTime)
oWrite.Close()
End If
Return False
End Function
hope this works for vb2003
|
|
|
|
|
Thank you, but it did not work.
|
|
|
|
|
Hello!
I'm trying to send a string from my PDA using the serial port. My aim is to send a string containing the latitude and longitude over to the desktop so that I'll use those coordonates in google maps.
Although I thought it would be easy, it seems I cannot send anything from the PDA ... at least HyperTerminal doesn't show anything.
My PDA is Pocket Loox N560 and I have a dll required to use the serial port.
The code I use is very simple:
serialPort1 = new System.IO.Ports.SerialPort("COM1", 9600, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One);
serialPort1.WriteTimeout = 2000;
serialPort1.Open();
serialPort1.Write("Hello World");
serialPort1.Close();
As you can see, I'm using C#. I need your help because I have a deadline and I can't figure out what I'm doing wrong. Any code is welcome
|
|
|
|
|
Try "COM1:" instead of "COM1"
(in C++ native work this way. I spend couple of hours until I found this)
|
|
|
|
|
Hi,
I have developed an application in eVc++4 on ARMV4I device. At present the application is ready adn in testing phase. Before handing over the final version, I want to know how to do the following:
1) The user should able to start the application only once i.e. if the application is already running, the user shouldn't be able to open another time the application.
2) Create a setup for the application. I want to restrict the setup being used only 3 times. Creating shortcut on desktop will be handled with the setup.
3) Add the application in the start up.
Any helpline and guidance for the above is highly appreciated.
Thanks
Terry
|
|
|
|
|
Hi
This is regarding getting tranparency effect for controls in .net compact framewok.
I want to have few icons diplayed in the form of tiles with their caption below. For the icons image, I am using png files. The icon is nothing but a tranparent custom control(image and below a label for the caption), on top of another transparent panel, which is again on top of a form. Now I am getting the transparent effect but the border of the png files is not coming as smooth. Some white color border is getting displayed which makes the image look a bit jagged.
I would be highly obliged to you for any help from your side. For any clarifications please revert.
Thanks and regards
Subasish
|
|
|
|
|
I need to add animated image to smart application. I use picture box controler for that. But the gif image is not animated. Please help me
ssss
|
|
|
|
|
Answered in a forum you cross posted to. If you can't find it, you posted too often... - Iain.
|
|
|
|
|
I have such problem, I am developing an mobile application by using C# smart device. When I get a string from java webservice I got ????, it should be thai font. How can I solve those problem. I tried creating windows app calling the same service. It works just fine. And I found UriFormatException. What does it mean, and how to solve it? thanks
|
|
|
|
|
Can somebody give me a hint how to use GDI+ in WM5.0 but without CF.
I'm sure that there is opportunity to use GDI+ on WM, because trough CF you could use it.
I saw in Windows folder "gdiplus.dll", but there is no library, no .h file for C++ to use it. Also few of samples in WM 5.0 SDK use "imaging.h" which uses some of the GDI+ declarations.
P.S. My goal is to draw PNGs transparently, which trough GDI+ is peace of cake. If you know other alternative, please share with me!!!
modified on Tuesday, July 8, 2008 2:50 AM
|
|
|
|
|
Hi u can try IImage apis these work perfectly fine
There is imaging sample in windows sdk.i had tried alphableding but that creates some problem so i opt for iimage.
|
|
|
|
|
IImage works fine. Good alternative for GDI+ for reading images (and for alphablending of course)
Thank you very much!!!
P.S. IImage draws a little bit slow ... I wonder is ALPHABLEND function s faster? Wwhat problems you had with it?
|
|
|
|
|
Hi,
Im trying to do video streaming by using the dll provided in the wimo library. The idea is to take snapshots of the video stream,
However, every image taken by wimoNative dll when saved to a file, always gives me a black blank image.
Can someone tell me wats wrong pls?
thanks in advance.
badly need help
==================== Code from wimoNative dll=====
// Used to open the camera. We build the DirectShow graph, instantiate
// and hook up all of the Pins and return the handle to the camera object.
extern "C" __declspec(dllexport) HRESULT OpenCamera(DWORD dwResolutionId, HANDLE* hCamera)
{
CameraInfo* pci = new CameraInfo();
HRESULT hr = S_OK;
// create the Graph and the GraphBuilder.
pci->pGraph.CoCreateInstance(CLSID_FilterGraph);
pci->pCaptureBuilder.CoCreateInstance(CLSID_CaptureGraphBuilder);
// set the graph for which the GraphBuilder is going to work on.
pci->pCaptureBuilder->SetFiltergraph(pci->pGraph);
// get the IMediaControl interface
pci->pGraph.QueryInterface( &pci->pMedia );
// We want a video capture filter
pci->pVideoCaptureFilter.CoCreateInstance( CLSID_VideoCapture );
pci->pVideoCaptureFilter.QueryInterface( &pci->pPropertyBag );
pci->PropBag.Write( L"VCapName", &GetCameraDeviceName());
pci->pPropertyBag->Load( &pci->PropBag, NULL );
// set the filter to capture at the resolution specified.
SetCameraResolution((HANDLE)pci, dwResolutionId);
// add this video capture filter that we just set up to the main graph
hr = pci->pGraph->AddFilter(pci->pVideoCaptureFilter, L"Video Capture Source");
// create the ImageSinkFilter. This is the filter that takes the image from the video
// stream and saves it to a file when the graph is "triggered"
hr = pci->pImageSinkFilter.CoCreateInstance( CLSID_IMGSinkFilter );
hr = pci->pGraph->AddFilter( pci->pImageSinkFilter, L"Still image filter" );
hr = pci->pCaptureBuilder->RenderStream(
&PIN_CATEGORY_STILL,
&MEDIATYPE_Video,
pci->pVideoCaptureFilter,
NULL,
pci->pImageSinkFilter );
hr = pci->pImageSinkFilter.QueryInterface( &pci->pFileSinkFilter );
// create the video control instance so that we can trigger the ImageSink
// to take a snapshot
hr = pci->pVideoCaptureFilter.QueryInterface( &pci->pVideoControl );
hr = pci->pVideoCaptureFilter.QueryInterface( &pci->pUnkCaptureFilter );
hr = pci->pCaptureBuilder->FindPin(
pci->pUnkCaptureFilter,
PINDIR_OUTPUT,
&PIN_CATEGORY_STILL,
&MEDIATYPE_Video,
FALSE,
0,
&pci->pStillPin );
// internal flag noting that the graph is not running at the moment.
pci->bRunning = FALSE;
*hCamera = (HANDLE)pci;
return hr;
}
// TakePicture "triggers" the filter graph, which causes a snapshot to be saved into
// the specified file.
//
// hCamera is the handle to the camera
// szFileName is the filename to which to save the image
extern "C" __declspec(dllexport) HRESULT TakePicture(HANDLE hCamera, LPTSTR szFileName)
{
HRESULT hr = S_OK;
CameraInfo* pci = (CameraInfo*)hCamera;
// if the camera is not already running, let's turn it on.
if (!pci->bRunning)
{
int msgboxID = MessageBox(
NULL,
(LPCWSTR)L"Not Running",
(LPCWSTR)L"Bugger",
MB_ICONWARNING | MB_DEFBUTTON2
);
hr = pci->pMedia->Run();
pci->bRunning = TRUE;
if (!pci->bRunning){
int msgboxID = MessageBox(
NULL,
(LPCWSTR)L"Not Running",
(LPCWSTR)L"Bugger",
MB_ICONWARNING | MB_DEFBUTTON2
);
}
}
// sets the filename to save the image as and then triggers the snapshot
hr = pci->pFileSinkFilter->SetFileName( szFileName, NULL );
CHK( m_pCaptureGraphBuilder->FindPin( pUnkCaptureFilter, PINDIR_OUTPUT, &PIN_CATEGORY_STILL, &MEDIATYPE_Video, FALSE, 0, &pStillPin ));
CHK( m_pVideoCaptureFilter.QueryInterface( &pVideoControl ));
hr = pci->pVideoControl->SetMode( pci->pStillPin, VideoControlFlag_Trigger );
return hr;
}
==============================End============
|
|
|
|
|
Hi,
I want to run my program in an emulator.I am using evc++ 4.0. My cpu is Armv4i.The OS of the device is Windows CE 5.0. The program is working in the device but it didn't work in the emulator (Windos CE 5.0 Emulator).this is my first time to use an emulator so what can I do to run the program? When I try to run the exe file in the emulator which is working in device, it is giving an error like that "test.exe is not a valid windows CE application"
Thanks,
ibrahim
|
|
|
|
|
Ibrahim,
You must have set your CPU of your device. From project->Settings, select WinCE Emulator from drop down or Select StandardSDK from the toolbar option & Rebuild again & then run. But doing so, the program will use standard sdk & compile & not based on Armv4i. For such CPU's got to run via device only, no other alternative.
Hope this helps.
Thanks
Terry
|
|
|
|
|
can someone tell which institute offer quality training in mobile application using vb 2008 in india
|
|
|
|
|