|
Does someone knows how to load a PCX Image with a library or something else?
Trully, if there evil in this world, It lies within the heard of mankind
Shock The Dark Mage
shock@romhack.net
Main Project: Aeru IRC - http://www.sf.net/projects/aeruirc
|
|
|
|
|
Even though this applies to all .NET languages, I figured I'd ask it here since those VB.NET guys don't really get it, right guys?
Anyway, I was messing around with the managed DirectX classes the other day and got curious. I noticed in the assemblies that there's actually static methods on the assembly, not on a class. Well, this interested me so I dug deeper and saw that no external modules are P/Invoked but unmanaged code is embedded in the assembly. The only thing I can come up with is that they were written in MC++.
Then I started to wonder if the managed DirectX assemblies contained enough code to run that DX9 wasn't required. I tried it on a WinXP machine with the "factory-installed" DX8.1 and it worked! Of course, DX9-specific functionality may not work, but the basic stuff did.
So my question is, does anyone know how far back version support for the managed DirectX assemblies go, or do these contain enough information that DirectX doesn't even need to be installed. I'm kind of doubting it, but it'd be nice.
This will work great for our Web-deployed app that uses a "touchless installation", i.e. doesn't require an install. All dependent assemblies not in the GAC are downloaded automatically by Fusion, a component of .NET often overlooked. If MDX9 works this way, this paves the way for some awesome easter eggs...er, 3D object support.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Can anyone tell me, is there any advantage to using aximp/tlbimp for creating Interop DLLs over letting VS.NET do its stuff (by customising the toolbox to add a COM object)?
Is aximp mainly for those not using VS? Is VS using aximp to "do its stuff"?
Just wondering... what is the relationship, if any?
Paul
Pleasently caving in, I come undone - Queens of the Stone Age, No One Knows
|
|
|
|
|
aximp.exe is a simple cmdline that in the end just calls the System.Windows.Forms.Design.Aximporter.GenerateFromFile(string typelibfilename) method from the System.Design.dll namespace.
There is strictly no point in using this cmdline instead of letting VS.NET do it. After all, that's the same reason why you choose to compile C# code with the IDE instead of the cmdline.
|
|
|
|
|
Thanks SR.
This is exactly what I expected but I saw aximp mentioned in an article or two and it started to niggle at me. Figured someone here would know and I'd be able to forget all about it .
Paul
Pleasently caving in, I come undone - Queens of the Stone Age, No One Knows
|
|
|
|
|
Actually, there's a couple reasons: overriding the default namespace, generating source code, and providing a key pair (although you can do the latter via project options in VS.NET, but it's often forgotten). It's *rare* one has to do this, but I did have to for a couple ActiveX controls that were poorly written in the first place (but we needed them...drats).
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Exist in .NET something like WindowFromPoint ??
W.
|
|
|
|
|
[DllImport("user32.dll")]
private static extern IntPtr WindowFromPoint(Point point);
From Eric Gunnersons Win32Window library on GotDotNet.com
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
I'm sure that others have noticed this behaviour, but I have searched all over for a resolution to no avail, so I'll post it here.
When using windows XP visual styles (via manifest file) with a TabControl there are numerous display issues.
The most well-known is the fact that the TabPage background is not correctly painted with the WinXP gradient - this I actually don't care about as my tab pages are filled with either listviews or picture boxes, so the background is irrelevant. This issue has of course been addressed here on the CP already.
The major problem for me is that of you select anything other than a top alignment for your tabpages in conjunction with using winXP visual styles the tabs themselves are drawn totally messed up, along with the text on tabs mysteriously dissapearing.
The app I am developing is heavily reliant on tabcontrols, using a mixture of regular (align=top) controls, with a few left-aligned tabcontrols. Resorting the top-aligned controls throughout will simply waste far too much desktop space, so is not an option.
So here's where I'm at - it's either ditch WinXP visuals, or draw the tabs myself. I really don't want to have to resort to losing the XP look, so drawing the tabs myself is the way I'd like to go. The problem with this is that I simply cannot find an overridable method that allows me to paint the actual tabs (painting the tabpages is no problem), and at this stage the thought of writing my own TabControl from scratch is almost enough to make me turn to the drink.
Can anyone help?
|
|
|
|
|
Furty wrote:
So here's where I'm at - it's either ditch WinXP visuals, or draw the tabs myself. I really don't want to have to resort to losing the XP look, so drawing the tabs myself is the way I'd like to go. The problem with this is that I simply cannot find an overridable method that allows me to paint the actual tabs (painting the tabpages is no problem), and at this stage the thought of writing my own TabControl from scratch is almost enough to make me turn to the drink.
No dont drink! How about using the MagicLibrary's Dockin Controls. I have found the are almost a substitute for MDI forms and the TabControl.
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
Ah, come on. Drinking in moderation never hurt anyone and has even helped to churn out some interesting code form time to time.
Just wanted to vouch for Magic. We use them a lot at work and I and my colleagues have even suggested many improvements to the author. There's not very good documentation, but after "suggesting" that every third-party control libraries "require" it and throwing the NDoc project I help with at him and offering to help with the documentation process, docs will soon be on the way.
Other than that, you can't really find a better *free* library - or even a commercial library for that matter.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Heath Stewart wrote:
Drinking in moderation
moderation being the keyword. A bender on Wednesday night rendered me useless till yesterday.
Heath Stewart wrote:
There's not very good documentation
I agree, was a bit difficult to gather at first, but you tend to get the hang of it.
Heath Stewart wrote:
Other than that, you can't really find a better *free* library - or even a commercial library for that matter.
I agree again COmmercial quality for free I just wish I was a commercial programmer.
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
About 2 hours before I posted the orginal message here I downloaded v1.71 of Magic - the problem is I really do need to have some left-aligned tabs (vertical) as well as standard tabs. The thing with the base library control is, you can specify OwnerDrawFixed, but I just can't find ouy how to actually paint the tabs..
|
|
|
|
|
Magic will do vertical tabs (note, not "left-aligned" - that has to do with text alignment). He even has an example of it in his sample application.
As far as owner drawing, you basically have to take the PaintEventArgs.Graphics property and go at it. Take a look at the System.Windows.Forms.ControlPaint class. It has a lot of helpful functions to draw things like borders and glyphs. It can simplify your UI and keep it consistent with Windows.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Unfortunaltely, MagicTab has a problem with focus on complicated controls. I use MagicTab, control inherited from DataGrid on it, and some inherited controls on this inherited DataGrid. Keyboard works ok, but after mouse click focus "goes" from my controls to DataGrid. May be it's my mistake, but these objects on Microsoft Tab works ok ...
Sincerely
AW
|
|
|
|
|
Controls placed on MagicTab (instead of DataGrid) works ok.
Simplified controls (with no sub-controls on them) works ok.
Sincerely
AW
|
|
|
|
|
if you could only...code one language for the rest of your natural life...what would the language be ? ..as for me... i think C#....cause its the only one i really know lol..
|
|
|
|
|
C# is nice, my choice at the moment as well, but as I'm starting university this year, i'll be moving to C/C++. AT least I feel C# gave a good background on the working of these languages.
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
Definitely C++. C# is nice and all, but it's not practical in every application. For modern systems, C++ is like the glue that ties everything together and is the groundwork from which almost everything was written, from compilers to back-end functions to COM.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
The thing is, you have to use different languages within different contexts.
You probably won't ever do device driver dev. in C# or client-side scripting in C++.
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
animation mechanics in SVG
|
|
|
|
|
I've seen this in the Managed DirectX samples:
MouseState mouseStateData = new MouseState();
// Get the current state of the mouse device.
mouseStateData = applicationDevice.CurrentMouseState;
Could you explain me why there is a need to instanciate the MouseState class? Doesn't the property return an object? Isn't the expression "new MouseState()" redundant?
|
|
|
|
|
You are most likely correct, and I have seen many such examples in various .Net docs. I have always been able to remove the unnecessary instantiation, as one would expect. Do not assume example code writers have their code carefully checked. They don't have to produce good code, and rarely do they ever receive feedback.
Cheers
|
|
|
|
|
I used the DataTable.Rows.Find() to get a DataRow. Now how do I obtain that row's table index?
I dont see any DataRow.Index property or DataTable.Rows.IndexOf(PrimaryKey) method.
|
|
|
|
|
Hey every one, does any one know what the hell is wrong with this code =/
i am trying add a Node(file to the treeNode)works fine except
that
i am doing a check to see that the user wont add a same file 2wice but its
not returning a right value
its the second if statment
can you tell me whats wrong with my code thx
//Add Nodes to Tree
<br />
private void Add_Click(object sender, System.EventArgs e) {<br />
<br />
TreeNode currentNode;<br />
<br />
<br />
OpenFileDialog ofd = new OpenFileDialog();<br />
<br />
ofd.Filter="lib files (*.dll)|*.dll|Executable files(*.exe)|*.exe";<br />
<br />
<br />
if(ofd.ShowDialog()==DialogResult.OK){<br />
<br />
currentNode = new TreeNode(Path.GetFullPath(ofd.FileName));<br />
<br />
<br />
if(treeView1.Nodes.Contains(currentNode)==false){<br />
<br />
treeView1.Nodes.Add(currentNode);<br />
<br />
numberFiles = treeView1.Nodes.Count;<br />
<br />
Counter.Text=numberFiles.ToString();<br />
<br />
}<br />
<br />
else{<br />
<br />
MessageBox.Show("File AlreadyBeen selected","Warnning");<br />
<br />
currentNode=null;<br />
<br />
}<br />
<br />
}<br />
<br />
}<br />
Thanks in Advance
Amir
|
|
|
|
|
Amir G wrote:
currentNode = new TreeNode(Path.GetFullPath(ofd.FileName));
if(treeView1.Nodes.Contains(currentNode)==false){
You are comparing 2 instances of TreeNode objects, which will allways return not equal, unless you comparing it from a reference (but thats not what you should be doing). The TreeNode object has exactly what you are looking for in the Tag property. Here you can add some string or number and use that to check for equality, not the actual TreeNode objects.
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|