|
i went to msdn and found additional stuff (i go there alot its just so damn big you know it ?) thanks for pointing me in the right direction.
Jesse M.
|
|
|
|
|
|
some time mouse shows busy sign can any body tell how i may check that mouse is busy or not?
r00d0034@yahoo.com
|
|
|
|
|
The hourglass shape of the mouse cursor generally indicates that an applicaiton (as opposed to the mouse itself) is busy. If you're writing an application in C#, this is typically controlled with the Cursor.Current static property (in System.Windows.Forms).
I'm not sure this will do what you want, but it's the right general direction.
Burt Harris
|
|
|
|
|
This piece of code is from the DX8 tutorial:
VOID* pVertices;
if( FAILED( g_pVB->Lock( 0, sizeof(g_Vertices), (BYTE**)&pVertices, 0 ) ) )
return E_FAIL;
memcpy( pVertices, g_Vertices, sizeof(g_Vertices) );
g_pVB->Unlock();
Is it possible to translate it in C#? I'm trying to write a simple DX8 application as I use only C#. I'm using the VB type lib but obviously there are functions not available in C# like D3DVertexBuffer8SetData, that replaces the above C++ code in VB.
While this exercise might be a little unpractical it actually helps me better understand the difference between managed and unmanaged .
Any ideas how to set up and run DX8 in C# (is it possible at all; is it possible to do it in a' managed' way)?
Thank you
Z.
|
|
|
|
|
DX8 is a pain to work with in C#. If you can, I would just wait a few months for the DX9 SDK to come out. That'll have C# support.
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
Microsoft has reinvented the wheel, this time they made it round.
-Peterchen on VS.NET
|
|
|
|
|
|
leppie wrote:
The beta's looked very promising
Not that adventurous. I install betas all the time...but I wasn't quite ready to install that one. Especially when you can't uninstall it...
leppie wrote:
you dont need the SDK to write Managed DX9 apps.
Huh? Yeah you do...
I think you mean you don't need it to run DX9 apps.
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
Microsoft has reinvented the wheel, this time they made it round.
-Peterchen on VS.NET
|
|
|
|
|
|
Personally...I would wait for DX9 to come out before trying to do anything DX related with .NET. Its not that it's impossible, but its just not very pretty.
Alternatively instead of using the DX8 wrappers you can try to create the COM objects yourself using COM interop. Adam Nathan's book .NET and COM: The Complete Interoperability Guide (SAMS press) even has an entire chapter dedicated to creating a game using DirectX from .NET.
James
"The elastic retreat rings the close of play as the last wave uncovers
the newfangled way.
But your new shoes are worn at the heels and
your suntan does rapidly peel and
your wise men don't know how it feels to be thick as a brick."
"Thick as a Brick" from Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
thank you everybody for the answers, your are of course right
but I still would like to know if there is a way to overcome such a piece of code (so let me take it out of the context of dx):
VOID* pVertices;
if( FAILED( g_pVB->Lock( 0, sizeof(g_Vertices), (BYTE**)&pVertices, 0 ) ) )
return E_FAIL;
memcpy( pVertices, g_Vertices, sizeof(g_Vertices) );
these VOID* and memcopy iritate me too much!
|
|
|
|
|
|
The only issue is you are passing structs back and forth (and these are not always correctly handled by the type marshaler). A suggestion to get your job done is to marshal the struct yourself. This article[^] shows it.
|
|
|
|
|
Thank you everybody! I'm still curious can I succeed in showing a spinning cube on the screen or not will I succeed to marshal my customvertex struct or not
|
|
|
|
|
|
How about just return;
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
Microsoft has reinvented the wheel, this time they made it round.
-Peterchen on VS.NET
|
|
|
|
|
Nope, throwing an exception is your only way out of not creating the object.
James
"The elastic retreat rings the close of play as the last wave uncovers
the newfangled way.
But your new shoes are worn at the heels and
your suntan does rapidly peel and
your wise men don't know how it feels to be thick as a brick."
"Thick as a Brick" from Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
|
Make the class createable only by a class factory class, have the factory method return the null if instance creation fails...
<br />
public static class Objectmaker()<br />
{<br />
protected Objectmaker()<br />
{<br />
}<br />
public myObj MakeMyobj() <br />
{<br />
MyObj m = null;<br />
myObj = new myObj();<br />
return myobj;<br />
}<br />
internal class Myobj()<br />
internal MyObj()<br />
{ try {...}<br />
catch{...}<br />
}<br />
}<br />
}<br />
Here's where "friend" classes, or protected allowing access by containing class would be nice...
|
|
|
|
|
|
My example was flawed anyway.
This is better:
namespace FactoryTest
{
public class Factory
{
private Factory()
{
}
public static FactoryObj Makeobj()
{
FactoryObj fObj = null;
fObj = new FactoryObj();
return fObj;
}
public class FactoryObj
{
internal protected FactoryObj()
{
}
public int One
{
get {return 1;}
}
public void DoNothing ()
{}
}
}
public class TestIt
{
public TestIt()
{
}
public void t1()
{
Factory.FactoryObj Obj = Factory.Makeobj();
Obj.DoNothing();
int one = Obj.One;
}
}
}
The protected internal makes the class creatable only by the containing factory, but the class is otherwise public.
You might consider defining an interface rather than a base class, and using the factory to return return instances of the interface.. probably still not helpful if you want external users to be able to implement classed that implement the interface...they would have to subclass the factory...
|
|
|
|
|
|
Hello...
In my aplication I need to insert a bitmap to the RichEdit control.
And another one. I need to display the number of a line on the left side of richedit constrol, like in some of the HTML editors etc.
Any ideas how to do this?
Dave
|
|
|
|
|
I have a COM dll which runs in COM+ and which works fine in asp. In ASP.NET I have added a reference to the dll, created an instance of the object and called new on it. When I try to call any method, it blows up without ever entering the dll. Any ideas what I may be doing wrong ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
There was a bug in the RCW generation of .NET 1.0 that mucked up on certain types...it was fixed for 1.1.
Also, since you mentioned having VS.NET 2003, by default when you install the 1.1 framework ASP.NET automatically upgrades all applications to use the 1.1 framework.
This could pose a problem when using VS.NET 200 for producing any of the assemblies used by your ASP.NET site. I'm not sure how much of a problem though, I would assume ASP.NET runs with several binding redirects so the new 1.1 assemblies get loaded instead of the older 1.0 ones.
James
"The elastic retreat rings the close of play as the last wave uncovers
the newfangled way.
But your new shoes are worn at the heels and
your suntan does rapidly peel and
your wise men don't know how it feels to be thick as a brick."
"Thick as a Brick" from Thick as a Brick, Jethro Tull 1972
|
|
|
|