How do I set the project to make a local copy of the imports? I guess there is a difference with C++ .NET and C# .NET because I've never run into a problem like this with C++. It always packaged everything it needed without my messing around with it. I have not yet used DX for audio/video. It is only being used graphically in this project at the moment.
Cyric74
Posts
-
Error: Failed to delay load library mscorlib.dll ? -
Error: Failed to delay load library mscorlib.dll ?I'm normally a C++ .NET programmer but have been working on a C# .NET DirectX project. Everything works fine for me, but when I try to give the executable and needed data files to friends, they all end up with errors that won't let the program load (all have the latest version of DirectX and .NET framework). At least one error I have seen is "Failed to delay load library mscorlib.dll (win32 error:998)" Am I missing something with how I compile my project? Any suggestions would be appreciated. Thanks Cyric cyric74@hotmail.com
-
C# Inherit Base Class Needs Variable - How?That worked, thanks a bunch.
-
Random numberDo you mean you want to keep generating them until they are not equal to each other? Or you're going to do something like fill an array up with random numbers but you don't want any to be the same as another number in the array? If you're wanting to generate them until they aren't equal just a simple while loop will work:
Random rd = new Random(); int m1 = rd.Next(1,x); int m2 = rd.Next(1,y); int iInfLoopChk = 0; //prevents while loop from locking your program in infinite loop while( m1 == m2 && iInfLoopChk < 5000 ) { m1 = rd.Next(1,x); m2 = rd.Next(1,y); iInfLoopChk++; }
^You'll need some logic if you're worried about the infinite loop that tells you both numbers cannot be anything other than equal to eachother. (Like if m1 is always 0 and m2 is always 0 due to logic error or special circumstance) -
C# Inherit Base Class Needs Variable - How?Hello, I'm normally a C++ .NET programmer but I'm building a DirectX game in C# .NET. I'm having a problem understanding how to pass a variable (directX device) to my Base class when declaring a Derived class. Example:
class Base { public Base( Device device ) {} ..process device physics.. } class Derived:Base { public Derived() {} ..variables for whatever object this is.. }
How would I declare an object of Derived class and pass my device object to the base class? Thanks for the help. Cyric74@hotmail.com -
MDI Child Waiting On Another ChildI'm working on a hobby war simulation game in Visual C++ .NET and am having a problem with multithreading. I don't know much about it, and am wondering if there may even be a better solution than multithreading for this problem: The game is running in an MDI parent with multiple forms. A user wants to move units from one city to another; The Main Menu child tells the Map child that it needs the user to select a target city. I want the Main Menu to pause its code processing at that point until the user selects a city, which then is passed back to the Main Menu so it may continue processing. The problem I am running into is this: The player selects an invalid city to move to -- I want to generate another MDI child that acts as a popup to inform them they can't move there and what their options are. When I do this (as shown in the code below) the new Popup child flashes on the screen for just a moment then disappears. I am guessing that this is because the Military_MoveThread is ending, so it closes anything initialized in the thread, but I am not really sure why it does this. I want the thread to end but the new MDI child popup to remain on the screen. I've tried running the popup as a new thread but it does exactly the same thing. Here is basically what I have:
//In the Main Menu -- Once player selects move: void InitiateMove() { ThreadStart *myThreadDelegate = new ThreadStart(this, Military_MoveThread); trd = new Thread(myThreadDelegate); trd->IsBackground = true; trd->Start(); } void Military_MoveThread() { //Opens the map form for selection theClient->EnableMap(); //Tells the map form that we are looking for a target theMap->iTargetMode = 1; //Sit and wait until the map decides we have a target while( theMap->iTargetMode == 1 ) { Thread::Sleep( 100 ); } //If they cancled the selection, return to normal mode if( theClient->iTargetCity == -1 ) { theClient->EnableAllForms(); theMap->EnableAllCities(); return; } //If they selected a city that isn't valid, pop up MDI child message box if( theClient->PlayerOwnsCity( theClient->iTargetCity ) == false && theClient->clientCityButtons[ theClient->iTargetCity ]->iOwner != -1 ) { Popup( String::Concat( S"Master ", theClient->Name, S", that city does not belong to us!" ) ); theMap->EnableAllCities(); theClient->iTargetCity = -1; return; } //***Code continues below for movement*** } void Popup( S
-
MDI Child Form Drag Without ToolbarHello, I've been working on an MDI .NET project and am having a problem with my MDI children. There are 6 children that have no toolbars, some are resizeable. I want the user to be able to click anywhere on the child forms (except for controls) and drag that child around anywhere inside the MDI parent. My problem is that I can't seem to get them to drag properly or look attractive while dragging. The mouse cursor will become offset during the drag and move ahead of the form, or there are bad trailing effects following the forms that won't go away until the user releases the mouse. I've been unable to find any information that would help with effecient and attractive full-form dragging. Basically I want to simulate dragging the form toolbar while clicking anywhere on the form. Any help or direction to an article/post would be very appreciated. Cyric
-
StringsString *Line = S"Most people find this hard"; String *char = S"t"; Int16 iBegin = 5; //Substring Line to all characters from iBegin on //Find index of 'char' in the substring Int16 iIndex = Line->Substring(iBegin)->IndexOf( char ); //Index total by adding whatever iIndex found with iBegin Console::Write( iIndex + iBegin ); *** That's probably the most simple way. There are some other ways (using IndexOf/IndexOfAny, or some other string functions that I don't recall at the moment) that may also work for finding a character within a specific range. Cyric