Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

Jan Sommer

@Jan Sommer
About
Posts
37
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Application that communicates with a database - how?
    J Jan Sommer

    Thanks for your reply David I'm looking for something more concrete then ODBC - That's certainly what I'm going to use since the application is going to be cross platform (and the database is an MS SQL Server). But how would you create the classes responsible for holding the database-data which the UI uses?

    C / C++ / MFC c++ csharp database business question

  • Get Installation path
    J Jan Sommer

    I'm pretty sure you can look that up in Windows registry... This code should get you started: http://msdn.microsoft.com/en-us/library/ms838625.aspx[^] Try searching the registry for microsoft sql-related keys and see if the path is there.

    C / C++ / MFC question sql-server help

  • is it possible to genarate barcode application using vc++6.0
    J Jan Sommer

    This might be a lame answer: Isn't barcodes just some kind of a font like this? Then I guess you could write the same code you usually use to draw text, but with the barcode font instead.

    C / C++ / MFC c++

  • Help in C++ needed
    J Jan Sommer

    we also might have a little problem with "int n;" because if "input / 9" gives decimals like 6.6, it will be converted to 7. so you might want to use a double there instead of int.

    C / C++ / MFC help csharp c++ java tutorial

  • Help in C++ needed
    J Jan Sommer

    Well I'm no math mastermind, but I think a way to solve your problem would be something like this... if(input > 9 && input < 100) { //if the input is above 9 and under 100 then we pretty sure only have 2 digits int n; n = input / 9; if(n*9 == input) { //The sum is 9 } } this only checks ONE input - you got to figure out a way to split the input by spaces and loop through it. Again, I have no clue if this is the simplest solution, but it should work

    C / C++ / MFC help csharp c++ java tutorial

  • Application that communicates with a database - how?
    J Jan Sommer

    If you couldn't use MFC integrated database-classes, and you had to create a simple application that communicated with a database, how would you do that? Would you use for instance SOCI, and make your non-GUI classes in STL? I mean, not use CString, but std::string, and when the GUI needs it, convert the std::string to CString and vica-versa? Or would you make all the classes in MFC and add some kind of extra database layer that converts the database-output from SOCI (which then would be a std::string for instance) and make it a CString for your business-object class and then pass that class to the GUI? Please tell if I'm not explaining this well enough.

    C / C++ / MFC c++ csharp database business question

  • Is Doc/View a great architecture?
    J Jan Sommer

    thank your for your informative reply. But MVC is not used in C++ is it? I thought it was for web applications only. Do you know of any documents that describe the Doc/View architecture in a way that's not MFC/wxWidgets-specific?

    C / C++ / MFC c++ css architecture question

  • Is Doc/View a great architecture?
    J Jan Sommer

    How come you think it's a bad design?

    C / C++ / MFC c++ css architecture question

  • Is Doc/View a great architecture?
    J Jan Sommer

    I want to develop an application with some kind of grid like the one in Excel. I'm using wxWidgets and there's support for the Doc/View-architecture. How many of you out there are using this for c++-applications? Are there better alternatives? It's a MDI-application with very few dialogs. If that matters.

    C / C++ / MFC c++ css architecture question

  • Which type should i use for saving a string like this: 000000-0000?
    J Jan Sommer

    Mika > Thanks a lot! That answer was very helpful. Blue_boy > You could format the integers when you show it to the user and easily insert the missing 0. But i'm convinced - i shall use varchar for SSN :)

    Database csharp database sql-server visual-studio algorithms

  • Which type should i use for saving a string like this: 000000-0000?
    J Jan Sommer

    That is why i'm asking the question - i don't know. Won't the performance fall enough to take the cpr-fields datatype into consideration?

    Database csharp database sql-server visual-studio algorithms

  • Which type should i use for saving a string like this: 000000-0000?
    J Jan Sommer

    Our customers are all id'ed by their social securitynumber (CPR) which is in the format 000000-0000 here in Denmark. How would you save this in the DB? The easiest way is ofcourse to save it as a string, but i'm also considering an integer-field. Does anyone know of the performance in searching when dealing with strings vs. integer fields (in a db), and would it be worth the effort to write code that converts between userinputted CPR's to integer? We are using MSSQL, and i'm programming in C# if it matters.

    Database csharp database sql-server visual-studio algorithms

  • class or struct
    J Jan Sommer

    Boxing occurs if you use reference types in structs.. also, if he only plans to use value types it doesn't allocate as much memory then classes... see http://msdn.microsoft.com/en-us/library/ah19swz4(VS.71).aspx for details

    C# csharp question database

  • Exposing List&lt;&gt; outside class [modified]
    J Jan Sommer

    i'm glad to hear i'm not completely wrong.. this sure have saved me a headache..

    C# question sales tutorial

  • Exposing List&lt;&gt; outside class [modified]
    J Jan Sommer

    Thanks... Didn't know of the ReadOnlyCollection but that seems reasonable to use..

    C# question sales tutorial

  • class or struct
    J Jan Sommer

    if you consider using anything else but value types , then use a class. If not, you're free to use a struct

    C# csharp question database

  • Exposing List&lt;&gt; outside class [modified]
    J Jan Sommer

    He said he didn't know a better way :P The first solution i came up with was to add this method to class Partner:

    public IEnumerator<Customer> GetCustomersEnumerator()
    {
    return this.cust.GetEnumerator();
    }

    which is working just fine for retrieving all the customers with this code:

    IEnumerator<Customer> alist = partners.GetCustomerEnumerator();

    while(alist.MoveNext())
    {
    Console.WriteLine(alist.Current.someProperty);
    }

    But in the userinterface, when a user clicks the customer (shown in a listview) i'd like to use the customer-index to retrieve the correct customer and send him to another dialog. Currently i'm only able to access each customers information and i can't pick a specific customer, since i don't have access to the list. Am i doing it all wrong? I was considering using a database which would make everything alot easier, but that would be too hard for the other students (according to my teacher :P)

    C# question sales tutorial

  • Exposing List&lt;&gt; outside class [modified]
    J Jan Sommer

    You're right - should be working now.

    C# question sales tutorial

  • Exposing List&lt;&gt; outside class [modified]
    J Jan Sommer

    Say i had this class:

    public sealed class Partner
    {
    string something;
    string somethingelse;
    List<Customer> customers = new List<Customer>();

    public List<Customer> Customers
    {
        get { return customers; }
    }
    

    }

    Is this bad practice? If so, how can i make it right and still be able to get all the methods a List<> provides? I know i could use class Partner : List<Customer> but inside Customer there's two Lists so that solution won't work there. Is it really necessary that i write a custom List for each object, just to maintain good coding practice? I'm asking because my teacher says that the above example is bad OOP - and because i'm developing an application that really needs the methods a List<> provides....

    modified on Wednesday, November 26, 2008 8:22 AM

    C# question sales tutorial

  • Extract certain text from a html page.
    J Jan Sommer

    scroll to the bottom of the page that i linked to :) EDIT: weird, if you come from google you can see the answer.. paste the link onto google.com and visit it from there. then scroll to the bottom.

    C# html com game-dev question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups