The Wayback Machine - https://web.archive.org/web/20090112221326/http://www.codeproject.com:80/script/Forums/view.aspx?fid=13695
Click here to Skip to main content
5,797,226 members and growing! (18,103 online)
Announcements
* Bold indicates new messages since 12:13 12 Jan '09




BullFrog Power
Advanced Search
Sitemap

Mobile Development


Home > Forums > Mobile Development

 Msgs 1 to 25 of 171 (Total in Forum: 5,072) (Refresh)FirstPrevNext
QuestionDpi-Aware experiments in V.S. 2005 EnvironmentmemberHurricane30001:44 10 Jan '09  
Hi all,

I written the following code to make "DPI-Aware" the ImageSize property of an ImageList Control in my application (V.B. .Net C.F.2) in V.S. 2005 environment:

Dim RK As Microsoft.Win32.RegistryKey = _ Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Drivers\Display\GPE")
Dim LPX As String = CType(RK.GetValue("LogicalPixelsX"), String)
Dim LPY As String = CType(RK.GetValue("LogicalPixelsY"), String)
If LPX = 96 And LPY = 96 Then
Me.ImageList1.ImageSize = New System.Drawing.Size(16, 16)
Else
Me.ImageList1.ImageSize = New System.Drawing.Size(32, 32)
End If

Well, I placed it in the Form1_Load event, and it works.

But with doubt if that place was the "rigth place", I tryed to place it in the "Form1.Designer.vb" code (because I think it is the "more appropriate" place).

I placed the first 3 line in the begin of code:

<global.microsoft.visualbasic.compilerservices.designergenerated()> _
Partial Public Class Form1
Inherits System.Windows.Forms.Form
Dim RK As Microsoft.Win32.RegistryKey = _ Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Drivers\Display\GPE")
Dim LPX As String = CType(RK.GetValue("LogicalPixelsX"), String)
Dim LPY As String = CType(RK.GetValue("LogicalPixelsY"), String)
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)

and the "If-Else" conditions immediately above the ImageList.Add property code:

If LPX = 96 And LPY = 96 Then
Me.ImageList1.ImageSize = New System.Drawing.Size(16, 16)
Else
Me.ImageList1.ImageSize = New System.Drawing.Size(32, 32)
End If
Me.ImageList1.Images.Clear()
Me.ImageList1.Images.Add(CType(resources.GetObject("resource"), System.Drawing.Image))
Me.ImageList1.Images.Add(CType(resources.GetObject("resource1"), System.Drawing.Image))
Me.ImageList1.Images.Add(CType(resources.GetObject("resource2"), System.Drawing.Image))

Also if it's recomanded to not write code-lines directly in .Designer.vb code, the code works correctly in both emulator and device, BUT sometime (I not understood why and in witch circumstances), only the If-Else conditions lines above are deleted and replaced with the single line:

Me.ImageList1.ImageSize = New System.Drawing.Size(32, 32)

And then I must replace it again,

Of course, the problem is only in the debug phase, while after compilation there is no problem on device.

I know that this is a "not easy" question but I hope that someone can help me to clear my ideas about where it's more appropriate to place above code.

Thanks
AnswerRe: Dpi-Aware experiments in V.S. 2005 EnvironmentmemberJoel Ivory Johnson3:42 10 Jan '09  
You had it right the first time with placing the code in Form_Load. The designer section of the code is "owned" by Visual Studio and as you've seen VS does not gaurantee that changes you make to it will be preserved. If you plan to have others use and modify your code then the designer area isn't idea because no one else would know to look there for your code. Other than the Form_Load method the other place to consider would be in the constructor of the form right after the InitializeComponent method is called.

Joel Ivory Johnson
My site: J2i.net
Twitter: J2iNet

GeneralRe: Dpi-Aware experiments in V.S. 2005 EnvironmentmemberHurricane30008:58 10 Jan '09  
Thank you very much Joel!
QuestionV.S. 2005 and Debug environment.memberHurricane30009:44 9 Jan '09  
Hi all.

When I launch my application to be executed in PPC 2003 emulator, in the "Immediate Window" of V.S. 2005, appears 2 times the first error and 8 times the second error.

A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll

