|
I apoligize for not being more clear. I can't use the statement because the ProcessInfo class which is the last argument is part of the System.Web namespace which isnt included in the cf. I was curious if anyone knew of another way of declaring the function without using the ProcessInfo class for the last argument.
Thanks,
Ryan
|
|
|
|
|
Just call the parameter as something else. The fact is that you have to define that struct that the P/Invoke statement takes. You could call it Asdf and it won't matter, so long as the struct matches the structure defined in Windows. If you like the name ProcessInfo , then define it yourself and just qualify it with the namespace you define it under.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
For future reference I was able to just use IntPtr.Zero for the parameter, thanks again Heath.
Ryan
|
|
|
|
|
Can anyone help me in plotting on a map using latitudes and longitudes. Am doing a project in using GPS.
The methods i used doesn't give enough accuracy.
Can anyone give suggestions to improve accuracy.
sibish
|
|
|
|
|
Define 'accuracy' and 'plot'. What method did you use? What is its purpose?
I have experience of plotting lat/long country outlines and GPS data onto a computer screen. Treat the lat/long as a coordinate in 3D space (polar coords with constant Radius - or is this the inaccuracy you talk about? Do you want a more accurate geoid(earth-shape)?). Convert to Cartesian coords (X, Y, Z) Then project onto a 2D surface. Which projection do you want to use? There are hundreds, but probably less than a dozen that cover 99% of needs. Each projection has its own strengths and weaknesses (read: inaccuracies). e.g. a Mercator allows sailors (& others) to travel at a constant bearing to reach their destination, but distorts shapes.
To allow 'autosizing' of the display, I just used the min/max lat/long rectangle diagonal & scaled it - fine unless you're working near the poles (I was using Europe, US & Canada - Canada was almost a problem!).
Give more specific details of what you're doing & want to achieve, and you could receive more specific help.
Regards
Brewman
|
|
|
|
|
Dear Sir,
i have already write an application for that issue, first of all you have to calibrate the map by putting thin point on it, by this way you can relate the coordinates oof the map with the UTM coordinates
by this control points you will get an accurate tracking, the tracking error will be not more that 2-3 meters if you have any other Q you can ask me
Regards
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
Hi,
Can you send me your application source code.Send to sibbsnb@yahoo.com
Thank you
sibish
|
|
|
|
|
Dear Sir,
Exuse me sir it is top secure code i could not send it to you gut if you have any quistion you can ask me
Regards
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
If you're plotting simple Lat/Long as X/Y (or is that Y/X?) and your Long is too short(?!) on the map (i.e. if you 'walk' in a square and an oblong appears) ...
then if:
- area is small (less than say 100 miles/kilometres)
- not a polar region
then let LonAdj = Lon/cos(LatOfMapMidPoint) and plot that.
If a polar region, plot as polar (radius = 90-abs(Lat) & theta/angle = Long * sign(Lat))
Regards
Brewman
|
|
|
|
|
Hey
I have now used Double buffering to the background picture of a 1024*712 form, it simes like it is much smother, but still i could notice some lag when moving the form around.
1. Now i will place some System Controls(own made controls) in this form, do i have to use the double buffert inside this controllers to? or do the form(with double buffert) fix double buffert to al the controls?
2. this controls haves som grafic, like buttons and so on, not to big with other words.
shold i draw this images on the buttons and so on in the OnPaint override or is it okay to just load them direct in to the buttons(maby not to big difrrence, when thay isent that big?).
3. What picture format is less expensive to handle? png, jpeg, bmp, gif...
and what quality? maby no compression at al is bether then compressed?
//Jimmy
|
|
|
|
|
Are they system controls, or your controls? In #1, that isn't clear. You typically don't need to modify system controls because most aren't drawn at all by .NET. Windows Forms controls encapsulate their Common Control equivalents which draw themselves using GDI outside the realm of .NET. Ever wonder how Microsoft keeps the Win32 controls and the .NET controls looking the same? Because they are the same.
Bitmaps (bmp) are the best way to go. These are used primarily throughout much of the code that makes up Windows, Office, Photoshop, and most other programs you can think of. Up until a few years ago when more and more applications started using bits of the Internet Explorer WebBrowser control and MSHTML, that's all that was supported without your own rendering. Bitmaps are uncompressed (well, some may be RLE compressed but this is rare when dealing with Windows graphics), where the others are compressed and, in the case of a GIF, indexed.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
When i wrote System controls, then i ment Windows Control Library(my bad). this controls is then applayed to my form.
in the Windows Control Library i adds buttons and listboxens and so on, and in many cases there will be grafik applayed to this contrlls like buttons and listboxes. This pictures is not big, but maby i have to draw then my self in the onpiant to get an overal bether preformans of my application?
And will i have to use Double bufferting(SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.UserPaint, true);) on this Windows control Library to get them to use double buffering.
if have got this right?
double buffering (SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.UserPaint, true);)
is used to first load the picture in to the memory and then display it, and when it is repainted its repainted in the memory first and then displayed?
And to override the OnPaint and draw some of the pictures myself is another way to get bether preformans, but i can use only the buffering or only the overridden onpiant, thay have not realy a connection ??
Thankt alot with the fast answare
//Jimmy
|
|
|
|
|
Yes, that's how you enable double-buffering and that's how it works. It draws the on-screen bitmap in memory and then pushes it to the device context.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Okay, good, Tanks!
But do i have to use the double bufferting in the Windows Library controls that i make? or will the main form(project)s doubel buffering configuration applay to the controls that are applayed to the form?
//Jimmy
|
|
|
|
|
You really don't need to enable double-buffering for everything. For something simple like display text or an image on a button, you really don't need it. Double-buffering is most beneficial when used to display UIs that require a lot of processing to display their graphics, or if you want something like smooth scrolling text (a common example used for double-buffering tutorials).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am trying to create a chat window (as a controller), and my problem is that i cant get the scroller to move to the bottom (follow the new strings that are added), is there any way to make it auto scroll to the bottom?
I have tryed this (when i recieve a new message) but it seems that it wont focus?:
rtxPublic.Focus();
rtxPublic.SelectionStart = rtxPublic.Text.Length;
rtxPublic.SelectionLength = 0;
rtxPublic.ScrollToCaret();
rtxPublic.Update();
When i do this in a form it works but not as a controller??
Please help!
Thanks
/Johan
|
|
|
|
|
IIRC you need to invoke that via control.Invoke() , so wrap them commands in a methods and be sure to invoke the method rather than call it directly.
top secret
|
|
|
|
|
I need to encrypt/decrypt string variable using standart .NET clases
using System.Security.Cryptography;
Could anybody give me some example of using these calsses or some link where I can read about it...
|
|
|
|
|
Do a search here in the projects available. I found about 5 neat sample apps demonstrating the various techniques.
|
|
|
|
|
Look in the .NET Framework SDK for the class documentation for those classes, interfaces, and structs in the System.Security.Cryptography namespace. There are also many examples here on CodeProject. Just do a search for "encrypt" or something simple.
A good understanding of cryptography will definitely be helpful, such as knowing what exactly cryptography is, shared key and private key architectures, etc. Crytography is definitely not something to take lightly.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I'm looking for a possibility to get the building (last compilation!) Date and Time of my C# Application, during runtime.
Does anybody know ho I can get these information.
thanks in advance
Jörg
|
|
|
|
|
Yeah. The creation date and time of your .EXE will be the compile data and time.
FileInfo fi1 = new FileInfo( Application.ExecutablePath );
CompileDate = fi1.CreationTime
RageInTheMachine9532
|
|
|
|
|
Yes, this info is stored in the assembly in the metadata, not sure how accessible it is.
OK heres a hack Will work for just about any exe file as this data is embedded in the PE file header.
public static DateTime GetTimeStamp(string filename)
{
Stream s = File.OpenRead(filename);
s.Position = 132 + 4;
byte[] data = new byte[4];
s.Read(data, 0, 4);
s.Close();
return new DateTime(1970, 1,1).AddSeconds(BitConverter.ToUInt32(data, 0));
}
top secret
|
|
|
|
|