Search results for query: *

  1. R

    vs2022 desktop - how to write/read runtime settings?

    Ahhha! That solved my problems entirely. Now I can use the simple appsettings.cfg without issues. I saw there were TWO entries for create a .net project but couldn't see any differences. The first project that worked fine was probably this version and the second where it didn't work was probably...
  2. R

    vs2022 desktop - how to write/read runtime settings?

    I tried wpf several times in the past and I honestly hate the system. The application I'm trying to write is for only my use and since it is all for me then I get the windows system that I like. As far as I can tell the appsettings.json file is only available for ASP programs (web programming)...
  3. R

    vs2022 desktop - how to write/read runtime settings?

    Well I think you are correct and that .net8 app.config doesn't work properly any more. I got as far as a routine to READ an appsettings.json file but cannot find any way to create one. I'm under the impression that there should be an item in the "add new" requester called something like App...
  4. R

    vs2022 desktop - how to write/read runtime settings?

    Ahhhaahhh! Ok, I will look into how to use the json settings then. Thanks a bunch!
  5. R

    vs2022 desktop - how to write/read runtime settings?

    Your code looks almost identical to mine but for some reason mine doesn't work (.net 8). Must be a bug in vstudio. I will create a new simple app in vs2022 and copy ALL of your code to it and see if it works. If not then I'll try vs2019... if not then I am totally clueless about what to do.
  6. R

    vs2022 desktop - how to write/read runtime settings?

    Well I created a much simpler app to do the same thing. One form, two buttons, nothing else. I changed from passing around the key name to just hard coding it and using cut and paste to eliminate any possibility of a spelling or case difference between the write and the read. Still same thing -...
  7. R

    vs2022 desktop - how to write/read runtime settings?

    For some reason my last project had no problems setting and reading things in my config file (appname.exe.config) but for some reason in a new app I can write to the file but never read anything but blanks. Here's what I am doing. The config file automagically appears in the debug folder (I...
  8. R

    Resolved public static function to return datatable? - public invalid

    Hmm, I deleted the entire thing and tried again - works just fine now. Not sure what the heck I did wrong the first time.
  9. R

    Resolved public static function to return datatable? - public invalid

    I'm trying to make a function to carry out SQL queries in my own libray but I can't figure out how to return the query result. Declaring the function "public static DataTable MyQuery(string sql) gives the error "public not valid". So I have to figure out how to get the data back to the caller in...
  10. R

    Program with central class calling other classes?

    I've done a lot of thinking and figured out that I can use a single form as the controlling code (always present, doesn't close). If I do that I can set public variables there and just refer to them from other forms - almost like a global variable even though they aren't. I can have each child...
  11. R

    Program with central class calling other classes?

    I'm familiar with amateur programming so I know about OOP and stuff (to a certain degree) but I'm not really liking having instances of everything and no global variables (I started using basic in the 1970s so I am biased). I've not done any real programming for probably 10 years but now I am on...
  12. R

    Converting C to C#, handling lack of local static vars

    ...approach or does anyone know a better way? An example of the C code is below. static void aaha_aux ( double lt, double x, double y, double *p, double *q) { static double last_lt = -3434, slt, clt; double cap, B; if (lt != last_lt) { slt = sin(lt); clt = cos(lt)...
  13. R

    How to do non-blocking TCP comms?

    Very interesting. I used VB for years and even learned a bit of VB.net so I'll have a good look - thanks!
  14. R

    How to do non-blocking TCP comms?

    Isn't this still unavailable in the main thread since the methods/vars are all static?
  15. R

    How to do non-blocking TCP comms?

    I'm playing with async TCP to communicate between two applications. I'm having a heck of a time trying to figure out how actually be able to use TCP messages. Using an async callback I can receive messages but since the method is static I can't access it or call non static methods from it - so...
  16. R

    Translations from XML files rather than baked into resx files?

    I didn't realize each resx file was compiled into a separate dll, I thought they were rolled into the program binary. Well that solves that problem. Now I just have to figure out how to get inno installer to include them. Should be pretty simple. thanks!
  17. R

    Translations from XML files rather than baked into resx files?

    Just started getting into adding different languages for an app, just en-US and fr-CA so far but I'm already realizing that I really want the words/phrases in a text file so changes and corrections can be made without having to re-compile. Should I just dump the Globalization string handling and...
  18. R

    Char* and [MarshalAs(UnmanagedType.LPStr)]

    Ok, thanks for the clarification. Just looking for shortcuts.
  19. R

    Adding namespace/classes to an existing namespace

    Ooh, I do have a real related question! When I've added a child namespace as above (I2CCmd) I have to preface the actual commands (I2CReadByte() etc) with the class name. I want to get around having the double I2C bit I2CCmd.I2CReadByte() which I could do by making each actual command a class...
  20. R

    Char* and [MarshalAs(UnmanagedType.LPStr)]

    On a related note. Is there a simple way to pass a list of bytes to a method? I noticed in the shared library (I think it's just C) you could pass bytes using curly braces and the receiver would automatically treat that as an array of bytes. Like this pseudocode (don't know C sytnax)...
Back
Top Bottom