The "Error List" is empty (application doesn't contains errors and seems to works correctly).

Application also seems to works correctly in real device.

What can cause above errors, and how I can unnderstand witch piece of code lines that cause them?

Thanks
AnswerRe: V.S. 2005 and Debug environment.memberJoel Ivory Johnson18:41 9 Jan '09  
It's from an exception being thrown and handled. It is safe to ignore.


http://social.msdn.microsoft.com/forums/en-US/vssmartdevicesvbcs/thread/ac29e918-a966-44e8-910b-75c6cc12aabf/

Joel Ivory Johnson
My site: J2i.net
Twitter: J2iNet

GeneralRe: V.S. 2005 and Debug environment.memberHurricane30001:45 10 Jan '09  
Thanks Joel!
NewsNokia Conference got postponedmemberrakesh.rao1:59 8 Jan '09  
Hi guys

Just heard that the Nokia Developer Conference in Bangalore got postponed.

Mighty happy to hear that as I could not register myself earlier. It was supposed to take place on December 10, 2008 now because of terrible Mumbai terror attacks it got postponed to January 20, 2009.

Venue remains the same - Trinity, Taj Residency, Bangalore, India

Just thought there are people like me out there who too missed out earlier. To register and know other details visit www.Nokiadevcon.in
QuestionHow to do Synchronization with back end Database using C#.net 2008memberChanuri22:55 7 Jan '09  
Im doing my projects using
C#.net 2008,
datasource Microsoft SQL Server Compact 3.5
IIS V5.1 development envirnment and BackEnd server IIS V6.0

I tried to do Synchronization different ways but failed.

will anyone help me...... :(
QuestionPDA applicationmembertrimandir prajapati19:41 7 Jan '09  
hi i am developing PDA application. while running my application, when power button is clicked the user is logged on , but after two hours i want user to be logged off and logged on again.
please help me,thank in advance
AnswerRe: PDA applicationmemberJoel Ivory Johnson5:03 8 Jan '09  
For what platform/operating syste are you developing?


When you say "Logged out" do you mean you want the device to lock or you want your application to shut down?

Joel Ivory Johnson
My site: J2i.net
Twitter: J2iNet

QuestionMobile number is displayedmemberParasmani Swamy18:52 7 Jan '09  
Hi all,

I have created an application to send or receive an SMS but eaxh time it is sending an SMS it is showing the message "do you wish to send to +919898989898" and whenever we are trying to access the net through the application it is asking "Allow your application to use network to send or receive data".

I am using Netbeans IDE for creating the application for Nokia N73.

Regards
AnswerRe: Mobile number is displayedmemberLev Danielyan23:56 7 Jan '09  
I guess you are using Java and this is a Java security issue.
AFAIK this is handled by the Java emulator/executing environment.

Regards,
Lev

GeneralRe: Mobile number is displayedmemberChaser922:03 10 Jan '09  
Thank you very much, and possibly do you know how can I assign a managed stream to such handle that I obtain?
QuestionRedirect another process' output to a streammemberChaser929:39 7 Jan '09  
Hello, my application needs to redirect a process' output to a stream, just like Win32's .NET did via StartInfo.RedirectOutputStream, but this function is missing in CF.
Is there another way (maybe via P/Invoke?)

Greetings
AnswerRe: Redirect another process' output to a streammember Randor 14:55 7 Jan '09  
You seem to be searching for a managed method for accomplishing your goal. Unfortunately I don't know if there is other managed ways to redirect standard I/O.

What I can tell you is that the unmanaged Win32 API that redirects standard devices is the SetStdHandle Function[^].

Good Luck,
-David Delaune
GeneralRe: Redirect another process' output to a streammemberChaser922:56 10 Jan '09  
Which library contains the procedure in WinCE? this example seems to work only for Win32
GeneralRe: Redirect another process' output to a streammember Randor 5:03 10 Jan '09  
Chaser92 wrote:
Which library contains the procedure in WinCE?


You have my apologies. I did not realize that you were asking about an embedded environment. Perhaps you are looking for SetStdioPathW[^] and GetStdioPathW[^]?

You can possibly use CreatePipe to create alternate input/output handles which are also opened from inside your application giving you complete input/output control.

I think it could work like this:

1.) Call CreatePipe and save the handle to newhandle variable.
2.) Spawn a thread which reads the pipe handle.
3.) Call GetStdioPathW and save the handle to the a saved_output_handle variable.
4.) Call SetStdioPathW(1,newhandle).
5.) Call CreateProcess and your child process will inherit the parent i/o handles.
6.) Call SetStdioPathW(1,saved_output_handle) so you restore your own standard io handle.

I hope I made sense... if not just ask.

Best Wishes,
-David Delaune
GeneralRe: Redirect another process' output to a streammemberChaser9222hrs 37mins ago 
I get it, but as I don't know much about unmanaged coding, could you tell me how does one read or write to a pipe? or maybe some kinda example

Many thanks, you're saving my life
Wink

Best greetings
QuestionVietnampathfinder TravelmemberVietnamTravel23:41 5 Jan '09  
Vietnam Tour Operator, Travel Agent , Vietnam 's Leading Hotels and Resorts Online Reservations www.vietnampathfinder.com offers discounted flights, hotels and resorts, car rental, visa Arrangement, first class holidays, tailor-made tour packages, eco-adventure travel to the mystical, exciting and Newly Discovered destinations in Vietnam, Laos and Cambodia. OMG
Vietnam Travel
Vietnam Art tours
Hanoi Art tours
Vietnam family vacations
Vietnam Family holidays
Vietnam tours for family Laugh
QuestionAdd User Control in List viewmember~Khatri Mitesh~21:31 5 Jan '09  
Hi
I want to add User control in List view control.
Can it is possible using vb.net code.
Please suggest.
Thanx
Mitesh

~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA

QuestionVB.Net C.F.2 to C++ conversion?memberHurricane30007:20 4 Jan '09  
Hi all.

Do someone know if it's possible to convert a VB.Net C.F.2 application to C++ ? And if yes witch program can do such work? If yes the C.F.2 need to be installed the same on the device?

Thanks

modified on Sunday, January 4, 2009 2:16 PM

AnswerRe: VB.Net C.F.2 to C++ conversion?memberNirmitk2620:55 4 Jan '09  
Try this

Paste the VB code and c code !

http://www.developerfusion.com/tools/convert/vb-to-csharp/[^]
GeneralRe: VB.Net C.F.2 to C++ conversion?memberHurricane300011:04 5 Jan '09  
Thanks for reply, but C# is not the same of C++.

Bye!
QuestionOpen Settings tabmemberNirmitk263:19 3 Jan '09  
How to open settings tab using VB .Net
Generalhelp!!!!!membersaadahmedsait9:27 1 Jan '09  
hi...
i'm doing my engineering final year ... i need to do a project in my final semester... can someone help me out with some good topics... would be grateful for your help....

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Last Updated 9 Aug 2007
Web10 | Advertise | Privacy
Copyright © CodeProject, 1999-2009
All Rights Reserved. Terms of Use