Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Not played with dynamic assemblies much but stepping through your code everything appears to be working apart from the .dll that is generated doesn't contain any types. If you open it with ildasm then it has a valid manifest but nothing else.
  2. Just to clarify - You would want the byte array to contain the numbers 1,2,3,4,5,6?
  3. try rk.SetValue("Valid","True")
  4. The code is almost identical to what you requested here except you can use CreateSubKey instead of OpenSubKey and SetValue instead of GetValue.
  5. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim rk As Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("software\revoshift\webhost toolbox\") If Not rk Is Nothing Then If rk.GetValue("valid") = "true" Then MessageBox.Show("Yippe") End If End If End Sub I had the slashes the wrong way round in my earlier post :), what you get for not testing....
  6. If you put a watch on the value rk.GetValue("valid") what appears in the debugger?
  7. If you step through in the debugger does it go to the line If rk.GetValue("valid") = "true" Then if so what is the value of rk.GetValue("valid") ?
  8. Not that different from above Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim rk As Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("software/revoshift/webhost toolbox/") If Not rk Is Nothing Then 'key did exist If rk.GetValue("valid") = "true" Then 'value is correct End If End If End Sub
  9. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim rk As Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.Users.OpenSubKey("Test") 'your key here If rk Is Nothing Then 'key didn't exist End If End Sub
  10. If the above code is VB6 then some of the datatypes need to be chanced: Long should be converted to Integer.
  11. Is the Main forms IsMdiContainer property set to true?
  12. Hmm, strange thing is I'm getting this error on my laptop yet it worked at home - however I am experiencing other network oddities on this PC. Having rummaged around the internet a couple of things seem to cause this to occur http://support.microsoft.com/default.aspx?scid=kb;en-us;815209 being one of them. Also http://support.microsoft.com/?id=826757 may be of some use. I've also seen the odd report of AV software causing this - if you are running any it may be worth disabling it to see if that helps.
  13. In the property grid does the connectionstring property have a funny blue icon next to it? If so things are working. Easiest way to check is run the app & test, then change the web.config and test again to see if it fails.
  14. May not be the only (or even easiest) way but the following snippet shows how to use the StackTrace and StackFrame classes to get at this kind of information. It actually gets the methodname, filename and linenumber and displays them in a messagebox. Dim st As New StackTrace(0, True) 'will record this line number Dim sf As StackFrame = st.GetFrame(0) MessageBox.Show(String.Format("File {0}, Method {1}, Line {2}", _ sf.GetFileName(), sf.GetMethod().Name, sf.GetFileLineNumber())) The following two links explain more on StackTrace and StackFrame http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDiagnosticsStackTraceClassctorTopic8.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticsstacktraceclassgetframetopic.asp If you are using this a lot then you may want to wrap it in a function or class - in that case you will probably want to use st.GetFrame(1) to get the details of the calling function. Play around with the numbers and it will become clear.
  15. If you have dragged the connection to a web form then select the connection object and on the property grid expand dynamic properties. From there you should be able to make the connection string dynamic (i.e. moved to web.config)
  16. If you have a reference to the DLL then it should show the contents of the dll as well if not there should be a button labelled 'customize...' - you can add in external DLLs from there as well.
  17. If you import the .reg file into the installer then the registry will be updated as part of the install process, VS itself will not be responsible for running the files in question. If you go through the setup wizard I mentioned above you will get a .MSI file produced which contains the files required to install the product (and associated path information), file extensions, registry keys, UI for the installer, install conditions etc. A user wanting to install the product would run this .MSI and it would install the product, configure the PC based on the settings you configured. If you have a run through the wizard you will see it is quite easy to follow for a simple setup package.
  18. IIRC you can end a pocket pc app the same way you would end a normal windows app, simply close the form that is the 'main' form (the one handling the windows message pump). I would imagine you can switch the main form by using application.run, the same as a normal windows application.
  19. View Menu -> Object Browser is the nearest thing to the VB6 version. Also have a look at http://www.xtremedotnettalk.com/showthread.php?t=77697 for a sample on how you colud do this yourself.
  20. If you use Visual Studio's setup wizard then it will generate a basic setup package that will allow the user to choose their own install path for the application anyway. If you require other files to be added then you can add a new custom folder to the setup and give it a path of c:\base or where ever and drop your file into it. This should then deploy it to the required location. Also as part of this setup package you could import a .reg file so the registry keys are created as part of the install as well.
  21. Does this happen on a particular line of code or just in general? If possible could you post the offending code?
  22. How large a file (roughly) breaks the system? Also, could you not break the file down into smaller chunks and send those instead? You may want to look Here, for a sample that does simple transfer of files.
  23. Paint is the event in which a consumer of your control (form etc containing your control) can react to your control drawing itself. Paint is an Event and as such requires an event handler (delegate) to be connected. OnPaint is a method rather than an event - you would normally override the OnPaint method in a control if you are inheriting from a parent control (nearly always the case as you would normally inherit from Control or a derivative of Control), performing the relevant drawing code there. If you are using OnPaint then calling base.OnPaint will call all the base class' drawing code and invoke any attached event handlers.
  24. And also the CLRProfiler from MS is useful for tracking memory etc. Finaly Process Explorer from sysinternals can give some useful inf on .Net apps.
  25. Have a look here for a .Net profiler - still in alpha but worth a look.
×
×
  • Create New...