|
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
|
|
|
|
|
I'm attempting to write a managed wrapper interface to a native C++ class such that I can access it from within my C# code.
I'm using Visual Studio .NET 2003 on Windows 2000.
I started a new solution: Visual C++ Projects > Class Library (.NET)
My Stdafx.h file has the following in it:
#pragma once
#define WIN32_LEAN_AND_MEAN
#include
#include
using std::cout; using std::endl;
In the Solution Explorer, under Source Files I have the following:
1. AssemblyInfo.cpp
2. BiquadCode.cpp (native C++ code)
3. DSPWrap.cpp (the wrapper code)
4. Stdafx.cpp
Under Header Files, I have:
1. BiquadCode.h
2. DSPWrap.h
3. resource.h
4. Stdafx.h
I've "included" the Stdafx.h file in the first statement of DSPWrap.cpp.
On a build attempt, the code generated a C1010 error. For the files BiquadCode.cpp and BiquadCode.h, I've now set the precompiled header option as "Not using precompiled headers".
However, this throws a C1034 error
\DSPWrap\DSPWrap\Stdafx.h(9): fatal error C1034: windows.h: no include path set
My questions are as follows:
1. How do I get this code to compile?
2. Where exactly do I need to "include" the Stdafx.h file? Do I need to do it only once in the wrapper code file?
Thanks in advance!
|
|
|
|
|
Does anyone know how to determine at runtime the number of permissible values which an enum variable can assume?
Sparky
|
|
|
|
|
In Managed C++, you can use the static method on the Enum namespace which will give you an array of all the possible values. Just get the count of those values.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I need to wrap a native class for using it in C#
the class contain CString objects.
in old MC++ ver 2003 i write somthing like :
__property String * get_ImageName ()
{
return mBillPopJobParameters-> m_ImageName ;
}
__property void set_ImageName (String * pValue )
{
mBillPopJobParameters-> m_ImageName = pValue;
}
(m_ImageName is a CString.)
and it work ok.
when i try to use it in C++/CLI
property String^ ImageName
{
String^ get()
{
return mPrintSetParameters->m_ImageName ;
}
void set(String^ pValue)
{
mPrintSetParameters-> m_ImageName = pValue;
}
}
i get error that it can not convert from CString to String
any one know how to it right ?
Thanks.
Avraham Cohen.
|
|
|
|
|
Hi,
try This
if u R Accepts System::String _gc*
then (LPCTSTR) YourCString
by
baijumax
|
|
|
|