|
Thanks for the response.
How do I get the class that has all the API work done.
Thanks
|
|
|
|
|
Dundas Software is now hiring more .Net developers to work on an upcoming data visualization product.
If you take pride in the quality of your work and want to work with others who are not satisfied with second best, then Dundas may be the place for you.
Plus .... you get the satisfaction of walking by the CodeProject Server Room every day, as you head to the development department!!!
Click Here for more details.
|
|
|
|
|
Hiya
1. How do I make the last line in the list view show and be visiable every time a new entry is input into the list view.( you know when the amount of lines entered is greater than visiable line space on screen )
2. How do I go to a specific line in the list view??
Thanks.
|
|
|
|
|
Use the EnsureVisible() method of the ListView, passing it the index of the item you want to make visible.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Hi all,
Is it possible to clone the client area of a form (windows forms)? Imagine that I have an application that displays something in its main form, and I want make a "screenshot" of the main form content at some time to be displayed on the secondary screen (dual screen setup).
Just give me a clue, something to start, what to look for, thanks a lot in advance!
Rado
|
|
|
|
|
|
Hi, i need to find a solution to clone a system window, for example, if i open de folder "My Documents", can i clone this window and view 2 "my documents windows?
|
|
|
|
|
Pardon me a C#-novice's question.
Consider an object and one or more references:
CWhatever oObject = new CWhatever("xyz");
CWhatever oReference = oObject;
Changing a property value of oObject will be "seen" from oReference of course (oObject.abc == oReference.abc will be true), however, both will relate to two distinct objects as soon as a new one is created and assigned to oObject:
oObject = new CWhatever("uvw");
Is there any language tool that allows for all references to oObject to be updated accordingly, so that (oObject.abc == oReference.abc will *always* be true, even after re-allocating oObject)? Basically, I do not want oReference to refer to what once was, I want it to refer to whatever is current.
I am aware of techniques that I can implement to solve the problem. I am wondering if there is a language built-in to assist me.
TIA,
Bernd
|
|
|
|
|
berndg wrote:
Is there any language tool that allows for all references to oObject to be updated accordingly, so that (oObject.abc == oReference.abc will *always* be true, even after re-allocating oObject)?
AFAIK, No there isn't
|
|
|
|
|
It seems the most C#-ish solution is to employ MemberwiseCopy() and/or ICloneable, so as to avoid re-assignments to the original oObject. Instead, oObject will be updated, therfore keeping the references in sync.
Any thoughts?
TIA,
Bernd
|
|
|
|
|
i ask about how can i disable the network connection and enable it again
in windows 98
i know this by calling api functions in win98
plz i need this names of this functions and how can i use it
thx
Ahmed Mazrou3
|
|
|
|
|
I want my classes to inherit my felection functions but I have 2 questions
lets say property is defined as
enum myEnum : int
{
a=0,b}
public myEnum propertyA{get... set...}
how in reflections can I cast to the property type of that value
like in SqlServer it is a tinyint field and I need to cast to the enumeration type so the property will accept it
(myEnum)propertyValue;
thanks
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
myEnum m = myEnum.a;
int i = (int)m;
|
|
|
|
|
Thanks for checking out this post. Here is my issue. I am trying to build a tree view with data stored in a database table. The table is simple, it contains a folder id, name and parent id. The root folders will all have a parent id of zero (0). If a record has a parent id other than 0 then I want to creat that folder as a child folder of the parent linking them on parent id = folder id. In VB6 this was totally possible, because you had to come up with the key that made the folder unique. I haven't been able to find out how this is done in C#, can anyone help point me in the right direction?
|
|
|
|
|
Why wouldn't this be possible? It's a mere concept. I've done this in our application and to a very advanced and complex degree using strongly-typed tree nodes and trees, which it needn't be. It's actually an easy problem.
Loop through your data source (say, a DataSet ) recursively starting with nodes that have the parent ID as 0. Create that node and add it to the TreeView.Nodes collection. Then (before moving to the next parent node, hence the recursion) find the nodes that have the parent ID set to the ID of the node you just added. Call the same procedure again, which will create each node, add it to the TreeNode.Nodes collection of the node you just added, and then will find it's children. For the example below, I assume that a DataSet was passed to my method:
public void BuildTree(DataSet ds)
{
DataRow[] roots = ds.Table[0].Select("ParentID = 0 OR ParentID IS NULL");
foreach (DataRow root in roots)
{
BuildTreeHelper(root, myTreeView.Nodes);
}
}
public void BuildTreeHelper(DataRow row, TreeNodeCollection nodes)
{
TreeNode node = CreateNodeFromData(row);
nodes.Add(node);
DataRow[] rows = row.Table.Select("ParentID = " + node.Tag);
foreach (DataRow row in rows)
BuildTreeHelper(row, node.Nodes);
}
public TreeNode CreateNodeFromData(DataRow row)
{
TreeNode node = new TreeNode();
node.Text = row["Name"];
node.Tag = row["ID"];
return node;
}
This is the basic gist of it, and in most other languages, since real languages allow for recursion!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi all, I hope that someone will be able to help me.
I have installed the DirectX 9.0b SDK and started the Sample Browser to test some of the samples. But all the samples throw a FileNotFound exception when launched - File or assembly name Microsoft.DirectX.Direct3D, or one of its dependencies, was not found. or similar. What am I doing wrong? All Managed DirectX assemblies are installed and located in the \WINNT\Microsoft.NET\Managed DirectX\v4.09.00.0900 folder.
Any clues are highly appreciated! Thanks in advance.
Rado
|
|
|
|
|
Well, based on what I have found in the discussion board for the Managed DirectX Tutorial[^], I have tried to install the DirectX developer runtime separately (because I have installed the componentized DirectX SDK for C#, not the complete DirectX SDK) and after this, the Microsoft.DirectX.* assemblies appeared in the "Add Reference" dialog of VS.NET 2003.
I still cannot run the precompiled samples that came with DirectX SDK, but I can compile the sample projects and run the samples this way!
Rado
|
|
|
|
|
There is one important thing you should understand: what VS.NET sees (in the Add References dialog) and what's in the Global Assembly Cache (GAC) are different. The GAC is what's important here. You should open the directory (using Start->Run) %WINDIR%\Assembly and see if you see the DirectX assemblies in there. If they aren't, there's your problem.
See, the CLR searches for assemblies differently that Win32. It checks the assembly bindings in the config file, then the private path (usually the app directory or a "bin" subdirectory), and then it searches the GAC. You'll notice that the DirectX assemblies are neither referenced in the config file nor are they in the private path (and I don't mean the PATH env var, which doesn't matter to the CLR). If they aren't in the GAC, that's why they're not found.
What VS.NET is seeing is actually assemblies not in the GAC, but in folders referenced in the registry, namely HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework . I don't know why they do it that way, but they do. So, just because you see it in VS.NET doesn't mean that the sample can find them. They have to be in the GAC for that.
So, you need to make sure that the GAC contains those assemblies. If not, I'm surprised that running the developer runtime setup didn't do it. Check on the DirectX web site because I know that there were several patch-like updates to DirectX 9.0 (the first release) that fixed problems with both A and B. A straight B install might not install the managed assemblies. The web site should be able to help.
Good luck!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks a lot for a detailed explanation. You were right, I don't know why, but the assemblies are not in the GAC. These are the steps I've taken to install the SDK:
1. Install the DX 9.0b redist over DX 8.1 redist (didn't have the SDK at that time).
2. Install the DX 9.0b SDK for C#.
3. Install the DX 9.0b dev runtime.
Perhaps I will try to reinstall the complete SDK package (not only the SDK for C# version) later today.
Anyway, thanks again for the info!
Rado
|
|
|
|
|
I would like to know how to get the handle of the currently active window. I've tried using Findwindow and it works, but i want the whole view of the active window (including the toolbar and menubar) as i would like to create a program to take a screenshot of the active window (something like ALT+PRINTSCREEN but using BitBlt to do the capturing).
|
|
|
|
|
I'm not sure what problems you're having, but the typical way is similar to the following pseudo code:
HWND hWnd = FindWindow(NULL, "MyApp");
RECT rc;
GetClientRect(hWnd, &rc);
HDC hDC = GetDC(hWnd);
HDC hCDC = CreateCompatibleDC(hDC);
int width = rc.right - rc.left;
int height = rc.bottom - rc.top;
BitBlt(hCDC, 0, 0, width, height, hDC, 0, 0, SRCCOPY | CAPTUREBLT);
Is this what you're doing (roughly)?
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Yeah more or less. Here's the exact code :
hWnd = FindWindow(null, "Form1");
RECT rc = new RECT();
GetWindowRect(hWnd, ref rc);
this.Text = "LEFT" + rc.left + " RIGHT " + rc.right + " TOP " + rc.top;
Image myImage = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics gr1 = Graphics.FromImage(myImage);
IntPtr dc1 = gr1.GetHdc();
IntPtr dc2 = GetDC(hWnd);
BitBlt(dc1, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, dc2, 0, 0, 13369376);
gr1.ReleaseHdc(dc1);
ReleaseDC(GetDC(hWnd)), dc2);
GC.Collect();
Graphics gr = Graphics.FromHwnd(pictureBox1.Handle);
pictureBox1.Image = myImage;
|
|
|
|
|
Hi,
I´m playing a .wav file through a buffer with CSound. How do I get hold of the actual sound raw data in the buffer in order to do DSP on them? I´ve tried with GetBuffer(), but I can't get it to work.
/Thanks
|
|
|
|
|
hi, how i can achieve functionality of Gantt Chart like in MS Project using C#..is ther any library...or i have to code it separately..? pls tell me soon..-bhavin
|
|
|
|
|
I would hope that you searched the Internet first. A search of "gantt chart C#" on google yielded many results, including one here on CodeProject that mentioned Dundas, one of the sponsers of CodeProject and admittedly a decent library development company.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|