|
Hello. I'd like to write a CAB extracting/packing application, and am looking for MSZIP/LZX implementations (no matter what programming language it/they is/are in) or format specifications.
Thank you, and regards,
Stan
|
|
|
|
|
Good day all.
I have a two column ListView. I am having problems getting my ListView to display text in the 2nd column after the first row. The first row works fine for both columns 1 and 2. When I write data the second time. Row 2 column 1 writes the data but column 2 does not.
I am trying to use Listview.Items[0].Add( "xxxx" ); to update the 2nd column.
Thank you in advacne for your assistance.
|
|
|
|
|
try ListView.Items[n].SubItems.Add("xxxx")
|
|
|
|
|
Hi,
I am new in devloping applications for communication between devices.
How can i do serial port communication on .NET platform using C#(.NET Framework 1.1).
Please, let me know some good articles/books to learn "how to communicate to devices".
Thanks for some help.
Subrahmanyam.
|
|
|
|
|
There are a number of articles here on CodeProject, use the search article above with the word "Serial".
Here's one to get you started: http://www.codeproject.com/dotnet/DotNetComPorts.asp[^]
Gary
Marc Clifton: "In other words, VB is like a bad parent. It can really screw up your childhood."
|
|
|
|
|
Hi
Could anybody offer advice as to how to periodically search all open windows for a window with a known text property then programmatically step through its controls entering stuff and finally firing a button click event.
Thanks
PL
|
|
|
|
|
 I use the following code to do what you want to do. I have changed some names to protect the innocent, so where you values inside <>, just change it to reflect what you need.
