|
Hi All , i am new to Visual Studio.Net and wanna ask a beginner level question.please reply if anyone knows about it.
I am using Visual Studio .Net 2002, Whenever i complie and run any sample a from Msdn2002\Disk1\Samples\VC\ManagedExtensions\WindowsForms,I always got a Console window and then the original form (dialog) appears on the screen. can some please tell me how to hide the Console Window ?
remember there is only one sample which dose not show the Console windows (DOS) before showing the main dialog...
\Msdn2002\Disk1\Samples\VC\ManagedExtensions\WindowsForms\calculator
|
|
|
|
|
I accept I may not be the brightest chap I know , but can someone explain to me why when I write managed C++ my source code goes in the .h file and my includes go in my .cpp ?
|
|
|
|
|
|
|
Andrew Torrance wrote:
managed C++ my source code goes in the .h
Templated code? Templates belong in the .h
Andrew Torrance wrote:
my includes go in my .cpp
#include s belong in the .cpp, unless you *absolutly* need to have them in the .h, like you need for the includes of member variables.
Maybe its alright, or maybe your IDE needs ist weekend as well...
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Oops. Change the search start date and i found a question pertaining to this already. Seems to be a problem with vs.net 2002.
|
|
|
|
|
I'm trying to implement a collection class based on arraylist for a class library and I'm not sure how i'm supposed to get an indexer working with a covariant return type. I know covariance isn't spupporterd in mc++ but there's gotta be a way to create a custom collection......isn't there?
|
|
|
|
|
Hi,
Is there a 'WaitForSingleObject()' similar method in managed C++ ?
thanks.
|
|
|
|
|
|
The code below is my original unmanaged C++ code:
//**********************************************
UINT ThreadFunction(LPVOID pParam)
{
DWORD dwWait;
while (TRUE)
{
.
.
//do something
.
.
dwWait = WaitForSingleObject(m_event,1000);
if (dwWait == WAIT_OBJECT_0)
break;
}
return 0;
}
//**********************************************
I want to implement something like this.
Can you help me ?
Thanks in advance,
Camilo.
|
|
|
|
|
Looks like you want to use the ManualResetEvent/AutoResetEvent:
AutoResetEvent *m_wait = new AutoResetEvent( false );
if( m_wait->WaitOne( 1000, <exit-context-true-or-false> ) )
do-this-if-wait-was-signalled;
else
do-this-if-timed-out;
-------
For the above Wait to continue, either the time has to elapse or another thread has to execute the following code:
m_wait->Set();
Check out MSDN help.
|
|
|
|
|
thanks for your help !!!
|
|
|
|
|
Hi
Why are DataGrids in C++ .NET so slow?
I am creating a dataset, and a data table with a single row, and it takes a couple of seconds to display the initial data in a datagrid, what am i doing wrong?
cheers
|
|
|
|
|
I have also noticed this
on the first instantiation the system runs slow and for every other after the code runs much faster...
wish I could answer this one
|
|
|
|
|
Hi
Why are DataGrids in C++ .NET so slow?
I am creating a dataset, and a data table with a single row, and it takes a couple of seconds to display the initial data in a datagrid, what am i doing wrong?
cheers
|
|
|
|
|
I am from China, so please forgive my poor English.
I've got a terrible question when i try to use [FieldOffset ..] in C# to simulate the function of "union" in C.
this my code:
[StructLayout(LayoutKind.Explicit)]
public struct union
{
[FieldOffset(0)]
public union1 u1;
[FieldOffset(0)]
public union2 u2;
}
public struct union1
{
[MarshalAs (UnmanagedType.ByValArray,SizeConst=2)]
public byte[] arra1;
}
public struct union2
{
[MarshalAs(UnmanagedType.ByValArray,SizeConst=2)]
public byte[] arra2; //when I turn "byte" type to "int", it is OK! Or if i turn both "byte" to "int" in union1 and union2, it is OK too! ???
}
public void testUnion()
{
union u;
}
that is , I want to make a simple union comprising two "byte" Array at the
same offset, it's compiled successfully, but when i run testUnion(), i get a "System.TypeLoadException". What's more strange is that when i turn one or both of the two "byte" Array to "int" Array (or "long"), it just run Ok!
Any help will be deeply appreciated!
|
|
|
|
|
What is the best way to get x-number of bytes of memory into a byte array and back.
Basically I am trying to copy some unmanaged memory into and out of a DirectPlay NetworkPacket. I haven't found a clean (or semi-clean) solution yet.
Any ideas out there?
Thanks!
|
|
|
|
|
Have you tried System.Runtime.InteropServices.Marshal ?
void Copy(
IntPtr source,
unsigned char destination __gc[],
int startIndex,
int length
)
and
void Copy(
unsigned char source __gc[],
int startIndex,
IntPtr destination,
int length
)
|
|
|
|
|
Who can tell me the name of the Subscript 'operator[]' in ManagedC++?
For example the standard C++ assignment operator is 'operator=', but in managed C++ it is 'op_Assign'.
I tried 'op_Subscript', 'op_ArraySubscript' and some others. I need it to access arrays within a class directly (e.g. Classname[i] instead of Classname.Arrayname[i] (member) or Classname.Value(i) (function Value)) just to have a clear source code in complex matrix and vector computations.
Perhaps it is not implemented (yet) in C++ .NET (just like the standard class template). Microsoft did a very bad job here!
Thanks
Elwin
|
|
|
|
|
Hi,
I've created a managed C++ project, so the startup object is the 'Form1' object.
My problem is that I've created a second class called 'Form2' and I want to declare a variable of type 'Form1' within this class (Form2)... Howw can I do this ?
thanks.
|
|
|
|
|
You must add the #include "Form1.h" in stadfx.h and you should work in Form2.cpp where the stdafx.h is included by default.
In this way it works well!!
|
|
|
|
|
I have been looking all over without finding any proper explanation of how to use unmanaged C++ in C# with the help of managed C++. Can anyone please give a simple step by step guide how to create the projects and show what settings to fiddle around with? (Please don't give any links to MSDN, I allready checked them out and it didn't help (sure I might be stupid but not really that stupid..)).
Thank you.
|
|
|
|
|
go to the below url i have tried it and it works fine good luck.
http://www.codeproject.com/csharp/unmanage.asp
|
|
|
|
|
Thank you, but I'm still looking for a proper explanation of how to write wrapper classes in managed C++ for my unmanaged C++ classes. Sorry I didn't tell in the first message.
|
|
|
|
|
moist wrote:
how to write wrapper classes in managed C++ for my unmanaged C++ classes.
Look here[^]
|
|
|
|