|
pauldomag wrote:
I have seen the C# code and its quite similar to Managed C++. All
functionalities in C# i could use in MVC++ except Managed DirectX.
Why on earth would you use MDC instead of just plain old DirectX ?
pauldomag wrote:
did you forget to include a header file?
(NOTE: I've already included all the necessary assemblies)
As the error is telling you, you apparently are missing some header files.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi Christian,
Im using Managed DirectX over the Umanaged one coz, as the name implies it is easier to manage...
All of the samples included in the Summer 2004 SDK are in C#...
But as you can see, the idea of the .NET Architecture is to be able to develope in cross languages so I think, Since Im using Managed C++ I should use Managed DirectX...
But the problem is Im getting some kind of error...
But viola! i've solved it... A person kind enough answered my question..
Just create a header file, with this content:
namespace Microsoft {
namespace DirectX {
namespace PrivateImplementationDetails {
__nogc struct IDirect3DDevice9 {};
}
}
}
And simply include it in your .cpp file..
cheers
Paul June A. Domag
nth geographics and geometrics
|
|
|
|
|
Sounds like a hack to me. Surely you're working around either a problem with the SDK, or a problem with your setup.
Either way, COM talks to .NET with no worries, there's no reason in the world to use Managed DX ( especially as managed means simply that you can fall into a false sense of security and slow your system to a crawl if you don't manage your own memory ).
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Well I guess its the problem of the SDK. coz some people I know also experienced this kind of problem (Thats why some of them shifted to C#)...
I personally agree with you on the performance issue. But im not actually developing a game or something that needs the extra speed of an unmanaged DirectX... thats why im using the managed one...
I guess COM do talk to .NET with no problems. But as I see it, when you access COM in your .NET app (C# or VB .NET) what the framework does is automatically create COM Wrappers on the objects so that you could access it. And thats an extra layer that your application needs to pass to be able to access COM. And I guess it would drag your app a little bit. Well, I read an article in microsoft that suggests that if you would like to create an app that is based on COM, better use Visual Studio 6 instead of VS .NET
Thank you very much Christian, for your comments and great insights...
cheers
Paul June A. Domag
nth geographics and geometrics
|
|
|
|
|
pauldomag wrote:
And thats an extra layer that your application needs to pass to be able to access COM. And I guess it would drag your app a little bit.
Surely you realise that layer has to exist somewhere ? I doubt they rewrote DX entirely for managed use. I hope they didn't, it would be very bad practice. Unless a sub COM layer already existed, I suppose.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Greetings Christian,
Yes your right Microsoft didn't rewrite the DX for managed use. Instead they added a set of assemblies to be able to comply with the .NET Framework (thus came Managed DirectX). The classic style DX (unmanaged) is still there... By the way, you could also mix both worlds (eg unmanaged DX in managed) or just like my friend vas, he uses unmanaged DX and everything else is in .NET (forms..etc) Well i guess you could get the best of both worlds...
cheers
Paul June A. Domag
nth geographics and geometrics
|
|
|
|
|
Hey everyone. I just need to know how to make a cube bounce off the borders of the screen in DirectX 9. I'm currently reading the "Introduction to 3D Game Programming with DirectX 9.0" book - but I can't figure out how to make a cube bounce around the screen. I would like to eventually make it so that a cube, torus, and teapot bounce off the borders of the screen in different directions and speeds. Can anyone help me and provide some code with explanation? Thanks!
<3, Guissella
motobmxdiva@yahoo.com
|
|
|
|
|
Suppose, I am selecting an item from a list box an I would like to change the items in another list box (ListBox2) based on the selection in ListBox1
For Example- in a list Box1 (Title Country) , if I select India, I would Like to change the contents of List Box2 (Title-Cities), I will get the cities of India in List Box 2
|
|
|
|
|
I am trying to teach myself threading from a book, but the book I have isn't helping me very much.
My main thread sends off another thread. The new thread could at any given moment be either running or suspended.
I want to be able to abort that thread and creat it again so that it starts at the begining of its process.
The problem I am having is that depending upon whatever random moment I click the button that does this; I sometimes get either a ThreadAbortException or a ThreadStateException. For some reason my try--catch isn't catching them.
I don't suppose anyone would be able to give me a little example of how to work with threads in this way?????
Thanks,
Jody Blau
|
|
|
|
|
Try this:
Catch ex As ThreadAbortException
Trace.WriteLine("READ THREAD ABORT EXCEPTION!")
'Allow the thread to continue aborting:
Thread.ResetAbort()
david
|
|
|
|
|
I'm sure this is simple, i'm just not seeing it.
I'm not having any luck trying to figure out how to have my listbox autoscroll to the last item in the list when a new item is added.
|
|
|
|
|
Hi,
if U are Using MFC, check setHotItem(int iIndx)
by
baijumax
|
|
|
|
|
I am using Visual Studio.net 2003; and I don't see anything that looks like setHotItem.
???
|
|
|
|
|
Hai,
u can simply solve the problem by selecting the last item.
ie
this->listBox1->SelectedIndex=this->listBox1->Items->Count-1;;
ANish
|
|
|
|
|
|
I've added a new windows form to my project and I have no idea how to display the form. I have books with examples, but they only work if the form is the main form of the app. This is a mixed-mode app and I'm just doing a test to get familiar with windows forms. I have #included the header file for the form and in the menu's event handler, I have done this:
#pragma push_macro("new")
#undef new
CTestForm* dlg = new CTestForm();
dlg->ShowDialog();
#pragma pop_macro("new")
Can anyone help me out here? Thanks in advance
[insert witty comment here]
bdiamond
|
|
|
|
|
Hi,
The Following Links May Help You.
1) http://www.codeproject.com/useritems/Windows_Forms_in_MC__.asp
2)
http://www.developer.com/net/net/article.php/1378751
3)http://www.codeguru.com/columns/Kate/article.php/c6585/
|
|
|
|
|
thanks!!
[insert witty comment here]
bdiamond
|
|
|
|
|
..not really sure why this is in the Managed C++ forum,...but,...
I have been reading Don Box's book: "Essential COM". He has a code section in the back where he provides a server/client Chat application. It's all C++, and is written as an example of how to create a COM server/client app. It may help you (or, maybe not).
http://www.awprofessional.com/content/images/0201634465/sourcecode/COMCHAT.zip[^]
This is probably like 'cheating'.
|
|
|
|
|
thanx alot for your concern!
my main problem is not the code, its trying to arrange a graphical interface for my "chat program" with borland.
i dont know how to do that and i dont know if borland 5.01 enables me to.
well, thanx alot once again, i appreciate it
|
|
|
|
|
From what I've read, compiler implementations are proprietary, and can be different from vendor to vendor. This is the forum for the Microsoft Visual Studio .NET IDE. Before I used the .NET IDE, I tried messing around with the Borland compiler, and, as I recall, it works completely differently from .NET.
Most importantly, the .NET runtime environment depends on the CLR (Common Language Runtime) which is a proprietary implementation of the CLI (Common Language Infrastructure). As far as I know, the CLR is the only implementation of the CLI on Earth, and so, any code that is specific to .NET would NOT work on the Borland compiler.
|
|
|
|
|
Hi all,
Hope somebody can help clear up an issue I'm experiencing trying to create an array of strings in my code. The line that is causing me all the problems is:
String* tst_str[] = {S"AA", S"BB", S"CC");
Now, when i include this in any of my main form member functions it compiles and links fine, however when I include it in a function in a separate source file (using the same namespace as my main form) I get the following linker error:
error LNK2001: unresolved external symbol "unsigned long const NSpace::$ConstGCArrayBound$0xb8408b96$1$" (?$ConstGCArrayBound$0xb8408b96$1$@NSpace@@3KB)
I have also found that I don't get this error message (even in the second source file) if I create the array first then assign each string to the appropriate position e.g:
String* tst_str = new String*[3];
tst_str[0] = S"AA";
tst_str[1] = S"BB";
tst_str[2] = S"CC";
Can anybody explain why this is happening??? I am reasonably new to this .Net programming so there is a good chance that this is something really simple that I just haven't grasped yet. As far as I can see from the reference books I have, the initial method of assigning the elements on the same line as the variable declaration is valid and will create an array of the appropriate size - but this does not appear to be what is happening?!?!
Any suggestions greatly appreciated
Gazmundo.
|
|
|
|
|
Hi,
I Try To Reproduce Your Problem.But I didn' get any error.First I thought u put bracket instead of curly braces.but it gives compile error not linker error. pl's cut paste the code i mean .h and .cpp file.
by
baijumax
|
|
|
|
|
The two .h and two .cpp files I created for a quick test are copied below. The main form just contains one button and one textbox - used to try and display the returned string from the 'Test' function in the other.cpp file.
Thanks
Gazmundo
Form1.cpp******************************************************
#include "stdafx.h"<br />
#include "Form1.h"<br />
#include <windows.h><br />
#include "other.h"<br />
<br />
using namespace arrtest;<br />
<br />
int APIENTRY _tWinMain(HINSTANCE hInstance,<br />
HINSTANCE hPrevInstance,<br />
LPTSTR lpCmdLine,<br />
int nCmdShow)<br />
{<br />
System::Threading::Thread::CurrentThread->ApartmentState = System::Threading::ApartmentState::STA;<br />
Application::Run(new Form1());<br />
return 0;<br />
}<br />
<br />
System::Void Form1::button1_Click(System::Object * sender, System::EventArgs * e)<br />
{<br />
String* tmp;<br />
tmp = Test(counter);<br />
textBox1->Text = tmp;<br />
counter++;<br />
if(counter>2)<br />
{<br />
counter =0;<br />
}<br />
}
***************************************************************
Form1.h********************************************************
#pragma once<br />
<br />
<br />
namespace arrtest<br />
{<br />
using namespace System;<br />
using namespace System::ComponentModel;<br />
using namespace System::Collections;<br />
using namespace System::Windows::Forms;<br />
using namespace System::Data;<br />
using namespace System::Drawing;<br />
<br />
public __gc class Form1 : public System::Windows::Forms::Form<br />
{ <br />
public:<br />
Form1(void)<br />
{<br />
InitializeComponent();<br />
counter=0;<br />
}<br />
Int32 counter;<br />
<br />
protected:<br />
void Dispose(Boolean disposing)<br />
{<br />
if (disposing && components)<br />
{<br />
components->Dispose();<br />
}<br />
__super::Dispose(disposing);<br />
}<br />
private: System::Windows::Forms::TextBox * textBox1;<br />
private: System::Windows::Forms::Button * button1;<br />
<br />
private:<br />
System::ComponentModel::Container * components;<br />
<br />
void InitializeComponent(void)<br />
{<br />
this->textBox1 = new System::Windows::Forms::TextBox();<br />
this->button1 = new System::Windows::Forms::Button();<br />
this->SuspendLayout();<br />
this->textBox1->Location = System::Drawing::Point(96, 168);<br />
this->textBox1->Name = S"textBox1";<br />
this->textBox1->TabIndex = 0;<br />
this->textBox1->Text = S"textBox1";<br />
this->button1->Location = System::Drawing::Point(128, 72);<br />
this->button1->Name = S"button1";<br />
this->button1->TabIndex = 1;<br />
this->button1->Text = S"button1";<br />
this->button1->Click += new System::EventHandler(this, button1_Click);<br />
this->AutoScaleBaseSize = System::Drawing::Size(5, 13);<br />
this->ClientSize = System::Drawing::Size(292, 273);<br />
this->Controls->Add(this->button1);<br />
this->Controls->Add(this->textBox1);<br />
this->Name = S"Form1";<br />
this->Text = S"Form1";<br />
this->ResumeLayout(false);<br />
<br />
} <br />
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e);<br />
<br />
};<br />
}
***************************************************************
other.cpp******************************************************
#include "stdafx.h"<br />
#include "other.h"<br />
<br />
using namespace arrtest;<br />
using namespace System;<br />
<br />
System::String * arrtest::Test(Int32 value)<br />
{<br />
String* fast_segments[] = {S"AA", S"BB", S"CC"};
return (fast_segments[value]);<br />
}
***************************************************************
other.h********************************************************
#pragma once<br />
<br />
namespace arrtest<br />
{<br />
using namespace System;<br />
System::String * Test(Int32 value);<br />
<br />
}
***************************************************************
|
|
|
|
|
Hi,
i Checked U R Test.cpp And Test.h files still i didn't get u r problem.but i wrote code for u check it out that may help u.
------------------Main App Code----------------
#include "stdafx.h"
#using <mscorlib.dll>
#include <tchar.h>
#include "TestString.h"
using namespace System;
// This is the entry point for this application
int _tmain(void)
{
CTestString obj; //Test Object
Console::WriteLine( obj.fast_Segments(0));
Console::ReadLine();
return 0;
}
----I wrote class CTestString .
----------------------------------TestString.h------------------------
#pragma once
#using <mscorlib.dll>
using namespace System;
class CTestString
{
public:
CTestString(void);
~CTestString(void);
String* fast_Segments(Int32 nKey);
};
---------------------------------------TestString.cpp---------------------------
#include "StdAfx.h"
#include "teststring.h"
CTestString::CTestString(void)
{
}
CTestString::~CTestString(void)
{
}
String* CTestString::fast_Segments(Int32 nKey)
{
String* ts_str[] = {S"AA",S"BB",S"CC"} ;
return ts_str[nKey];
}
by
baijumax
|
|
|
|