Usage: Just copy and paste into a class file.
Good Luck!
<br />
using System;<br />
using System.Text;<br />
using System.Runtime.InteropServices;<br />
using System.Diagnostics;<br />
<br />
namespace APPLoginWindow<br />
{<br />
public class APPLogin<br />
{<br />
<br />
private object data;<br />
<br />
#region Contructor, dispose, main<br />
public APPLogin()<br />
{<br />
getAPPLogin();<br />
}<br />
#endregion<br />
<br />
#region win32 imports<br />
public delegate bool EnumWindowsCallback(int hwnd, int lParam);<br />
public delegate bool EnumThreadProc(IntPtr hWnd, IntPtr lParam);<br />
<br />
[DllImport("User32.dll")] public static extern int GetWindowText(int hwnd,StringBuilder lpString, uint bufferSize);<br />
<br />
[DllImport("User32.dll")] public static extern int EnumWindows (EnumWindowsCallback callback, int lParam);<br />
[DllImport("User32.dll")] public static extern int EnumChildWindows (int hWndParent, EnumWindowsCallback callback, int lParam);<br />
[DllImport("User32.dll")] public static extern bool EnumThreadWindows (uint threadId, EnumThreadProc pfnEnum, IntPtr lParam);<br />
<br />
[DllImport("User32.dll")] public static extern int RealGetWindowClass(int hWnd,StringBuilder pszType,uint bufferSize);<br />
[DllImport("User32.dll")] public static extern int SendMessage( int hwnd, int uMsg, int wParam, [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPStr)] string lParam);<br />
<br />
[DllImport("User32.dll") ] public static extern int FindWindow (string lpClassName,string WindowName);<br />
[DllImport("User32.dll") ] public static extern int FindWindowEx (int hWnd,int hWnd2,string lpsz,string lpsz2);<br />
[DllImport("User32.dll") ] public static extern int SetWindowText(int hWnd,string lpsz);<br />
#endregion<br />
<br />
#region Constants + fields<br />
public static int GW_HWNDNEXT = 2;<br />
public static int GW_CHILD = 5;<br />
public static int GW_OWNER = 4;<br />
public static int GWL_HWNDPARENT = -8;<br />
public static int WM_SETTEXT = 12;<br />
public const int HWND_MESSAGE = -3;<br />
public const int BM_CLICK = 0x00F5;
public const int WM_CHAR = 258;<br />
private string _windowText = "";<br />
#endregion<br />
<br />
#region Callback functions for listing windows<br />
private bool displayAPPLogin(int hWnd, int lParam)<br />
{<br />
StringBuilder windowName = new StringBuilder(255);<br />
StringBuilder className = new StringBuilder(255);<br />
<br />
GetWindowText(hWnd, windowName, 255);<br />
RealGetWindowClass(hWnd,className,255);<br />
if ( windowName.ToString().ToLower().IndexOf("<Name of Login Window>") != -1 )<br />
{<br />
data = hWnd;<br />
}<br />
<br />
return true;<br />
}<br />
<br />
#endregion<br />
<br />
#region Sendmessage clicks<br />
public void PerformAPPLogin()<br />
{<br />
int hWndAPPLogin;<br />
<br />
hWndAPPLogin = (int) data;<br />
<br />
if ( hWndAPPLogin != 0 )<br />
{<br />
int hWndAPPLoginUserName;<br />
int hWndAPPLoginPassWord;<br />
int hWndAPPLoginOKButton;<br />
<br />
hWndAPPLoginUserName = FindWindowEx(hWndAPPLogin,0,"Edit",null);
SendMessage(hWndAPPLoginUserName,WM_SETTEXT,0,"<UserName>");
hWndAPPLoginPassWord = FindWindowEx(hWndAPPLogin,hWndAPPLoginUserName,"Edit",null);
SendMessage(hWndAPPLoginPassWord,WM_SETTEXT,0,"<Password>");
hWndAPPLoginOKButton = FindWindowEx(hWndAPPLogin,0,"Button", null);
SendMessage(hWndAPPLoginOKButton,BM_CLICK,0,null);
}<br />
}<br />
<br />
#endregion<br />
<br />
#region Get APP Login Window<br />
private void getAPPLogin()<br />
{<br />
bool APPRunning = false;<br />
<br />
Process[] processes = Process.GetProcesses();<br />
for (int i=0;i <= processes.Length -1;i++)<br />
{<br />
if (processes[i].ProcessName.ToLower().IndexOf("<Name of Process>") != -1)<br />
{<br />
APPRunning = true;<br />
}<br />
}<br />
<br />
if ( APPRunning )<br />
{<br />
<br />
EnumWindowsCallback EnumWCB = new EnumWindowsCallback(displaySAPLogin);<br />
EnumWindows(EnumWCB ,0);<br />
<br />
}<br />
}<br />
<br />
#endregion<br />
<br />
}<br />
}<br />
I reject your reality and substitute my own!
- Adam Savage, Mythbuster
- George W Bush
life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
|
|
|
|
|
Hi to all.
My name is Bruno and I am an Italian programmer.
I've a problem.
I need to write a program that make a map for apply texture on a various images that contains object (ex. Sofa', chairs, dressed, ...) to change his color/textures.
I've founded software. Look at this:
http://www.nedgraphics-porini.com/Default.aspx?SiteID=7&PageID=166
I've marked 3 extremely hard phases.
1: create a map for curves and angles:
- Algorithm to draw a 3d curve with GDI (2D)
- Algorithm to transform create curve
- Save the curve for future visualization
2: Map texture to curve (texture mapping)
3: Overlay original image with textured map
For the third phase I've supposed to use the base pixel brightness and draw the texture pixel with the same brightness.
The result is ok but work fine just with flat colors because if I use a texture this is so flat.
Therefore I need texture mapping.
Have you a line guide for me?
I've considered using Ray Casting technique or quite DirectX/OpenGL
Tanks for your time.
Bruno
Sorry for terrible English
|
|
|
|
|
|
I need control (.net or ActiveX) to draw 3d graphs in my application... What can you suggest?
|
|
|
|
|
hi all,
i'm trying converting numbers to alpha. for example if i write 30 it'll give me "thirty" or 31 - "thirtyone"... how can i do that?? thanx...
|
|
|
|
|
Wow, that would not be too hard but would require more time to explain than I think most of us would be willing to put in, but if it's okay, let me get you started and I think you can figure the rest out on your own.
seperate your problem into periods. A period is the three number grouping deliniating hundreds, thousands, millions .... ie 42,233,123 so this should convert to the string "fouty two million, two hundred thirty three thousand, one hundred twenty three" right?
so now you have three strings : "42" , "233", "123"
now take each of those strings and make a post-period-word for them to tack on later, so you'd have: "Million", "Thousand" Dont worry about the last string, that one will just be worded on its own.
now convert the number in each of the strings and convert them into words. You can figure this out on your own and its not too hard but think carefully about it, there are some special cases here!
This is kind of a recursive algorithm but there are a few special cases you'll need to code for like
not wording the last group. For instance you would not want to save "One Hundred Twenty Three Hundred".
Have fun.
|
|
|
|
|
|
can any one giude me how to convert ...below vb.net code to C#......
Dim oDoc As Word.Document
Dim oBuiltInProps As Object
Dim oCustomProps As Object
Dim oProp As Object
Dim strValue As String
'Get the Custom Document Properties collection.
oCustomProps = oDoc.CustomDocumentProperties
'Add a property named Status Report
'and give it a value of 4th Qtr.
oCustomProps.Add("DOCID", False, _
Office.MsoDocProperties.msoPropertyTypeString, "123216")
major problem is with oDoc.Custo mDocumentProperties which returns object...how t o do the same thing in C# where oCustomProps.add is not coming?
urgent plz help me out?
|
|
|
|
|
The problem is in declaring oCustomProps as Object. You need this to be of the correct type (DocumentProperties?) so that the Add method is available. In VB.Net:
Dim oCustomProps As DocumentProperties<br />
oCustomProps = oDoc.CustomDocumentProperties<br />
oCustomProps.Add(.....
in C#:
DocumentProperties oCustomProps;<br />
oCustomProps = oDoc.CustomDocumentProperties;<br />
oCustomProps.Add(.....
Hope that helps
Jon
|
|
|
|
|
hai..
i have i tried this but it says it cannot convert object to microsoft.ofice.core.documentproperties
here is my code
DocumentProperties oCustomProps;
oCustomProps = objWordDoc.CustomDocumentProperties;
oCustomProps = (Microsoft.Office.Core.DocumentProperties) oCustomProps;
oCustomProps.Add("Document ,false,MsoDocProperties.msoPropertyTypeString,"123456",null);
|
|
|
|
|
Try merging the two middle lines together:
DocumentProperties oCustomProps;<br />
oCustomProps = (Microsoft.Office.Core.DocumentProperties) objWordDoc.CustomDocumentProperties;<br />
oCustomProps.Add("Document ,false,MsoDocProperties.msoPropertyTypeString,"123456",null);
|
|
|
|
|
even this code throws an error but it is runtime error...regarding RPC
DocumentProperties oCustomProps;
oCustomProps = (Microsoft.Office.Core.DocumentProperties) objWordDoc.CustomDocumentProperties;
oCustomProps.Add("Document ,false,MsoDocProperties.msoPropertyTypeString,"123456",null);
error
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in OfficeDocument.exe
Additional information: The object invoked has disconnected from its clients.
|
|
|
|
|
Hmm I don't think I can help with that, I haven't used COM interop at all or any of the office programming components. I expect somebody will be along who knows what they're talking about!
Jon
|
|
|
|
|
Hi All,
I have downloaded SAP.Net connector from sap.com and with the help of the code available at http://www.codeproject.com/dotnet/SapDBReader.asp, I am able to connect to SAP R/3 System and fetch the data.
While fetching the data from the table having rows more than 200,000, It is giving the error related to BUFFER.
Can anybody help me out for this problem ?
Regards
Dilip
|
|
|
|
|
Yeah.
Don't start queries which will return more than 200000 rows. Seriously.
It does make more sense to have your software retrieve this in packages of maybe 10000 rows each, so you can continously update your view with the data already retrieved.
The SAP-Exceptions are the reason why I have designed all my Apps to use ConnectionPooling and asynchronous methods. I simply dont retrieve 200000 sets in a row, but more like 10000 per thread with 3 threads running.
Cheers
Sid
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
I want to compile the dll conditionally, only when I want, or do you mean that the application should only load the DLL when it is needed.
My requirement is to have multiple .Net dlls, which has similar functionalities exposed (so that I can expose functions of same signature). One of these dlls should be loaded at runtime based on user's selection of dll file name. In effect I need to support my application in such a way that, even after initial deployment, I will be able to deploy additional dlls (additional dlls alone will be separately deployed), which user can select at runtime.
Shashidhar Reddy
|
|
|
|
|
Sounds like you are looking for something like the provider model in .NET v2,
also it might be worth while to have a look at the community server project[^], they have implemented a lot of this type of functionality.
|
|
|
|
|
You can use .NET reflection capacities. Recently I find an interesting project in C# called Purple#, the programer uses dlls like plugins, for example if you can render in D3D use D3D.dll, or OGL.dll for OpenGL. This Dlls implementes same interfaces.
This is the URL: http://www.bunnz.com[^]
|
|
|
|
|
i have created a button at runtime and want to form click event
handling during runtime.coding is like
class classname
{
Button b=new Button();
b.id=.......
b.Click += new System.EventHandler(_functionname);
...........
...........
...........
private void _functionname(object sender, System.EventArgs e)
{
Button bb=(Button)sender;
string urls;
urls=bb.id;
......
.........
}
}
but it is not working
Amit Kumar Katiyar
BhanuSoft tech Pvt. Ltd.
Noida
|
|
|
|
|