|
Dear All,
I am using XFS API to send commands to ATMs. For example If I want to get the information of Receipt Printer, I am calling the following function..
public class XFS
{
[DllImport(@"msxfs.dll")]
public static extern int WFSGetInfo(ushort SPIHandle, uint Category, IntPtr QueryDetails, uint TimeOut, ref IntPtr result);
}
I want to know that what value of SPIHandle I have to pass.
|
|
|
|
|
you should call WFSOPEN at first
hi,everybody
|
|
|
|
|
i need code for :
to write into embedded xml file of assembly
HELP EACH OTHER TO GROW TOGETHER.
|
|
|
|
|
Can anyone help.
I am writing a graphics intensive app and I need to know more about Regions, Clipping regions and all that pertain to the sublject.
I have Chands book Graphics Programming with GDI+ but he doesn't go into Regions as in depth as I need or I'm just not understanding.
Anyway could anyone point me in the right direction??
Thanks for your help.
If you keep doin what ya been doin you'll keep gettin what ya been gettin
|
|
|
|
|
Really need help guys!! Am just a newby in .Net programming, i am using visual studio 2005 and studying C# programming language. I am building a utility software that would need to be opened by clicking or double-clicking the file built by my application using its own file extensions, much like zip files in windows explorer loading on WinZip etc... Really need help... Please anyone..Sample C# 2005 codes would be very much appreciated. Thank you!!!
.............
|
|
|
|
|
[STAThread]<br />
static void Main(string[] args) {<br />
<br />
Application.EnableVisualStyles();<br />
Application.SetCompatibleTextRenderingDefault(false);<br />
if(args == null || args.Length == 0)<br />
Application.Run(new Form1());<br />
else<br />
Application.Run(new Form1(args[0]));<br />
}
args is the parameter list. if you open app through file the first parameter is the file name.. then you can do whatever you want with it..
life is study!!!
|
|
|
|
|
"args is the parameter list. if you open app through file the first parameter is the file name.. then you can do whatever you want with it.. "
-what do you mean, i'm sorry i don't get it..in vs 2005 these lines are included in the Program.cs file, isn't it? These are my codes in my main form using the Form_Load Event.
RegistryKey rk = Registry.ClassesRoot.CreateSubKey(".sis",RegistryKeyPermissionCheck.ReadWriteSubTree);
rk.SetValue("Content Type", "application/x-sis");
rk.SetValue("PerceivedType", "file collections");
rk.SetValue("", "SIS");
rk.CreateSubKey("OpenWithList");
RegistryKey rk2 = Registry.ClassesRoot.CreateSubKey("SIS", RegistryKeyPermissionCheck.ReadWriteSubTree);
rk2.SetValue("", "SIS File");
rk2.CreateSubKey("DefaultIcon",RegistryKeyPermissionCheck.ReadWriteSubTree);
try
{
RegistryKey rk3 = Registry.ClassesRoot.OpenSubKey("SIS", true).OpenSubKey("DefaultIcon", true);
rk3.SetValue("", "C:/sis.ico");
RegistryKey rk4 = Registry.ClassesRoot.OpenSubKey("SIS", true);
rk4.CreateSubKey("shell", RegistryKeyPermissionCheck.ReadWriteSubTree);
RegistryKey rk5 = Registry.ClassesRoot.OpenSubKey("SIS", true).OpenSubKey("shell", true);
rk5.CreateSubKey("open", RegistryKeyPermissionCheck.ReadWriteSubTree);
RegistryKey rk51 = Registry.ClassesRoot.OpenSubKey("SIS", true).OpenSubKey("shell", true).OpenSubKey("open", true);
rk51.SetValue("", "Open with &SIS");
RegistryKey rk6 = Registry.ClassesRoot.OpenSubKey("SIS", true).OpenSubKey("shell", true).OpenSubKey("open",true);
rk6.CreateSubKey("command", RegistryKeyPermissionCheck.ReadWriteSubTree);
RegistryKey rk66 = Registry.ClassesRoot.OpenSubKey("SIS", true).OpenSubKey("shell", true).OpenSubKey("open", true).OpenSubKey("command", true);
rk66.SetValue("", "C:/SIS.exe");
RegistryKey rkapp = Registry.ClassesRoot.OpenSubKey("Applications", true);
rkapp.CreateSubKey("SIS.exe", RegistryKeyPermissionCheck.ReadWriteSubTree);
RegistryKey rkapp2 = Registry.ClassesRoot.OpenSubKey("Applications", true).OpenSubKey("SIS.exe", true);
rkapp2.CreateSubKey("shell", RegistryKeyPermissionCheck.ReadWriteSubTree);
RegistryKey rkapp3 = Registry.ClassesRoot.OpenSubKey("Applications", true).OpenSubKey("SIS.exe", true).OpenSubKey("shell",true);
rkapp3.CreateSubKey("open", RegistryKeyPermissionCheck.ReadWriteSubTree);
RegistryKey rkapp31 = Registry.ClassesRoot.OpenSubKey("Applications", true).OpenSubKey("SIS.exe", true).OpenSubKey("shell", true).OpenSubKey("open", true);
rkapp31.SetValue("", "Open with &SIS");
RegistryKey rkapp4 = Registry.ClassesRoot.OpenSubKey("Applications", true).OpenSubKey("SIS.exe", true).OpenSubKey("shell", true).OpenSubKey("open",true);
rkapp4.CreateSubKey("command", RegistryKeyPermissionCheck.ReadWriteSubTree);
RegistryKey rkapp41 = Registry.ClassesRoot.OpenSubKey("Applications", true).OpenSubKey("SIS.exe", true).OpenSubKey("shell", true).OpenSubKey("open", true).OpenSubKey("command",true);
rkapp41.SetValue("", "C:/SIS.exe");
-what these lines of code do are adding entries in the Windows Registry such as default icons, type of file, etc. I can't seem to connect them to be default to run on my application as it prompts access denied message and worst, i don't know how i would activate my application and loading the clicked or double-clicked file onto it.... PLEASE HELP ME, WHAT WOULD I DO???
|
|
|
|
|
I kinda followed your message last time, quite got it eventually.... Thanx sooo much for the help...
XS: Yes, Life is study...
|
|
|
|
|
|
I've posted my block of codes, please try to look deep into it, im gettin the access denied upon clicking or right clicking and choosing "Open with SIS", the registered file with my own file extensions still have unknown applications on its properties.... I need a way on these without deployment yet. Is there any other way? PLEASE....
|
|
|
|
|
|
Thank you so much anyway..., but favor please, if you'd have d idea on how to manage these problems written in C#, please do "message me here"..Tnx.
|
|
|
|
|
Seems you are already on the right track. Remember your application must open the file using the arg[0](path to your file) parameter from the Main method.
static void Main(strings[] args)
{
if (args.Length <> 0)
Open(args[0]);//implement Open
else
Application.Run(new Form1());
}
I would do the following:
1) For testing purposes use the setup project (Set Open as default etc) and confirm the registry entries created by your setup project. Confirm double-click works.
2) Use C# to update the registry - compare with setup project entries to confirm what entries you may be missing.
Best of luck!!
|
|
|
|
|
|
when i debug my program as standard user it gives access denied on a process( created by System.Diagnostics.Process) so unable to get the values of 'WorkingSet'.But it works when i debug it as administrator.
How can i grant permission on process programmatically.Please suggest me...
Amit
|
|
|
|
|
How to convert a '.bmp' image to '.jpg' and '.gif' directly(without using save dialog) using C#.NET?
|
|
|
|
|
Just call the Save method on teh Bitmap class, and convert it to what ever you want to save to. That is, tell it to save as jpg, and it will.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
could you please send the code snippet for this and Is this the only solution? I mean, Is there any direct write method or something for the conversion from bmp to jpg? Please excuse if I'm wrong.
|
|
|
|
|
you can save the bitmap to a memory stream to convert it without writing to disc if you want
<br />
System.Drawing.Imaging.EncoderParameters encoding = new System.Drawing.Imaging.EncoderParameters();<br />
encoding.Param[0] = new System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality, Quality);<br />
MemoryStream ms = new MemoryStream();<br />
_Image.Save(ms, System.Drawing.Imaging.ImageCodecInfo.GetImageEncoders()[1], encoding);<br />
_reformattedImage = ms.FromStream(ms);<br />
HTH
Russ
|
|
|
|
|
This IS how you directly convert, you read from disc in one format, and save back to disc in another. There's a block of standard code you need that is in some MS samples, from memory, I don't thnk naming the file .jpg is enough. Check MSDN for a sample.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I am facing problem of matching an expression in a text file using C# in ASP.NET. The expression used will look like: ((apple AND orange) OR (car OR lorry)). A text file will be use to search for those keyword matching with the expression given. Do any one has any idea of how to perform the matching for expression mentioned above?
|
|
|
|
|
Looks like you've been asked to write a parser. Is this for the entire file, or just a line ? Either way, you need to do your own code to break the expression into sections, then you can evaluate each easy enough.
I'd say you need to build a tree of expressons that you can then walk to see if you end up with a true result.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hello all,
I'm looking for a "CheckedListBox" type control with two checkboxes for each item. I've seen one on another site for C++ but I'm not good enough to convert it or to write my own control. Does anyone have one or know where I can get one? I'm using Visual C# 2005 Express if it matters.
-Keith
|
|
|
|
|
I'm currently writting an application and I need to load all images from a directory and display their thumbnails after. I'd need to change the preview list when the user click on another directory in the tree view, so I need to load those thumbnail fast. Currently I'm loading all those images one by one and I store them into an ImageList. I know this is not efficient and that the images stay open until the file handle is close. I'm worried about the possibility to run out of memory or of file handle if the garbage collector don't free those ressources soon enough. Do anybody have any idea how to handle efficiently images preview and loading in .Net 2.0? I've googled a lot, but didn't find anything doing it. In fast, I need an image viewer as fast as possible as I'm loading from memory card and other slow disk drive.
Any idea? Let's discuss about .Net image capabilties.
|
|
|
|
|
Ignore the garbage collector, you need to call Dispose on any image that you're throwing away.
I believe it's possible to ask for a thumbnail when you call Bitmap.FromFile, or the constructor that takes a filename.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|