Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Looks like you are creating a table called AGPO but refering to one called AGPOInfo for starters. Also if you step through the code in the debugger does it call into the above routine correctly? Also where is blnCreated declared / accessed?
  2. Looks like the AGPOInfo table hasn't been created.
  3. something like SELECT rank, (cast (rank as float) * 100 / (select sum(rank) from tblpoll)) from tblpoll without knowing the table structure for sure I can't be sure. However here is a similar idea using northwind's Employees table select reportsto,(select sum(reportsto) from employees), (cast (reportsto as float) * 100 / (select sum(reportsto) from employees)) from employees
  4. When you get this error what is the value of dsAGPOs and dsAGPOs.Tables("AGPOInfo") in the debugger?
  5. If you want to create an unmanaged data type then you really need to look at C++ (or managed C++). C# allows you to interact with non-managed types but in itself it only creates managed types. Not sure what you mean by 'Run Inheritance' - could you give a little more detail?
  6. It would create copies given your original code as you've declared SQUARE as being a struct and this is a value type (i.e. in use it IS the data rather than a pointer to the data). If you declare SQUARE as being a class then it becomes a reference type and will behave how you desire (the array will contain references (similar to pointers in this respect) rather than copies)
  7. Threading isn't difficult as such but can get complex if variables need to be accessed by multiple threads - you will probably need to investigae the Monitor class. Also depending on your language have a look at either lock (C#) or SyncLock(VB). If you give a bit more detail and / or post some code we may be able to help a bit more.
  8. Have you also added the include directories for DirectX on the same tab? (change the drop down on the top right to 'Include Files')
  9. IIRC there is no easy way to use pointers with managed types - it will introduce issues with memory management for starters. Under normal conditions any memory allocated from the managed heap can have it's address changed at runtime by the GC, this is transparent to the application though. When dealing with unmanaged memory it needs to be fixed in place and can affect the GC's ability to manage memory efficiently. If you posted a bit more of the code regarding Neighbours then it may make things clearer. That said my initial reaction is to ask why you are using pointers in this case anyway - if the structure (SQUARE) is a managed type and it is being called from managed code then I'm struggling to see the benefits of pointers, wouldn't it be easier to store Neighbours either as a managed array or in some other structure like a HashTable or ArrayList? Creating a managed array of pointers seems an unnecessarily complex way of approaching the problem. Would the following not be suitable class SQUARE //probably better using a reference type rather than a value type in this case { public byte Owner,Units; public SQUARE[] Neighbors; public void AddUnit(byte owner) { byte i; this.Units++; this.Owner = owner; if(Neighbors.GetUpperBound(0) < Units) { Units = 0; Owner = 0; for(i=0;i<=Neighbors.GetUpperBound(0);i++) { Neighbors[i].AddUnit(owner); } } } } and S[x,y].Neighbors[0] = S[x,y];
  10. The next version of VS has some nice improvements in this area for C# type if and hit TAB and you will get if (true) { } auto generated, there are similar ones for looping, try...finally blocks etc
  11. Could you post the actual code from the paint event. Also why are you creating a graphics object in the Form Load if you are doing your rendering in the paint event - you should really use the e.Graphics that is passed into the paint event procedure.
  12. Could you post a sample of the XML that is passed into and back from this function? From both versions of the function if you could. Also is the snippet you posted a cut down version of the real functionality as you seem to have a redundant If (iRetCode < 0) check as you always just return the code anyway. Out of interest is the XML you are recieving / passing back defined by a particular scema (XSD)?
  13. You would need to either pass a reference from the main form to the pop-up form so the popup knows which form to update (look here for more info on that), or alternatively in the Main Form's button click event read the selected value from the popup (you could always expose the selection as a property) and act on it after the 'Save' button has been clicked.
  14. http://msdn.microsoft.com/library/default.asp?url=/nhp/default.asp?contentid=28000410
  15. The code could be executed via a command object - would only take about 1/2 hour to knock up a basic text editor in VB and give it the ability to execute SQL code via a command object.
  16. At a guess i would say ASP is going to be around for at least another 5 years or so - MS will support W2K till then and IIS that shipped with W2K supported it so it seems logical. In practice W2003 supports ASP so it could be supported for nearly 10 years. No immediate rush ;) Saying that ASP.Net is far superior to classic ASP and when you make the move you won't regret it.
  17. As part of the install it should include everything you need. All the tools etc from the Framework SDK will be installed as well.
  18. You may be surprised to find that MSDN says that it:
  19. http://msdn.microsoft.com/vstudio/productinfo/trial/
  20. Under .Net a Form is just a class - you can no longer just refer to the form name, instead you create an instance of the class and assign it to a variable. If the form in question is the startup object then VB sorts that out for you behind the scenes. Me as a variable always refers to the current cobject (in this case the instance of frmMain) and Me.Text should set the form's caption. Did you try the me.text? If so was there a problem? You may want to have a look here for a bit more info on working with forms under .Net
  21. is frmMain a class of an instance of the form? You may be better of using me.text rather than frmMain.ActiveForm.Text
  22. WithEvents was originally there to allow you to declare variables that could raise events and allow you to handle those events e.g. Recordset as VB6 and earlier had no easy way in the language to dynamically wire-up event handlers at runtime. In VB.Net the AddHandler / RemoveHandler remove the need for WithEvents but it is still there for backwards compatabiliity. The Overloads keyword does actually server a purpose - in the following code snippet it isn't require for the two methods in the class Base - if you provide the keyword on one of the methods though it must be supplied on all the overloaded 'Test' methods. However in the Derived class it will be used to make our intentions clearer - are we adding an overloaded version or hiding the original implementation? Public Class Base Public Sub Test(ByVal i As Integer) End Sub Public Sub Test(ByVal s As String) End Sub End Class Public Class Derived Inherits Base Public Overloads Sub test(ByVal b As Boolean) 'Public Shadows Sub Test(ByVal b As Boolean) End Sub End Class using the overloads then a variable of type derived will have 3 overloaded Test methods - using the version with shadows it would only have 1 (accepting a boolean).
  23. A strong name in itself wouldn't help in this case, a strong name would allow you to install your component in the GAC and protect against obvious atempts to replace your DLL with a 3rd party one. In this case JABE's suggestion is worth investigating further as it really is the most appropriate solution.
  24. Have you rebuilt the web service since you copied it over (just to check)? Also when you get the 404 what is the url you are browsing to?
×
×
  • Create New...