Jump to content
Xtreme .Net Talk

PhilBayley

Avatar/Signature
  • Posts

    69
  • Joined

  • Last visited

Everything posted by PhilBayley

  1. My apologies if this has be resolved before. I need to load an unmanaged c++ library into my c# application without knowing the name of it when the application starts. This is because I want to write many c++ dlls each one having the same set of functions but all doing different jobs. Im sure this is easy and other people must do it but I cannot find the solution anywhere. Help! Phil :(
  2. Hi, I may have missed this in a previous thread but I am having problems. When I post to a thread I expect to subscribe to that thread but it doesn't. Is this a known bug or have I got to do something to make this happen? Thanks Phil
  3. Niv, I get this quite a lot. Normally deleting my Debug or release directory cures it as it has to do a full rebuild of everything. Hope this helps Phil
  4. Thanx Nerseus, I am a pro developer and concidered the option of buying a third party product but we will get into big licensing costs when we distribute our product. The coding isnt a problem but finding the correct info to generate maths and graphics like that is a big part of writing the code. It looks like I will have to keep looking to the info I need. Cheers
  5. Umm as far as Art goes I am more autistic than artistic. IMO I would say that coding is just a logic thing and as long as you can make decisions and learn a little syntax, you will go far and earn a lot of money. If you are no good at learning syntax the hardest thing is knowing which bit of code to knick! :D
  6. I am trying to create 3d pie charts and explode them as I need. Is anyone really good at maths or know a book that I could get to give me the algorithms that I will need. I know c# has GDI functions to create pies and I can do the basics in this but I need to make it 3d and look brilliant. Hope someone can help Phil :D
  7. Is it possible to create a database (access mdb) in ado.net. I have done this in the past using adox but cannot find anything relating to it in c # Help PhilB
  8. I dont know about anyone else but c# is far more intuitive than vb (but then again I come from a c++ background). I am V. dissapointed though, as the whole .NET philosophy takes away some of the clever stuff that kinda made a C++ programmer worth his money. It is far easier to do things now than ever before. I actually feel more like a vb programmer than a c++ one ** Oh No I may forget what real code is !!! ** :D
  9. My VB is not very good but here goes (maybe someone else will correct this if im wrong) Dim myConnection As new SqlConnection(myConnString) Sim myCommand As new SqlCommand(mySelectQuery,myConnection) myConnection.Open() Dim myReader As new myCommand.ExecuteReader() Hope this helps a bit or look up SqlConnection in the visual studio help as this has a vb example.
  10. What sort of exceptions are you getting- have you tried stepping through the code to see what is incorrect and have you tried error catching which will give you more information. You should also make sure that you have privileges on the SQL Server to access the things your looking for. Let me know
  11. ok - Ive taken this from the help file in VS and messed with it a little. You may have to tweak it to fit but it should get you a list of databases with your sql server. You will need to pass it the correct connection string and convert it to VB (which shouldnt be too hard (only Im no good at it)). public void ReadMyData(string myConnString) { listBox1.Items.Clear(); string mySelectQuery = "SELECT NAME from sysdatabases"; SqlConnection myConnection = new SqlConnection(myConnString); SqlCommand myCommand = new SqlCommand(mySelectQuery,myConnection); myConnection.Open(); SqlDataReader myReader = myCommand.ExecuteReader(); try { while (myReader.Read()) { listBox1.Items.Add(myReader.GetString(0)); } } finally { // always call Close when done reading. myReader.Close(); // always call Close when done reading. myConnection.Close(); } } If you need the tables rather than the db's you have to find the correct sql query
  12. Whats the problem? Do you need an sql query to get the table names or do you need the code to make the connection and make the query?
  13. Not very helpfull but it sounds like a fdisk moment and a clean install. I had problems with Norten Firewall and VS so you could try disabling that (if ur using it). Best of luck though
  14. Blummin eck! I thought I had seen that before. Good job I dont make money from writing that stuff! Oops hang on - I do make money doing that. Oi!
  15. My colleague came up with a novel way to solve my problem, finding functions in the calling program (i didnt realise you could go both ways) Console.WriteLine("Executing Go (in PROJECT.DLL)"); Assembly a = Assembly.GetCallingAssembly(); Type myType = a.GetType("SlFuncs"); MethodInfo mymethod = myType.GetMethod("PhaseList"); Object obj = Activator.CreateInstance(myType); Object[] parameters = new Object[2]; parameters[0] = "Hello"; parameters[1] = 1234; mymethod.Invoke(obj, parameters); just for info if ever you need it and didnt know about it. Phil
  16. Howdy partner! I thought you were being clever with you new dot net code. Now I know where you get your ideas. :D :D Catch Ya later mate.
  17. BRILLIANT! Good idea. I was too stuck on the old way of doing things. I will try this on for size. Thanks
  18. The reason is legacy. A different team of developers may be writing the dll's. The main function of the app is to load different dll's (to process data in different ways) all of which get started with a function call (i.e StartThread) but in olden days of c++ we would first setup the addresses of certain functions like UpdatePercent (int iPercent) AddErrorMessage(string sTemp) And whilst the main thread was running the c++ dll could call adderrormessage to update a processing screen in the main app. All Ive been able to do so far is load my new c# dll and call a method from it - so no callback functions at all. I have managed to load old c++ dll's and run these by passing delegates to the old callback functions. All seems fine but this new c# stuff just seems to have taken the fun out of pointers :-) Any help would be cool. Ive been researching AsyncCallbacks and remoting but have had no success as yet
  19. Im not sure if this is supposed to go here. I am writing an app that will dynamically load an assemblie. I want to send the assemblie a callback address so that I can update a progress bar within the main app. How do I go about this concidering that the assembly knows knothing about the calling app (therefore defining the delegates a little difficult) and taking into account that the app will know nothing about the dll. This used to be very easy with c++ and I have managed to used callbacks from a c# app to a c++ dll without problem but I now want to convert my c++ dll into c#.
×
×
  • Create New...